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

Fallback For Deposit Trie Creation #8869

Merged
merged 7 commits into from
May 9, 2021
Merged

Conversation

nisdas
Copy link
Member

@nisdas nisdas commented May 7, 2021

What type of PR is this?

Bug Fix

What does this PR do? Why is it needed?

  • In the event our finalized deposit trie has some inconsistencies with the canonical eth1data deposit root, we rebuild the whole trie. This so as to prevent invalid deposit proofs from being created.
  • Add in unit tests.

Which issues(s) does this PR fix?
N.A

Other notes for review

@nisdas nisdas requested a review from a team as a code owner May 7, 2021 10:00
@codecov
Copy link

codecov bot commented May 7, 2021

Codecov Report

Merging #8869 (ed0f37a) into develop (050b244) will decrease coverage by 0.31%.
The diff coverage is 80.76%.

@@             Coverage Diff             @@
##           develop    #8869      +/-   ##
===========================================
- Coverage    60.71%   60.40%   -0.32%     
===========================================
  Files          527      527              
  Lines        37086    37376     +290     
===========================================
+ Hits         22518    22577      +59     
- Misses       11345    11565     +220     
- Partials      3223     3234      +11     

beacon-chain/rpc/validator/proposer.go Outdated Show resolved Hide resolved
valid, err := vs.validateDepositTrie(depositTrie, canonicalEth1Data)
// Log an error here, as even with rebuilding the trie, it is still invalid.
if !valid {
log.Errorf("Rebuilt deposit trie is invalid: %v", err)
Copy link
Contributor

Choose a reason for hiding this comment

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

Shouldn't err be returned from the function instead of just logging? We essentially have a problem with generating the deposit trie.

Copy link
Member Author

Choose a reason for hiding this comment

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

The purpose is to log more strongly here, even if we fail creating a valid deposit trie we can still propose a block( as long as there are no deposits)

@nisdas nisdas merged commit 255354f into develop May 9, 2021
@delete-merged-branch delete-merged-branch bot deleted the fallbackForTrieGeneration branch May 9, 2021 23:34
@prestonvanloon
Copy link
Member

How long does a rebuild of the deposit trie take in mainnet? Proposal contexts are given a short TTL, if this routine takes more than a full slot then it may fail entirely.

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.

3 participants