Skip to content

Conversation

@AnnaShaleva
Copy link
Member

@AnnaShaleva AnnaShaleva commented Sep 2, 2024

The necessity of this extension is described in bane-labs/go-ethereum#301 (comment). We need at least M correct PreCommits to decrypt Envelopes content, but decryption may be checked only by using the group of PreCommits. Thus, we can't say whether a single PreCommit can/can't decrypt Envelopes content.

@roman-khimov, please, review it carefully, I checked what I could and there seems to be no tricks possible to skip verification, but maybe you'll fined something. May be it'll be easier to review if you take a look at bane-labs/go-ethereum@f4e830c.

TPKE decryption shares verification is performed in ProcessPreBlock callback
when PreBlock is already constructed and all transactions are available.
If some of the received shares can't decrypt Envelopes' content then
dBFT should wait for more PreCommit payloads from other "honest" CNs.

Signed-off-by: Anna Shaleva <shaleva.ann@nspcc.ru>
It's a must-have condition for PreBlock construction.

Signed-off-by: Anna Shaleva <shaleva.ann@nspcc.ru>
PreCommits can't be verified against PreHeader because PreCommit carries
transactions-sensitive information.

Signed-off-by: Anna Shaleva <shaleva.ann@nspcc.ru>
PreBlock may be created earlier at the PreCommit verification level, and
it's OK. However, it's required at least M PreCommits to _process_
PreBlock.

Signed-off-by: Anna Shaleva <shaleva.ann@nspcc.ru>
@AnnaShaleva AnnaShaleva added this to the v0.3.1 milestone Sep 2, 2024
@codecov
Copy link

codecov bot commented Sep 2, 2024

Codecov Report

Attention: Patch coverage is 48.48485% with 17 lines in your changes missing coverage. Please review.

Project coverage is 59.25%. Comparing base (d574d48) to head (a6c5026).
Report is 6 commits behind head on master.

Files with missing lines Patch % Lines
dbft.go 42.10% 8 Missing and 3 partials ⚠️
check.go 58.33% 4 Missing and 1 partial ⚠️
context.go 0.00% 0 Missing and 1 partial ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##           master     #129      +/-   ##
==========================================
- Coverage   59.47%   59.25%   -0.22%     
==========================================
  Files          32       32              
  Lines        1821     1831      +10     
==========================================
+ Hits         1083     1085       +2     
- Misses        659      665       +6     
- Partials       79       81       +2     

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

AnnaShaleva added a commit to bane-labs/go-ethereum that referenced this pull request Sep 2, 2024
Port the nspcc-dev/dbft#129.

Signed-off-by: Anna Shaleva <shaleva.ann@nspcc.ru>
Move hasAllTransactions check from PreBlock constructor to onPreCommit
callback. The rest of CreatePreBlock usages already have this check.

Signed-off-by: Anna Shaleva <shaleva.ann@nspcc.ru>
AnnaShaleva added a commit to bane-labs/go-ethereum that referenced this pull request Sep 3, 2024
Port the nspcc-dev/dbft#129.

Signed-off-by: Anna Shaleva <shaleva.ann@nspcc.ru>
@AnnaShaleva AnnaShaleva marked this pull request as draft September 3, 2024 12:32
@AnnaShaleva
Copy link
Member Author

I found one more bug.

@AnnaShaleva AnnaShaleva marked this pull request as ready for review September 4, 2024 09:55
@AnnaShaleva
Copy link
Member Author

@roman-khimov, I placed encrypted data decoding to the wrong dBFT callback, so the library itself works correctly, the mistae was on the NeoX side. Ready to be merged.

@roman-khimov roman-khimov merged commit 212d176 into master Sep 4, 2024
@roman-khimov roman-khimov deleted the add-precommit-cb branch September 4, 2024 10:11
AnnaShaleva added a commit to bane-labs/go-ethereum that referenced this pull request Sep 4, 2024
Port the nspcc-dev/dbft#129.

Signed-off-by: Anna Shaleva <shaleva.ann@nspcc.ru>
AnnaShaleva added a commit to bane-labs/go-ethereum that referenced this pull request Sep 4, 2024
Port the nspcc-dev/dbft#129.

Signed-off-by: Anna Shaleva <shaleva.ann@nspcc.ru>
AnnaShaleva added a commit to bane-labs/go-ethereum that referenced this pull request Sep 10, 2024
Port the nspcc-dev/dbft#129.

Signed-off-by: Anna Shaleva <shaleva.ann@nspcc.ru>
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