Giter Site home page Giter Site logo

Implement block producer scheduling about eos HOT 4 CLOSED

eosio avatar eosio commented on June 21, 2024
Implement block producer scheduling

from eos.

Comments (4)

nathanielhourt avatar nathanielhourt commented on June 21, 2024

Paging @bytemaster

from eos.

bytemaster avatar bytemaster commented on June 21, 2024

EOS block producers should be scheduled same way as latest STEEM producers.

One thing I would like to consider is reducing the 128 bit math for virtual time and position with 64 bit math.

21 producers, top 20 by approval voting every round, last 1 selected based on virtual schedule.

A producer who misses a block after not producing for 24 hours is automatically unscheduled by setting their signing key to null. Skip any producers whose signing key is null.

Only other difference from STEEM is that only a single layer of proxy voting will be supported.

from eos.

bytemaster avatar bytemaster commented on June 21, 2024

These fields are used for the Producer scheduling algorithm which uses
* virtual time to ensure that all witnesses are given proportional time
* for producing blocks.
*
* @ref votes is used to determine speed. The @ref virtual_scheduled_time is
* the expected time at which this witness should complete a virtual lap which
* is defined as the position equal to 1000 times MAXVOTES.
*
* virtual_scheduled_time = virtual_last_update + (1000MAXVOTES - virtual_position) / votes
*
* Every time the number of votes changes the virtual_position and virtual_scheduled_time must
* update. There is a global current virtual_scheduled_time which gets updated every time
* a witness is scheduled. To update the virtual_position the following math is performed.
*
* virtual_position = virtual_position + votes * (virtual_current_time - virtual_last_update)
* virtual_last_update = virtual_current_time
* votes += delta_vote
* virtual_scheduled_time = virtual_last_update + (1000
MAXVOTES - virtual_position) / votes
*
* @defgroup virtual_time Virtual Time Scheduling
*/
///@{
fc::uint128 virtual_last_update;
fc::uint128 virtual_position;
fc::uint128 virtual_scheduled_time = fc::uint128::max_value();

from eos.

nathanielhourt avatar nathanielhourt commented on June 21, 2024

Still TODO here:

  • When an account approves/unapproves a producer, add/remove that account's stake to that producer's votes
  • When an account gains or loses stake, add/remove the gained/lost stake to all producers that account votes for
  • Calculate the producer round changes in generate_block and add to block header
  • Proxied voting...?

If I'm not mistaken, we can ignore the CreateAccount initial deposit of stake, as a newly created account cannot be voting for anything yet, so we need do no updates until the new account creates a transaction voting for something, at which point it will be handled as usual. The only times the stake will change are TransferToLocked and StartUnlockEos

It could be argued that a newly created producer should automatically have its creator's stake voting for it; however, I don't think this is necessary, and I'm not confident it's even desirable, so for now I will leave newly created producers as having no votes.

from eos.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.