Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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
fix(state-transitions): verify deposits against contract #2115
fix(state-transitions): verify deposits against contract #2115
Changes from 60 commits
f4a7d79
0f46172
22c7717
05cba80
443ac1b
10efd5e
099716d
151a533
9818c7e
160cc88
6a191d1
64d19e5
d94bf97
4a9fe1c
67f2597
e048be4
8bf34db
d90a95a
e17d29c
7b2bf91
6286b20
df81bae
af8c5e0
023ebfd
d66b298
18ba094
e47219a
a3cd2d9
3a0923e
712d3fe
6b90b87
83ad2fd
69d568b
a7143e8
6ce250d
0fc3868
10bd597
a15eaa3
b45654b
463489b
333764d
8b2e72d
19c311a
4480026
9285445
4512758
1aafb3d
11c2688
80bb656
628dbba
386087d
c087141
2ad5fc1
7a2813b
099c5ae
94ff29d
a75a0c2
9f47011
8cf2154
7d22a92
84cf57d
14f9416
8f8a1b3
File filter
Filter by extension
Conversations
Jump to
There are no files selected for viewing
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.
anchored mockery to avoid frequent updates. We can revisit say once per month
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.
for the fields that are special types, should we use
bytes.Equal
or the type'sEquals
method?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.
I would say their equals, but we should be good now
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.
correct me If I'm wrong, but just confirming, this case is only triggered when blockNum is 0?
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.
as the values are set right now yes. However that is not really hit, since we don't emit a finalized block event on genesis
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.
Will never need to query the logs from block height 0. So the first block to query for should be 1.
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.
🧹 Nitpick (assertive)
Add function documentation
Please add a documentation comment explaining the purpose of this function, its parameters, and return values. This will help other developers understand the validation rules for genesis deposits.
Add this documentation above the function:
📝 Committable suggestion
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.
what error is exactly returned here? Should we explicity check that the error contains "not found" ?
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.
Can't do now without importing cosmos sdk module here, which we really don't want. I wrote a comment about this but maybe got lost in updates. Let me find it
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.
For the very first deposit, where
Eth1DepositIndex
has not been set yet, we have a ErrNotFound kind of error. This is fine (we haven't even set a single deposit) but it should only happen for the very first deposit (so the check on deposit index)On the other hand, I agree that we should check the kind of error we receive, and we should behave like that only for ErrNotFound and not others but:
applyDeposit
and how we do create validatorsNotFound
errors #2065) and I am willing to refresh that and resubmit for review as soon as this in inThere 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.
🧹 Nitpick (assertive)
Add function documentation
Please add a documentation comment explaining the purpose of this function, its parameters, and return values.
Add this documentation above the function:
📝 Committable suggestion
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.
order should always be maintained. From spec:
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.
These checks may be redundant, since these data come from our EVM state and I think they are guaranteed to be in-order. Keeping this for the time being, we will revisit all once merkle root checks are in