Skip to content
This repository has been archived by the owner on Jan 31, 2025. It is now read-only.

fix: Use MaxTxBytes on the PrepareProposal request #269

Merged
merged 2 commits into from
Dec 6, 2023

Conversation

davidterpay
Copy link
Contributor

No description provided.

@davidterpay davidterpay marked this pull request as ready for review December 6, 2023 16:55
@davidterpay davidterpay added backport/v1.x.x Backport your PR to the v1.x.x release backport/v2.x.x Backport your PR to the v2.x.x release labels Dec 6, 2023
Copy link
Contributor

@nivasan1 nivasan1 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

lgtm

@@ -74,9 +74,13 @@ func (h *ProposalHandler) PrepareProposalHandler() sdk.PrepareProposalHandler {
return &abci.ResponsePrepareProposal{Txs: make([][]byte, 0)}, err
}

// Get the max gas limit and max block size for the proposal.
_, maxGasLimit := proposals.GetBlockLimits(ctx)
proposal := proposals.NewProposal(h.logger, req.MaxTxBytes, maxGasLimit)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Shld we take the min of the req.MaxTxBytes, and the ctx.ConsensusParams().MaxBytes? Or do we know that req.MaxTxBytes is always less?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

always less

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

comet deducts the val set size and evidence size before requesting

@davidterpay davidterpay merged commit 43d6b04 into main Dec 6, 2023
8 checks passed
@davidterpay davidterpay deleted the terpay/req-size-update branch December 6, 2023 17:25
mergify bot pushed a commit that referenced this pull request Dec 6, 2023
(cherry picked from commit 43d6b04)

# Conflicts:
#	abci/abci.go
#	abci/abci_test.go
mergify bot pushed a commit that referenced this pull request Dec 6, 2023
(cherry picked from commit 43d6b04)

# Conflicts:
#	abci/abci.go
davidterpay added a commit that referenced this pull request Dec 6, 2023
#270)

* req size check (#269)

(cherry picked from commit 43d6b04)

# Conflicts:
#	abci/abci.go
#	abci/abci_test.go

* merge conflict fix

---------

Co-authored-by: David Terpay <[email protected]>
Co-authored-by: David Terpay <[email protected]>
davidterpay added a commit that referenced this pull request Dec 6, 2023
#271)

* req size check (#269)

(cherry picked from commit 43d6b04)

# Conflicts:
#	abci/abci.go

* merge conflict

---------

Co-authored-by: David Terpay <[email protected]>
Co-authored-by: David Terpay <[email protected]>
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
backport/v1.x.x Backport your PR to the v1.x.x release backport/v2.x.x Backport your PR to the v2.x.x release
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants