feat(crypto/bls12381): change to minimal-signature-size#3627
Conversation
|
|
||
| // 4 bytes for field tags + 1 byte for signature LEN + 1 byte for | ||
| // validator address LEN + 1 byte for timestamp LEN. | ||
| maxCommitSigProtoEncOverhead = 4 + 1 + 1 + 1 + 3 // 3 ??? |
There was a problem hiding this comment.
still don't know where 3 bytes are coming from
There was a problem hiding this comment.
message CommitSig {
BlockIDFlag block_id_flag = 1;
bytes validator_address = 2;
google.protobuf.Timestamp timestamp = 3
[(gogoproto.nullable) = false, (gogoproto.stdtime) = true];
bytes signature = 4;
}
There was a problem hiding this comment.
Protobuf overhead?
We really need a way to compute that properly.
There was a problem hiding this comment.
Protobuf overhead?
Yes, but it's unclear from where. varints of 3 fields shouldn't take more than 1 byte because they are all very small.
cason
left a comment
There was a problem hiding this comment.
Legit.
But we need a better solution for defining the maximum payload size for a block, depending on the signing algorithm adopted.
| // XXX: secp256k1 does not have Size nor MaxSize defined. | ||
| var MaxSignatureSize = cmtmath.MaxInt(ed25519.SignatureSize, cmtmath.MaxInt(bls12381.SignatureLength, 64)) | ||
| // XXX: secp256k1 does not have max signature size defined. | ||
| var MaxSignatureSize = cmtmath.MaxInt( |
There was a problem hiding this comment.
The problem of this approach is that blocks produced using different signing algorithms will have different maximum payload size. We need to re-think this way of computing the maximum payload size, as it depends on the signing algorithm we are using...
Closes #3624 --- #### PR checklist - [x] Tests written/updated - [x] Changelog entry added in `.changelog` (we use [unclog](https://github.com/informalsystems/unclog) to manage our changelog) - [ ] Updated relevant documentation (`docs/` or `spec/`) and code comments - [x] Title follows the [Conventional Commits](https://www.conventionalcommits.org/en/v1.0.0/) spec (cherry picked from commit 7a5eb45)
…) (#3631) Closes #3624 --- #### PR checklist - [x] Tests written/updated - [x] Changelog entry added in `.changelog` (we use [unclog](https://github.com/informalsystems/unclog) to manage our changelog) - [ ] Updated relevant documentation (`docs/` or `spec/`) and code comments - [x] Title follows the [Conventional Commits](https://www.conventionalcommits.org/en/v1.0.0/) spec <hr>This is an automatic backport of pull request #3627 done by [Mergify](https://mergify.com). Co-authored-by: Anton Kaliaev <anton.kalyaev@gmail.com>
…tbft#3627)" This reverts commit 7a5eb45.
because it's not Ethereum compatible and breaks Berachain Reverts #3627 <!-- Please add a reference to the issue that this PR addresses and indicate which files are most critical to review. If it fully addresses a particular issue, please include "Closes #XXX" (where "XXX" is the issue number). If this PR is non-trivial/large/complex, please ensure that you have either created an issue that the team's had a chance to respond to, or had some discussion with the team prior to submitting substantial pull requests. The team can be reached via GitHub Discussions or the Cosmos Network Discord server in the #cometbft channel. GitHub Discussions is preferred over Discord as it allows us to keep track of conversations topically. https://github.com/cometbft/cometbft/discussions If the work in this PR is not aligned with the team's current priorities, please be advised that it may take some time before it is merged - especially if it has not yet been discussed with the team. See the project board for the team's current priorities: https://github.com/orgs/cometbft/projects/1 --> --- #### PR checklist - [x] Tests written/updated - [x] Changelog entry added in `.changelog` (we use [unclog](https://github.com/informalsystems/unclog) to manage our changelog) - [x] Updated relevant documentation (`docs/` or `spec/`) and code comments
because it's not Ethereum compatible and breaks Berachain Reverts #3627 <!-- Please add a reference to the issue that this PR addresses and indicate which files are most critical to review. If it fully addresses a particular issue, please include "Closes #XXX" (where "XXX" is the issue number). If this PR is non-trivial/large/complex, please ensure that you have either created an issue that the team's had a chance to respond to, or had some discussion with the team prior to submitting substantial pull requests. The team can be reached via GitHub Discussions or the Cosmos Network Discord server in the #cometbft channel. GitHub Discussions is preferred over Discord as it allows us to keep track of conversations topically. https://github.com/cometbft/cometbft/discussions If the work in this PR is not aligned with the team's current priorities, please be advised that it may take some time before it is merged - especially if it has not yet been discussed with the team. See the project board for the team's current priorities: https://github.com/orgs/cometbft/projects/1 --> --- #### PR checklist - [x] Tests written/updated - [x] Changelog entry added in `.changelog` (we use [unclog](https://github.com/informalsystems/unclog) to manage our changelog) - [x] Updated relevant documentation (`docs/` or `spec/`) and code comments (cherry picked from commit e67223f)
because it's not Ethereum compatible and breaks Berachain Reverts #3627 --- #### PR checklist - [x] Tests written/updated - [x] Changelog entry added in `.changelog` (we use [unclog](https://github.com/informalsystems/unclog) to manage our changelog) - [x] Updated relevant documentation (`docs/` or `spec/`) and code comments <hr>This is an automatic backport of pull request #3860 done by [Mergify](https://mergify.com). Co-authored-by: Anton Kaliaev <anton.kalyaev@gmail.com>
Closes #3624 --- - [x] Tests written/updated - [x] Changelog entry added in `.changelog` (we use [unclog](https://github.com/informalsystems/unclog) to manage our changelog) - [ ] Updated relevant documentation (`docs/` or `spec/`) and code comments - [x] Title follows the [Conventional Commits](https://www.conventionalcommits.org/en/v1.0.0/) spec
because it's not Ethereum compatible and breaks Berachain Reverts #3627 <!-- Please add a reference to the issue that this PR addresses and indicate which files are most critical to review. If it fully addresses a particular issue, please include "Closes #XXX" (where "XXX" is the issue number). If this PR is non-trivial/large/complex, please ensure that you have either created an issue that the team's had a chance to respond to, or had some discussion with the team prior to submitting substantial pull requests. The team can be reached via GitHub Discussions or the Cosmos Network Discord server in the #cometbft channel. GitHub Discussions is preferred over Discord as it allows us to keep track of conversations topically. https://github.com/cometbft/cometbft/discussions If the work in this PR is not aligned with the team's current priorities, please be advised that it may take some time before it is merged - especially if it has not yet been discussed with the team. See the project board for the team's current priorities: https://github.com/orgs/cometbft/projects/1 --> --- - [x] Tests written/updated - [x] Changelog entry added in `.changelog` (we use [unclog](https://github.com/informalsystems/unclog) to manage our changelog) - [x] Updated relevant documentation (`docs/` or `spec/`) and code comments
Closes #3624
PR checklist
.changelog(we use unclog to manage our changelog)docs/orspec/) and code comments