-
Notifications
You must be signed in to change notification settings - Fork 242
More robust caching of validator schedules #4461
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
Conversation
@@ -362,13 +360,6 @@ contract_call(ContractPubkey, Src, Fun, Args, Amount, From, Nonce) -> | |||
{ok, Tx} = aect_call_tx:new(TxSpec), | |||
Tx. | |||
|
|||
%% This test is trivially true, since we already check in | |||
%% sync when producting the blocks. | |||
mine_and_sync(Config) -> |
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.
Perfectly fine to remove obsolete test
%% We buffer the seed two epochs | ||
ParentHeight = rpc(?NODE1, aec_consensus_hc, entropy_height, [Epoch]), |
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.
Much nicer now with aligned logic
case Height == maps:get(last, EpochInfo) of | ||
true -> | ||
{ok, Seed} = get_entropy_hash(Epoch + 1), | ||
{ok, Seed} = get_entropy_hash(Epoch + 2), |
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.
Possibly document the "random" +2 used here ;).
Main observation, at the point where we call
step_eoe
we know the seed/hash (and thus in effect the schedule) for next-next Epoch. No point in not caching that schedule right away.Second issue is bootstrapping after restart, that should be handled by the current code, but there are no tests for it.
This PR also adds a test that puts microblocks in all positions in an epoch.
Finally it aligns
entropy_height
with the Whitepaper.Fixes #4458.
This PR is supported by Æternity Foundation.