Skip to content

Commit

Permalink
fix app hash mismatch
Browse files Browse the repository at this point in the history
  • Loading branch information
cmwaters committed Aug 7, 2024
1 parent 9891402 commit 2571c23
Show file tree
Hide file tree
Showing 4 changed files with 9 additions and 6 deletions.
3 changes: 1 addition & 2 deletions app/test/square_size_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,6 @@ import (
"github.com/celestiaorg/celestia-app/v3/test/util/testfactory"
"github.com/celestiaorg/celestia-app/v3/test/util/testnode"
blobtypes "github.com/celestiaorg/celestia-app/v3/x/blob/types"
"github.com/celestiaorg/go-square/v2/share"
sdk "github.com/cosmos/cosmos-sdk/types"
v1 "github.com/cosmos/cosmos-sdk/x/gov/types/v1"
oldgov "github.com/cosmos/cosmos-sdk/x/gov/types/v1beta1"
Expand Down Expand Up @@ -87,7 +86,7 @@ func (s *SquareSizeIntegrationTest) TestSquareSizeUpperBound() {
{
name: "gov square size == hardcoded max",
govMaxSquareSize: appconsts.DefaultSquareSizeUpperBound,
maxBytes: appconsts.DefaultSquareSizeUpperBound * appconsts.DefaultSquareSizeUpperBound * share.ContinuationSparseShareContentSize,
maxBytes: appconsts.DefaultUpperBoundMaxBytes,
expectedMaxSquareSize: appconsts.DefaultSquareSizeUpperBound,
},
}
Expand Down
4 changes: 4 additions & 0 deletions pkg/appconsts/initial_consts.go
Original file line number Diff line number Diff line change
Expand Up @@ -31,3 +31,7 @@ const (
// time can be subject to slashing under conditions of misbehavior.
DefaultUnbondingTime = 3 * 7 * 24 * time.Hour
)

var (
DefaultUpperBoundMaxBytes = DefaultSquareSizeUpperBound * DefaultSquareSizeUpperBound * share.ContinuationSparseShareContentSize
)
4 changes: 2 additions & 2 deletions test/util/test_app.go
Original file line number Diff line number Diff line change
Expand Up @@ -139,7 +139,7 @@ func SetupDeterministicGenesisState(testApp *app.App, pubKeys []cryptotypes.PubK
Block: &abci.BlockParams{
// Choose some value large enough to not bottleneck the max square
// size
MaxBytes: appconsts.DefaultMaxBytes,
MaxBytes: int64(appconsts.DefaultUpperBoundMaxBytes),
MaxGas: cparams.Block.MaxGas,
},
Evidence: &cparams.Evidence,
Expand Down Expand Up @@ -188,7 +188,7 @@ func NewTestAppWithGenesisSet(cparams *tmproto.ConsensusParams, genAccounts ...s
Block: &abci.BlockParams{
// choose some value large enough to not bottleneck the max square
// size
MaxBytes: appconsts.DefaultMaxBytes,
MaxBytes: int64(appconsts.DefaultUpperBoundMaxBytes),
MaxGas: cparams.Block.MaxGas,
},
Evidence: &cparams.Evidence,
Expand Down
4 changes: 2 additions & 2 deletions test/util/testnode/config.go
Original file line number Diff line number Diff line change
Expand Up @@ -139,7 +139,7 @@ func DefaultConfig() *Config {
func DefaultConsensusParams() *tmproto.ConsensusParams {
cparams := types.DefaultConsensusParams()
cparams.Block.TimeIotaMs = 1
cparams.Block.MaxBytes = appconsts.DefaultMaxBytes
cparams.Block.MaxBytes = int64(appconsts.DefaultUpperBoundMaxBytes)
cparams.Version.AppVersion = appconsts.LatestVersion
return cparams
}
Expand All @@ -153,7 +153,7 @@ func DefaultTendermintConfig() *tmconfig.Config {
// Override the mempool's MaxTxBytes to allow the testnode to accept a
// transaction that fills the entire square. Any blob transaction larger
// than the square size will still fail no matter what.
maxTxBytes := appconsts.DefaultMaxBytes
maxTxBytes := appconsts.DefaultUpperBoundMaxBytes
tmCfg.Mempool.MaxTxBytes = maxTxBytes

// Override the MaxBodyBytes to allow the testnode to accept very large
Expand Down

0 comments on commit 2571c23

Please sign in to comment.