Skip to content
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

Minor post-merge cleanups #3945

Merged
merged 2 commits into from
Aug 10, 2022
Merged

Minor post-merge cleanups #3945

merged 2 commits into from
Aug 10, 2022

Conversation

zah
Copy link
Contributor

@zah zah commented Aug 9, 2022

#3944

The use of nested awaitWithRetries calls would have
resulted in an unexpected number of retries (3x3).
We now use regular await in outer layer to avoid the problem.

#3943

The new code has an invariant that the headMerkleizer field in
the Eth1Chain is always kept in sync with the blocks stored in
the chain.

This invariant is now enforced better by doing the necessary merkleizer updates
in the Eth1Chain.addBlock function, in the Eth1Chain.init function and in the
Eth1Chain.reset function.

#3944

The use of nested `awaitWithRetries` calls would have
resulted in an unexpected number of retries (3x3).
We now use regular `await` in outer layer to avoid the problem.

#3943

The new code has an invariant that the `headMerkleizer` field in
the `Eth1Chain` is always kept in sync with the blocks stored in
the chain.

This invariant is now enforced better by doing the necessary merkleizer
updates in the `Eth1Chain.addBlock` function.
@github-actions
Copy link

Unit Test Results

0 files   -        12  0 suites   - 860   0s ⏱️ - 1h 6m 17s
0 tests  -   1 911  0 ✔️  -   1 764  0 💤  - 147  0 ±0 
0 runs   - 10 341  0 ✔️  - 10 151  0 💤  - 190  0 ±0 

Results for commit 6ba7fba. ± Comparison against base commit ede83b1.

beacon_chain/eth1/eth1_monitor.nim Show resolved Hide resolved
Comment on lines +809 to +810
## This function will return true if the Eth1Monitor is synced
## to the finalization point.
Copy link
Contributor

@etan-status etan-status Aug 10, 2022

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Wasn't there a convention that function comments should use the imperative form (Return true if the Eth1Monitor is synced to the finalization point) instead of descriptive form (the current version) or the most common third person form (ReturnS true if ...)? I can't find it in the style-guide anymore but I remember seeing something suggesting imperative form after running into this style in a couple modules. Maybe it's also an Ethereum style rule (they use imperative as well).

Also, Indicate whether vs Return true if, to better describe the false case

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I've changed the wording because yesterday while reading the code I was confused for a moment that the comment was referring to the if statement below which didn't make sense.

research/block_sim.nim Show resolved Hide resolved
@zah zah enabled auto-merge (squash) August 10, 2022 11:47
@zah zah merged commit d64c17f into unstable Aug 10, 2022
@zah zah deleted the 10082022-eth1-fixes branch August 10, 2022 12:31
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants