Skip to content
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

feat: clamp to consensus max gas #51

Closed
wants to merge 16 commits into from
Closed
Show file tree
Hide file tree
Changes from 9 commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 4 additions & 4 deletions go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -24,8 +24,8 @@ require (
github.com/stretchr/testify v1.8.4
golang.org/x/tools v0.16.0
google.golang.org/genproto/googleapis/api v0.0.0-20231106174013-bbf56f31fb17
google.golang.org/grpc v1.59.0
google.golang.org/protobuf v1.31.0
google.golang.org/grpc v1.60.1
google.golang.org/protobuf v1.32.0
mvdan.cc/gofumpt v0.5.0
pgregory.net/rapid v1.1.0
)
Expand Down Expand Up @@ -299,14 +299,14 @@ require (
golang.org/x/exp/typeparams v0.0.0-20230307190834-24139beb5833 // indirect
golang.org/x/mod v0.14.0 // indirect
golang.org/x/net v0.19.0 // indirect
golang.org/x/oauth2 v0.12.0 // indirect
golang.org/x/oauth2 v0.13.0 // indirect
golang.org/x/sync v0.5.0 // indirect
golang.org/x/sys v0.15.0 // indirect
golang.org/x/term v0.15.0 // indirect
golang.org/x/text v0.14.0 // indirect
golang.org/x/xerrors v0.0.0-20220907171357-04be3eba64a2 // indirect
google.golang.org/api v0.143.0 // indirect
google.golang.org/appengine v1.6.7 // indirect
google.golang.org/appengine v1.6.8 // indirect
google.golang.org/genproto v0.0.0-20231030173426-d783a09b4405 // indirect
google.golang.org/genproto/googleapis/rpc v0.0.0-20231030173426-d783a09b4405 // indirect
gopkg.in/ini.v1 v1.67.0 // indirect
Expand Down
15 changes: 8 additions & 7 deletions go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -1716,8 +1716,8 @@ golang.org/x/oauth2 v0.0.0-20221006150949-b44042a4b9c1/go.mod h1:h4gKUeWbJ4rQPri
golang.org/x/oauth2 v0.0.0-20221014153046-6fdb5e3db783/go.mod h1:h4gKUeWbJ4rQPri7E0u6Gs4e9Ri2zaLxzw5DI5XGrYg=
golang.org/x/oauth2 v0.1.0/go.mod h1:G9FE4dLTsbXUu90h/Pf85g4w1D+SSAgR+q46nJZ8M4A=
golang.org/x/oauth2 v0.4.0/go.mod h1:RznEsdpjGAINPTOF0UH/t+xJ75L18YO3Ho6Pyn+uRec=
golang.org/x/oauth2 v0.12.0 h1:smVPGxink+n1ZI5pkQa8y6fZT0RW0MgCO5bFpepy4B4=
golang.org/x/oauth2 v0.12.0/go.mod h1:A74bZ3aGXgCY0qaIC9Ahg6Lglin4AMAco8cIv9baba4=
golang.org/x/oauth2 v0.13.0 h1:jDDenyj+WgFtmV3zYVoi8aE2BwtXFLWOA67ZfNWftiY=
golang.org/x/oauth2 v0.13.0/go.mod h1:/JMhi4ZRXAf4HG9LiNmxvk+45+96RUlVThiH8FzNBn0=
golang.org/x/sync v0.0.0-20180314180146-1d60e4601c6f/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM=
golang.org/x/sync v0.0.0-20181108010431-42b317875d0f/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM=
golang.org/x/sync v0.0.0-20181221193216-37e7f081c4d4/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM=
Expand Down Expand Up @@ -2026,8 +2026,9 @@ google.golang.org/appengine v1.5.0/go.mod h1:xpcJRLb0r/rnEns0DIKYYv+WjYCduHsrkT7
google.golang.org/appengine v1.6.1/go.mod h1:i06prIuMbXzDqacNJfV5OdTW448YApPu5ww/cMBSeb0=
google.golang.org/appengine v1.6.5/go.mod h1:8WjMMxjGQR8xUklV/ARdw2HLXBOI7O7uCIDZVag1xfc=
google.golang.org/appengine v1.6.6/go.mod h1:8WjMMxjGQR8xUklV/ARdw2HLXBOI7O7uCIDZVag1xfc=
google.golang.org/appengine v1.6.7 h1:FZR1q0exgwxzPzp/aF+VccGrSfxfPpkBqjIIEq3ru6c=
google.golang.org/appengine v1.6.7/go.mod h1:8WjMMxjGQR8xUklV/ARdw2HLXBOI7O7uCIDZVag1xfc=
google.golang.org/appengine v1.6.8 h1:IhEN5q69dyKagZPYMSdIjS2HqprW324FRQZJcGqPAsM=
google.golang.org/appengine v1.6.8/go.mod h1:1jJ3jBArFh5pcgW8gCtRJnepW8FzD1V44FJffLiz/Ds=
google.golang.org/genproto v0.0.0-20180817151627-c66870c02cf8/go.mod h1:JiN7NxoALGmiZfu7CAH4rXhgtRTLTxftemlI0sWmxmc=
google.golang.org/genproto v0.0.0-20180831171423-11092d34479b/go.mod h1:JiN7NxoALGmiZfu7CAH4rXhgtRTLTxftemlI0sWmxmc=
google.golang.org/genproto v0.0.0-20190307195333-5fe7a883aa19/go.mod h1:VzzqZJRnGkLBvHegQrXjBqPurQTc5/KpmUdxsrq26oE=
Expand Down Expand Up @@ -2195,8 +2196,8 @@ google.golang.org/grpc v1.50.0/go.mod h1:ZgQEeidpAuNRZ8iRrlBKXZQP1ghovWIVhdJRyCD
google.golang.org/grpc v1.50.1/go.mod h1:ZgQEeidpAuNRZ8iRrlBKXZQP1ghovWIVhdJRyCDK+GI=
google.golang.org/grpc v1.51.0/go.mod h1:wgNDFcnuBGmxLKI/qn4T+m5BtEBYXJPvibbUPsAIPww=
google.golang.org/grpc v1.54.0/go.mod h1:PUSEXI6iWghWaB6lXM4knEgpJNu2qUcKfDtNci3EC2g=
google.golang.org/grpc v1.59.0 h1:Z5Iec2pjwb+LEOqzpB2MR12/eKFhDPhuqW91O+4bwUk=
google.golang.org/grpc v1.59.0/go.mod h1:aUPDwccQo6OTjy7Hct4AfBPD1GptF4fyUjIkQ9YtF98=
google.golang.org/grpc v1.60.1 h1:26+wFr+cNqSGFcOXcabYC0lUVJVRa2Sb2ortSK7VrEU=
google.golang.org/grpc v1.60.1/go.mod h1:OlCHIeLYqSSsLi6i49B5QGdzaMZK9+M7LXN2FKz4eGM=
google.golang.org/grpc/cmd/protoc-gen-go-grpc v1.1.0/go.mod h1:6Kw0yEErY5E/yWrBtf03jp27GLLJujG4z/JK95pnjjw=
google.golang.org/protobuf v0.0.0-20200109180630-ec00e32a8dfd/go.mod h1:DFci5gLYBciE7Vtevhsrf46CRTquxDuWsQurQQe4oz8=
google.golang.org/protobuf v0.0.0-20200221191635-4d8936d0db64/go.mod h1:kwYJMbMJ01Woi6D6+Kah6886xMZcty6N08ah7+eCXa0=
Expand All @@ -2214,8 +2215,8 @@ google.golang.org/protobuf v1.27.1/go.mod h1:9q0QmTI4eRPtz6boOQmLYwt+qCgq0jsYwAQ
google.golang.org/protobuf v1.28.0/go.mod h1:HV8QOd/L58Z+nl8r43ehVNZIU/HEI6OcFqwMG9pJV4I=
google.golang.org/protobuf v1.28.1/go.mod h1:HV8QOd/L58Z+nl8r43ehVNZIU/HEI6OcFqwMG9pJV4I=
google.golang.org/protobuf v1.30.0/go.mod h1:HV8QOd/L58Z+nl8r43ehVNZIU/HEI6OcFqwMG9pJV4I=
google.golang.org/protobuf v1.31.0 h1:g0LDEJHgrBl9N9r17Ru3sqWhkIx2NB67okBHPwC7hs8=
google.golang.org/protobuf v1.31.0/go.mod h1:HV8QOd/L58Z+nl8r43ehVNZIU/HEI6OcFqwMG9pJV4I=
google.golang.org/protobuf v1.32.0 h1:pPC6BG5ex8PDFnkbrGU3EixyhKcQ2aDuBS36lqK/C7I=
google.golang.org/protobuf v1.32.0/go.mod h1:c6P6GXX6sHbq/GpV6MGZEdwhWPcYBgnhAHhKbcUYpos=
gopkg.in/alecthomas/kingpin.v2 v2.2.6/go.mod h1:FMv+mEhP44yOT+4EoQTLFTRgOQ1FBLkstjWtayDeSgw=
gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0=
gopkg.in/check.v1 v1.0.0-20180628173108-788fd7840127/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0=
Expand Down
4 changes: 2 additions & 2 deletions proto/feemarket/feemarket/v1/params.proto
Original file line number Diff line number Diff line change
Expand Up @@ -66,10 +66,10 @@ message Params {
(gogoproto.nullable) = false
];

// TargetBlockUtilization is the target block utilization.
// TargetBlockUtilization is the target block utilization (in units of gas).
uint64 target_block_utilization = 8;

// MaxBlockUtilization is the maximum block utilization.
// MaxBlockUtilization is the maximum block utilization (in units of gas).
uint64 max_block_utilization = 9;

// Window defines the window size for calculating an adaptive learning rate
Expand Down
7 changes: 0 additions & 7 deletions tests/app/app.go
Original file line number Diff line number Diff line change
Expand Up @@ -34,8 +34,6 @@ import (
bankkeeper "github.com/cosmos/cosmos-sdk/x/bank/keeper"
"github.com/cosmos/cosmos-sdk/x/consensus"
consensuskeeper "github.com/cosmos/cosmos-sdk/x/consensus/keeper"
"github.com/cosmos/cosmos-sdk/x/crisis"
crisiskeeper "github.com/cosmos/cosmos-sdk/x/crisis/keeper"
distr "github.com/cosmos/cosmos-sdk/x/distribution"
distrkeeper "github.com/cosmos/cosmos-sdk/x/distribution/keeper"
"github.com/cosmos/cosmos-sdk/x/evidence"
Expand Down Expand Up @@ -96,7 +94,6 @@ var (
},
),
params.AppModuleBasic{},
crisis.AppModuleBasic{},
slashing.AppModuleBasic{},
feegrantmodule.AppModuleBasic{},
upgrade.AppModuleBasic{},
Expand Down Expand Up @@ -132,7 +129,6 @@ type TestApp struct {
MintKeeper mintkeeper.Keeper
DistrKeeper distrkeeper.Keeper
GovKeeper *govkeeper.Keeper
CrisisKeeper *crisiskeeper.Keeper
aljo242 marked this conversation as resolved.
Show resolved Hide resolved
UpgradeKeeper *upgradekeeper.Keeper
ParamsKeeper paramskeeper.Keeper
AuthzKeeper authzkeeper.Keeper
Expand Down Expand Up @@ -210,7 +206,6 @@ func New(
&app.MintKeeper,
&app.DistrKeeper,
&app.GovKeeper,
&app.CrisisKeeper,
&app.UpgradeKeeper,
&app.ParamsKeeper,
&app.AuthzKeeper,
Expand Down Expand Up @@ -292,8 +287,6 @@ func New(

/**** Module Options ****/

app.ModuleManager.RegisterInvariants(app.CrisisKeeper)

// RegisterUpgradeHandlers is used for registering any on-chain upgrades.
// app.RegisterUpgradeHandlers()

Expand Down
10 changes: 1 addition & 9 deletions tests/app/config.go
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,6 @@ import (
authzmodulev1 "cosmossdk.io/api/cosmos/authz/module/v1"
bankmodulev1 "cosmossdk.io/api/cosmos/bank/module/v1"
consensusmodulev1 "cosmossdk.io/api/cosmos/consensus/module/v1"
crisismodulev1 "cosmossdk.io/api/cosmos/crisis/module/v1"
distrmodulev1 "cosmossdk.io/api/cosmos/distribution/module/v1"
evidencemodulev1 "cosmossdk.io/api/cosmos/evidence/module/v1"
feegrantmodulev1 "cosmossdk.io/api/cosmos/feegrant/module/v1"
Expand All @@ -30,7 +29,6 @@ import (
banktypes "github.com/cosmos/cosmos-sdk/x/bank/types"
capabilitytypes "github.com/cosmos/cosmos-sdk/x/capability/types"
consensustypes "github.com/cosmos/cosmos-sdk/x/consensus/types"
crisistypes "github.com/cosmos/cosmos-sdk/x/crisis/types"
distrtypes "github.com/cosmos/cosmos-sdk/x/distribution/types"
evidencetypes "github.com/cosmos/cosmos-sdk/x/evidence/types"
"github.com/cosmos/cosmos-sdk/x/feegrant"
Expand Down Expand Up @@ -59,7 +57,7 @@ var (
genesisModuleOrder = []string{
capabilitytypes.ModuleName, authtypes.ModuleName, banktypes.ModuleName, feemarkettypes.ModuleName,
distrtypes.ModuleName, stakingtypes.ModuleName, slashingtypes.ModuleName, govtypes.ModuleName,
minttypes.ModuleName, crisistypes.ModuleName, genutiltypes.ModuleName, evidencetypes.ModuleName, authz.ModuleName,
minttypes.ModuleName, genutiltypes.ModuleName, evidencetypes.ModuleName, authz.ModuleName,
feegrant.ModuleName, group.ModuleName, paramstypes.ModuleName, upgradetypes.ModuleName,
vestingtypes.ModuleName, consensustypes.ModuleName,
}
Expand Down Expand Up @@ -112,7 +110,6 @@ var (
authtypes.ModuleName,
banktypes.ModuleName,
govtypes.ModuleName,
crisistypes.ModuleName,
genutiltypes.ModuleName,
authz.ModuleName,
feegrant.ModuleName,
Expand All @@ -122,7 +119,6 @@ var (
consensustypes.ModuleName,
},
EndBlockers: []string{
crisistypes.ModuleName,
govtypes.ModuleName,
feemarkettypes.ModuleName,
stakingtypes.ModuleName,
Expand Down Expand Up @@ -231,10 +227,6 @@ var (
Name: govtypes.ModuleName,
Config: appconfig.WrapAny(&govmodulev1.Module{}),
},
{
Name: crisistypes.ModuleName,
Config: appconfig.WrapAny(&crisismodulev1.Module{}),
},
{
Name: consensustypes.ModuleName,
Config: appconfig.WrapAny(&consensusmodulev1.Module{}),
Expand Down
3 changes: 0 additions & 3 deletions tests/app/export.go
Original file line number Diff line number Diff line change
Expand Up @@ -65,9 +65,6 @@ func (app *TestApp) prepForZeroHeightGenesis(ctx sdk.Context, jailAllowedAddrs [
allowedAddrsMap[addr] = true
}

/* Just to be safe, assert the invariants on current state. */
app.CrisisKeeper.AssertInvariants(ctx)

/* Handle fee distribution state. */

// withdraw all validator commission
Expand Down
7 changes: 4 additions & 3 deletions tests/app/feemarketd/cmd/root.go
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,6 @@ import (
sdk "github.com/cosmos/cosmos-sdk/types"
authcmd "github.com/cosmos/cosmos-sdk/x/auth/client/cli"
"github.com/cosmos/cosmos-sdk/x/auth/types"
"github.com/cosmos/cosmos-sdk/x/crisis"
genutilcli "github.com/cosmos/cosmos-sdk/x/genutil/client/cli"
"github.com/spf13/cobra"
"github.com/spf13/viper"
Expand All @@ -31,6 +30,8 @@ import (
"github.com/skip-mev/feemarket/tests/app/params"
)

var flagCrisisDummy = "x-crisis-skip-assert-invariants" // dummy flag so that the crisis module does not need to be imported for security reasons

func NewRootCmd() *cobra.Command {
// we "pre"-instantiate the application for getting the injected/configured encoding configuration
simApp := app.New(log.NewNopLogger(), dbm.NewMemDB(), nil, true, simtestutil.NewAppOptionsWithFlagHome(app.DefaultNodeHome))
Expand Down Expand Up @@ -177,8 +178,8 @@ func initRootCmd(rootCmd *cobra.Command, encodingConfig params.EncodingConfig) {
)
}

func addModuleInitFlags(startCmd *cobra.Command) {
crisis.AddModuleInitFlags(startCmd)
func addModuleInitFlags(cmd *cobra.Command) {
cmd.Flags().Bool(flagCrisisDummy, true, "dummy flag for crisis module")
}

func genesisCommand(encodingConfig params.EncodingConfig, cmds ...*cobra.Command) *cobra.Command {
Expand Down
35 changes: 35 additions & 0 deletions testutils/keeper/keeper.go
Original file line number Diff line number Diff line change
Expand Up @@ -4,12 +4,15 @@ package keeper
import (
"testing"

consensustypes "github.com/cosmos/cosmos-sdk/x/consensus/types"

"github.com/cometbft/cometbft/libs/log"
tmproto "github.com/cometbft/cometbft/proto/tendermint/types"
storetypes "github.com/cosmos/cosmos-sdk/store/types"
sdk "github.com/cosmos/cosmos-sdk/types"
authkeeper "github.com/cosmos/cosmos-sdk/x/auth/keeper"
authtypes "github.com/cosmos/cosmos-sdk/x/auth/types"
consensuskeeper "github.com/cosmos/cosmos-sdk/x/consensus/keeper"
govtypes "github.com/cosmos/cosmos-sdk/x/gov/types"
testkeeper "github.com/skip-mev/chaintestutil/keeper"
"github.com/stretchr/testify/require"
Expand All @@ -22,6 +25,7 @@ import (
type TestKeepers struct {
testkeeper.TestKeepers
FeeMarketKeeper *feemarketkeeper.Keeper
ConsensusKeeper *consensuskeeper.Keeper
}

// TestMsgServers holds all message servers used during keeper tests for all modules
Expand All @@ -35,6 +39,16 @@ var additionalMaccPerms = map[string][]string{
feemarkettypes.FeeCollectorName: {authtypes.Burner},
}

var ConsensusParams = &tmproto.ConsensusParams{
Block: &tmproto.BlockParams{
MaxBytes: 1_000_000,
MaxGas: 1_000_000,
},
Evidence: nil,
Validator: nil,
Version: nil,
}
aljo242 marked this conversation as resolved.
Show resolved Hide resolved

// NewTestSetup returns initialized instances of all the keepers and message servers of the modules
func NewTestSetup(t testing.TB, options ...testkeeper.SetupOption) (sdk.Context, TestKeepers, TestMsgServers) {
options = append(options, testkeeper.WithAdditionalModuleAccounts(additionalMaccPerms))
Expand All @@ -43,6 +57,7 @@ func NewTestSetup(t testing.TB, options ...testkeeper.SetupOption) (sdk.Context,

// initialize extra keeper
feeMarketKeeper := FeeMarket(tk.Initializer, tk.AccountKeeper)
consensusKeeper := Consensus(tk.Initializer)
require.NoError(t, tk.Initializer.LoadLatest())

// initialize msg servers
Expand All @@ -58,9 +73,13 @@ func NewTestSetup(t testing.TB, options ...testkeeper.SetupOption) (sdk.Context,
err = feeMarketKeeper.SetParams(ctx, feemarkettypes.DefaultParams())
require.NoError(t, err)

// init dummy consensus params
consensusKeeper.Set(ctx, ConsensusParams)
aljo242 marked this conversation as resolved.
Show resolved Hide resolved

testKeepers := TestKeepers{
TestKeepers: tk,
FeeMarketKeeper: feeMarketKeeper,
ConsensusKeeper: consensusKeeper,
}

testMsgServers := TestMsgServers{
Expand All @@ -71,6 +90,22 @@ func NewTestSetup(t testing.TB, options ...testkeeper.SetupOption) (sdk.Context,
return ctx, testKeepers, testMsgServers
}

// Consensus initializes the consensus params module using the testkeepers intializer.
func Consensus(
initializer *testkeeper.Initializer,
) *consensuskeeper.Keeper {
storeKey := sdk.NewKVStoreKey(consensustypes.StoreKey)
initializer.StateStore.MountStoreWithDB(storeKey, storetypes.StoreTypeIAVL, initializer.DB)

k := consensuskeeper.NewKeeper(
initializer.Codec,
storeKey,
authtypes.NewModuleAddress(govtypes.ModuleName).String(),
)

return &k
}
aljo242 marked this conversation as resolved.
Show resolved Hide resolved

// FeeMarket initializes the fee market module using the testkeepers intializer.
func FeeMarket(
initializer *testkeeper.Initializer,
Expand Down
24 changes: 23 additions & 1 deletion x/feemarket/ante/suite/suite.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,8 @@ package suite
import (
"testing"

tmproto "github.com/cometbft/cometbft/proto/tendermint/types"

"github.com/cosmos/cosmos-sdk/client"
"github.com/cosmos/cosmos-sdk/client/tx"
cryptotypes "github.com/cosmos/cosmos-sdk/crypto/types"
Expand Down Expand Up @@ -71,7 +73,15 @@ func SetupTestSuite(t *testing.T, mock bool) *TestSuite {

s.EncCfg = encoding.MakeTestEncodingConfig(app.ModuleBasics.RegisterInterfaces)
ctx, testKeepers, _ := testkeeper.NewTestSetup(t)
s.Ctx = ctx
s.Ctx = ctx.WithConsensusParams(&tmproto.ConsensusParams{
Block: &tmproto.BlockParams{
MaxBytes: 0,
MaxGas: 1_000_000_000,
},
Evidence: nil,
Validator: nil,
Version: nil,
})

s.AccountKeeper = testKeepers.AccountKeeper
s.FeeMarketKeeper = testKeepers.FeeMarketKeeper
Expand All @@ -89,6 +99,7 @@ func SetupTestSuite(t *testing.T, mock bool) *TestSuite {
func (s *TestSuite) SetupHandlers(mock bool) {
bankKeeper := s.BankKeeper
feeGrantKeeper := s.FeeGrantKeeper

if mock {
bankKeeper = s.MockBankKeeper
feeGrantKeeper = s.MockFeeGrantKeeper
Expand Down Expand Up @@ -194,6 +205,17 @@ func (s *TestSuite) RunTestCase(t *testing.T, tc TestCase, args TestCaseArgs) {
t.Fatal("expected one of txErr, handleErr to be an error")
}
}

// reset consensus params
s.Ctx = s.Ctx.WithConsensusParams(&tmproto.ConsensusParams{
Block: &tmproto.BlockParams{
MaxBytes: 0,
MaxGas: 1_000_000_000,
},
Evidence: nil,
Validator: nil,
Version: nil,
})
}

// CreateTestTx is a helper function to create a tx given multiple inputs.
Expand Down
4 changes: 2 additions & 2 deletions x/feemarket/fuzz/aimd_eip1559_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ func TestAIMDLearningRate(t *testing.T) {
prevLearningRate := state.LearningRate

// Update the fee market.
if err := state.Update(blockUtilization, params); err != nil {
if err := state.Update(blockUtilization, params.MaxBlockUtilization); err != nil {
t.Fatalf("block update errors: %v", err)
}

Expand Down Expand Up @@ -80,7 +80,7 @@ func TestAIMDBaseFee(t *testing.T) {
blockUtilization := gasGen.Draw(t, "gas")
prevBaseFee := state.BaseFee

if err := state.Update(blockUtilization, params); err != nil {
if err := state.Update(blockUtilization, params.MaxBlockUtilization); err != nil {
t.Fatalf("block update errors: %v", err)
}

Expand Down
4 changes: 2 additions & 2 deletions x/feemarket/fuzz/eip1559_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ func TestLearningRate(t *testing.T) {
blockUtilization := rapid.Uint64Range(0, params.MaxBlockUtilization).Draw(t, "gas")

// Update the fee market.
if err := state.Update(blockUtilization, params); err != nil {
if err := state.Update(blockUtilization, params.MaxBlockUtilization); err != nil {
t.Fatalf("block update errors: %v", err)
}

Expand All @@ -50,7 +50,7 @@ func TestBaseFee(t *testing.T) {
blockUtilization := rapid.Uint64Range(0, params.MaxBlockUtilization).Draw(t, "gas")

// Update the fee market.
if err := state.Update(blockUtilization, params); err != nil {
if err := state.Update(blockUtilization, params.MaxBlockUtilization); err != nil {
t.Fatalf("block update errors: %v", err)
}

Expand Down
Loading
Loading