8000 More robust caching of validator schedules by hanssv · Pull Request #4461 · aeternity/aeternity · GitHub
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content

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

Merged
merged 4 commits into from
Oct 30, 2024

Conversation

hanssv
Copy link
Member
@hanssv hanssv commented Oct 29, 2024

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.

@@ -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) ->
Copy link
Contributor

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

Comment on lines +483 to +484
%% We buffer the seed two epochs
ParentHeight = rpc(?NODE1, aec_consensus_hc, entropy_height, [Epoch]),
Copy link
Contributor

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),
Copy link
Contributor

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 ;).

@hanssv hanssv merged commit f30ecd7 into master Oct 30, 2024
40 checks passed
@hanssv hanssv deleted the GH4458-more_robust_schedule_caching branch October 30, 2024 12:53
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
Status: No status
Development

Successfully merging this pull request may close these issues.

Micro-block at epoch boundary fail to sync
4 participants
0