-
Notifications
You must be signed in to change notification settings - Fork 267
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: setting data root in CreateProposalBlock #1271
Conversation
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 a unit test verify this in celestia-core or is it only easily test-able from celestia-app?
I think we could have a unit test on this. At least to catch future regressions |
@@ -145,10 +144,9 @@ func (blockExec *BlockExecutor) CreateProposalBlock( | |||
} | |||
|
|||
// update the block with the response from PrepareProposal | |||
block.Data, _ = types.DataFromProto(&cmtproto.Data{ | |||
Txs: rpp.Txs[:len(rpp.Txs)-1], | |||
Hash: rpp.Txs[len(rpp.Txs)-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.
The Hash
is left unset, is it intentional?
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.
Yes. We could probably remove it from the Data
struct if we wanted to
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.
So, wouldn't that be a breaking behaviour, namely it has been previously set and with the new change it is not?
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.
Yes that would be breaking, but it just breaks celestia-app, not downstream users
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.
Actually going to revert this because I don't think it makes sense to break app just yet
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.
LGTM. As a follow up, should we consider adding to the specs the ABCI change that moved the data root from a field in the prepare / process proposal response to the last transaction in the list of txs
? It looks like we don't currently have specs for our flavor of ABCI in https://celestiaorg.github.io/celestia-app/ so I'm not sure where this addition belongs.
Related: celestiaorg/celestia-app#1066
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.
[blocking question]
does this break the PartSetHeader's hash? if so, is this going to be backported / included on v0.34.x? or by main, did you mean celestia-core's main? If it is going to backported, and it does break the PartSetHeader's hash, what effect will that have on the upgrade? perhaps a better question is simply, when are we planning on celestia-app using celestia-core main?
I don't think so
Most likely for v3 |
|
What seems to be happening is the following: We have 4 validators, validator 0 is byzaninte, the remaining are divided into two partitions: Validator 1 in partition A and validator 2 and 3 in partition B.
In the tests on
It then sets it's block part header to B and eventually receives B and commits it. |
I could be wrong, but it appears to since it removes the square size, which we're still including atm |
I'm actually not sure that square size is populated in data (and in the block) Line 1104 in bf68e4f
|
@@ -96,7 +96,7 @@ func (BaseApplication) ApplySnapshotChunk(req RequestApplySnapshotChunk) Respons | |||
|
|||
func (BaseApplication) PrepareProposal(req RequestPrepareProposal) ResponsePrepareProposal { | |||
// we use placeholder values for the hash | |||
req.Txs = append(req.Txs, tmhash.Sum(nil)) | |||
req.Txs = append(req.Txs, merkle.HashFromByteSlices(req.Txs)) |
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.
This is what was causing the test to fail. We were using idential hashes so the blockID.Hash was the same but blockID.PartSetHeader was different
unfortunately for us, we are on v0.34.x-celestia 😭 this was actually the reason why the compact blocks implementation didn't work in testground but did work in the comet e2e tests here Lines 1097 to 1122 in d3ff8e7
we forgot to remove the square size, which makes upgrading to not using it more complicated than it needed to |
Ah you're right. I was looking at |
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.
LGTM. I still think a unit test to verify the fix / prevent regressions would help but can add afterwards
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.
do we need to update
celestia-core/version/version.go
Lines 20 to 21 in d76e844
BlockProtocol uint64 = 11 | |
) |
I don't think we have any block format changes since I reverted the protos to match v0.34.x-celestia |
Co-authored-by: Rootul P <rootulp@gmail.com>
Currently
main
fails when using celestia-app because the data root that is returned to it wasn't being correctly updated in the header.This PR fixes this