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

*: take care of anti-MEV part #134

Merged
merged 4 commits into from
Nov 28, 2024
Merged

*: take care of anti-MEV part #134

merged 4 commits into from
Nov 28, 2024

Conversation

AnnaShaleva
Copy link
Member

@AnnaShaleva AnnaShaleva commented Nov 11, 2024

  1. For anti-MEV extension it's possible that some commits carry invalid share which is impossible to check at the commit verification level. In this case node should collect some more commits. Hence, ProcessBlock callback signature is extended with error return value. The general idea is similar to PreBlock processing behaviour.
  2. Remove PreCommit with invalid signature from cache.
  3. Log Commit signature verification error.
  4. Add VerifyCommit callback.

Copy link

codecov bot commented Nov 11, 2024

Codecov Report

Attention: Patch coverage is 32.14286% with 19 lines in your changes missing coverage. Please review.

Project coverage is 58.24%. Comparing base (94bc382) to head (be64b5f).
Report is 5 commits behind head on master.

Files with missing lines Patch % Lines
check.go 27.27% 7 Missing and 1 partial ⚠️
dbft.go 12.50% 6 Missing and 1 partial ⚠️
config.go 71.42% 2 Missing ⚠️
internal/simulation/main.go 0.00% 2 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##           master     #134      +/-   ##
==========================================
- Coverage   58.61%   58.24%   -0.37%     
==========================================
  Files          32       32              
  Lines        2235     2256      +21     
==========================================
+ Hits         1310     1314       +4     
- Misses        843      858      +15     
- Partials       82       84       +2     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@AnnaShaleva AnnaShaleva marked this pull request as ready for review November 27, 2024 16:09
@AnnaShaleva
Copy link
Member Author

@roman-khimov, review please, but simulation/CHANGELOG check are failing; will check what's happened with simulation.

check.go Outdated Show resolved Hide resolved
For anti-MEV extension it's possible that some commits carry invalid
share which is impossible to check at the commit verification level.
Signature shares verification happens inside ProcessBlock callback.
If some of Commits contain invalid shares, the node should collect
more commits. Hence, ProcessBlock callback is allowed to return an
error.

Signed-off-by: Anna Shaleva <shaleva.ann@nspcc.ru>
Signed-off-by: Anna Shaleva <shaleva.ann@nspcc.ru>
For better user experience.

Signed-off-by: Anna Shaleva <shaleva.ann@nspcc.ru>
It's required by anti-MEV extension to perform state-independent
TPKE signature verification.

Signed-off-by: Anna Shaleva <shaleva.ann@nspcc.ru>
@AnnaShaleva AnnaShaleva changed the title check: extend ProcessBlock callback with error handler *: take care of anti-MEV part Nov 28, 2024
@AnnaShaleva AnnaShaleva added this to the v0.3.1 milestone Nov 28, 2024
@AnnaShaleva AnnaShaleva added bug Something isn't working enhancement Improving existing functionality labels Nov 28, 2024
@AnnaShaleva
Copy link
Member Author

Simulation is fixed by #135; CHANGELOG is updated.

@roman-khimov roman-khimov merged commit ba74133 into master Nov 28, 2024
10 of 12 checks passed
@roman-khimov roman-khimov deleted the extend-processblock branch November 28, 2024 14:14
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working enhancement Improving existing functionality
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants