-
Notifications
You must be signed in to change notification settings - Fork 0
dbft: Implement block verification callback #87
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
Conversation
This error |
To be able to properly verify unsigned block after PrepareRequest receival in WithVerifyBlock dBFT callback we need to ensure that (*DBFT).Author can handle such unsugned block. Starting from the previous commit, we define block's Coinbase as the Primary address for the dBFT round when the block was accepted. And thus, return proper block author for proper verification. The problem itself is described in #87 (comment). Also ref. #51. Signed-off-by: Anna Shaleva <shaleva.ann@nspcc.ru>
To be able to properly verify unsigned block after PrepareRequest receival in WithVerifyBlock dBFT callback we need to ensure that (*DBFT).Author can handle such unsugned block. Starting from the previous commit, we define block's Coinbase as the Primary address for the dBFT round when the block was accepted. And thus, return proper block author for proper verification. The problem itself is described in #87 (comment). Also ref. #51. Signed-off-by: Anna Shaleva <shaleva.ann@nspcc.ru>
To be able to properly verify unsigned block after PrepareRequest receival in WithVerifyBlock dBFT callback we need to ensure that (*DBFT).Author can handle such unsugned block. Starting from the previous commit, we define block's Coinbase as the Primary address for the dBFT round when the block was accepted. And thus, return proper block author for proper verification. The problem itself is described in #87 (comment). Also ref. #51. Signed-off-by: Anna Shaleva <shaleva.ann@nspcc.ru>
To be able to properly verify unsigned block after PrepareRequest receival in WithVerifyBlock dBFT callback we need to ensure that (*DBFT).Author can handle such unsugned block. Starting from the previous commit, we define block's Coinbase as the Primary address for the dBFT round when the block was accepted. And thus, return proper block author for proper verification. The problem itself is described in #87 (comment). Also ref. #51. Signed-off-by: Anna Shaleva <shaleva.ann@nspcc.ru>
To be able to properly verify unsigned block after PrepareRequest receival in WithVerifyBlock dBFT callback we need to ensure that (*DBFT).Author can handle such unsugned block. Starting from the previous commit, we define block's Coinbase as the Primary address for the dBFT round when the block was accepted. And thus, return proper block author for proper verification. The problem itself is described in #87 (comment). Also ref. #51. Signed-off-by: Anna Shaleva <shaleva.ann@nspcc.ru>
a830015 to
55b64ee
Compare
|
CN3 failed after running for several days, may be an issue from some other place but found by this PR. 4cn-CN1
4cn-CN2
4cn-CN3
4cn-CN4
|
Good, thanks, it's definitely from this PR since there's no verification callback set in the previous versions. I'll get back to review & test this PR in a few days. |
AnnaShaleva
left a comment
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.
Could you, please, reformat the commit message and add Close #65. message to the commit and PR description.
AnnaShaleva
left a comment
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.
One important thing I worry about is transactions verification. We need not only verify storage state after in-block transactions execution, but also verify that all transactions included in block are valid, i.e. have valid fees set and etc. This should be provided by mempool, but we need to ensure that no "bad" transaction can be accepted.
For example, take a look at the way how in-block transactions are being checked in NeoGo during block verification: https://github.com/nspcc-dev/neo-go/blob/51ac153a7b009f8f69117ed987038a08dc78f261/pkg/consensus/consensus.go#L509
The difference is that NeoGo's transactions come to the consensus bypassing mempool. And Eth transactions come to consensus from mempool. However, we need to ensure that there are no conflicting transactions in the block.
@nicolegys, could you please provide the git revision (commit sha) you've used to run nodes when this error occurred? |
Consider nonce conflict, btw. Proposal (PrepareRequest) can have a different transaction for the same sender/nonce combination and it'd be valid, while you may never get this transaction from the mempool because we have some there already with a bigger fee. |
We need to refactor this and send requested transactions right to the consensus bypassing mempool. This task may be done in #98, since this change should be applicable only to requested transactions. |
8f5f116 to
2a15c97
Compare
We have the transaction nonce and gas verify in |
2a15c97 to
64143ec
Compare
|
@chenquanyu, could you please rebase onto the current bane-main?
Will check this, but the overall idea is that during |
64143ec to
1735868
Compare
AnnaShaleva
left a comment
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.
One major issue left with block's parent. Otherwose LGTM. I'll create a separate issue for in-block transactions reverification.
|
@chenquanyu, take a look at #127, you may add some comments if needed. |
1735868 to
5ff6068
Compare
Oh, now I see this. It's |
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.
@chenquanyu, please, fix the last comment, squash commits and we'll merge this PR. I'll create a separate issue to track the problem with missing parent and we'll track if it's reproduced on the real network with the updated state retrieval code.
Also, please, create PR with the same block verification to https://github.com/bane-labs/go-ethereum/tree/t2.
|
@chenquanyu, could you, please, update this PR according to the comments above? |
Ref. #142 |
c587e7f to
858a6f6
Compare
858a6f6 to
f711fc8
Compare





Close #65 Implement block verification callback.