-
Notifications
You must be signed in to change notification settings - Fork 636
Block Proposal Failure(proposal block parts exceeds maximum block bytes) #1675
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
Comments
Hi @LX-Xiang, thanks for reporting this. I believe the message in the log is just letting you know that the Also, the |
I discovered that in the cosmos-sdk DefaultProposalHandler, the size is determined by the MaxTxBytes field of RequestPrepareProposal. I suspect that when CometBFT calls cosmos-sdk, it may be providing an incorrect MaxTxBytes If it's an issue with the cosmos-sdk, it should be detected at this position: https://github.com/cometbft/cometbft/blob/v0.37.2/state/execution.go#L139. I suspect that there might be an issue with this function: https://github.com/cometbft/cometbft/blob/main/types/block.go#L278 |
I added logs using the below method, and indeed, the txs size increased during the call to blockExec.proxyApp.PrepareProposalSync. However, it still remains smaller than the specified maxDataBytes input. I believe there is an overestimation in the calculation of types.MaxDataBytes Add logfunc (blockExec *BlockExecutor) CreateProposalBlock(
height int64,
state State,
commit *types.Commit,
proposerAddr []byte,
) (*types.Block, error) {
maxBytes := state.ConsensusParams.Block.MaxBytes
maxGas := state.ConsensusParams.Block.MaxGas
evidence, evSize := blockExec.evpool.PendingEvidence(state.ConsensusParams.Evidence.MaxBytes)
// Fetch a limited amount of valid txs
maxDataBytes := types.MaxDataBytes(maxBytes, evSize, state.Validators.Size())
txs Log
|
I discovered that the inconsistency in byte calculations for tx between Cosmos SDK and CometBFT is causing the issue. I have submitted a pull request to Cosmos SDK. |
@andynog my issue has been solved |
Pls don't close yet. We should consider his PR on CometBFT for merge. |
Before this fix, if the app returns a slightly oversized set of transactions, an invalid block would be created and proposed, only being caught by the receiver with the following message.
After the fix, even slightly oversized set of transactions will be caught by the proposer and result in cc: @alexanderbez |
Uh oh!
There was an error while loading. Please reload this page.
Environment Information
Err log
ERR failed to process message err="total size of proposal block parts exceeds maximum block bytes (2097374 > 2097152)" height=2771 module=consensus msg_type=*consensus.BlockPartMessage peer=b9018b4260f19b5e0e8b0429c603d4156e6c2702 round=259
ERR failed to process message err="total size of proposal block parts exceeds maximum block bytes (2097354 > 2097152)" height=2771 module=consensus msg_type=*consensus.BlockPartMessage peer=1af9376873ae9bfa5cbb33a954f344afe96d55c6 round=260
https://github.com/cometbft/cometbft/blob/v0.37.2/consensus/state.go#L1931
Consensus Params
for all validators are configured as follows
{"jsonrpc":"2.0","id":-1,"result":{"block_height":"2770","consensus_params":{"block":{"max_bytes":"2097152","max_gas":"-1"},"evidence":{"max_age_num_blocks":"100000","max_age_duration":"172800000000000","max_bytes":"1048576"},"validator":{"pub_key_types":["ed25519"]},"version":{"app":"0"}}}}
{"jsonrpc":"2.0","id":-1,"result":{"block_height":"2771","consensus_params":{"block":{"max_bytes":"2097152","max_gas":"-1"},"evidence":{"max_age_num_blocks":"100000","max_age_duration":"172800000000000","max_bytes":"1048576"},"validator":{"pub_key_types":["ed25519"]},"version":{"app":"0"}}}}
The text was updated successfully, but these errors were encountered: