-
Notifications
You must be signed in to change notification settings - Fork 10
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[1.0-beta1.1] Store proposed producers and proposed finalizers in building block #189
Conversation
…lock instead of global_property_object. Fixes bug with non-shared types of finalizer_policy being stored in chainbase.
// proposed_schedule.version is set in assemble_block | ||
trx_blk_context.proposed_schedule.producers = std::move(producers); | ||
|
||
return std::numeric_limits<uint32_t>::max(); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is this meant to be a uint32_t
instead of int64_t
? I realize that's how it was before this PR but the types being mismatched here looks sus
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes, that is in accordance to what @arhag requested.
spring/libraries/chain/include/eosio/chain/webassembly/interface.hpp
Lines 156 to 157 in 8ac6281
* @return pre-savanna: -1 if proposing a new producer schedule was unsuccessful, otherwise returns the version of the new proposed schedule. | |
* post-savanna: -1 if proposing a new producer schedule was unsuccessful, otherwise returns max uint32_t |
Note:start |
Validated this is working
|
The chainbase
global_property_object
was used to storefinalizer_policy
during block construction as a means to provide automatic rollback if the transaction/block failed. See #99. However,finalizer_policy
contains non-shared types ofstd::vector
andfc::crypto::blslib::bls_public_key
.This PR solves the problem of avoiding side-effects of proposed finalizer policy made in an aborted transaction in a different way than committing the speculative changes into the
global_property_object
inchainbase
. Now we store the speculative changes in the transaction context. Then if we commit the transaction, it copies them over (assuming they are not nullopt) from the transaction context to the building block. This avoids having to add a shared version of thefinalizer_policy
andbls_public_key
.For symmetry, the proposer schedule in Savanna was modified to also be managed the same way as
finalier_policy
intransaction_context
.This PR removes
proposed_fin_pol_block_num
andproposed_fin_pol
fromglobal_property_object
and therefore is not state compatible with previous versions. The proposed scheduleproposed_schedule_block_num
&proposed_schedule
were not removed fromglobal_property_object
because they are still needed pre-Savanna.Note PR #188 targets
main
.main
includes producer and finalizer diffs. This is a cherry-pick of #188 with additional changes to fix merge conflicts.Resolves #182