diff --git a/.github/workflows/generate_genesis_template.yml b/.github/workflows/generate_genesis_template.yml new file mode 100644 index 0000000..392bcfc --- /dev/null +++ b/.github/workflows/generate_genesis_template.yml @@ -0,0 +1,26 @@ +name: Generate Genesis Template +on: ["push"] +jobs: + build: + runs-on: ubuntu-latest + name: Generate Genesis Template + steps: + - uses: actions/checkout@v4 + - uses: actions/setup-go@v5 + with: + go-version: "1.23.1" + + - name: Install Dasel + run: | + curl -sSLf https://github.com/TomWright/dasel/releases/latest/download/dasel_linux_amd64 -o /usr/local/bin/dasel + chmod +x /usr/local/bin/dasel + + - name: Generate genesis template mainnet + run: make generate-genesis env=mainnet + env: + BECH32_PREFIX: ethm + + - name: Generate genesis template testnet + run: make generate-genesis env=testnet + env: + BECH32_PREFIX: ethm \ No newline at end of file diff --git a/Dockerfile b/Dockerfile index 32e1eaa..fc38f5c 100644 --- a/Dockerfile +++ b/Dockerfile @@ -3,7 +3,7 @@ FROM ubuntu:latest as go-builder # Install necessary dependencies RUN apt-get update && apt-get install -y \ - wget make git \ + wget make git build-essential \ && rm -rf /var/lib/apt/lists/* # Download and install Go 1.21 @@ -17,8 +17,6 @@ ENV GOROOT=/usr/local/go ENV GOPATH=$HOME/go ENV PATH=$GOPATH/bin:$GOROOT/bin:$PATH -RUN apt-get update -y -RUN apt-get install build-essential -y # Set the working directory WORKDIR /app @@ -40,6 +38,8 @@ RUN ARCH=$(uname -m) && WASMVM_VERSION=$(go list -m github.com/CosmWasm/wasmvm | wget https://github.com/CosmWasm/wasmvm/releases/download/$WASMVM_VERSION/libwasmvm.aarch64.so \ -O /lib/libwasmvm.aarch64.so +RUN go install -v github.com/bcdevtools/devd/v2/cmd/devd@latest + # Copy the remaining files COPY . . @@ -48,7 +48,9 @@ RUN make build BECH32_PREFIX=ethm FROM ubuntu:latest RUN apt-get update -y +RUN apt-get install -y curl +COPY --from=go-builder /go/bin/devd /usr/local/bin/devd COPY --from=go-builder /app/build/rollapp-evm /usr/local/bin/rollappd COPY --from=go-builder /lib/libwasmvm.x86_64.so /lib/libwasmvm.x86_64.so COPY --from=go-builder /lib/libwasmvm.aarch64.so /lib/libwasmvm.aarch64.so diff --git a/Makefile b/Makefile index c4fcab9..f512937 100644 --- a/Makefile +++ b/Makefile @@ -4,7 +4,7 @@ PROJECT_NAME=rollappd BRANCH := $(shell git rev-parse --abbrev-ref HEAD) COMMIT := $(shell git log -1 --format='%H') LEDGER_ENABLED ?= true -DRS_VERSION = 1 +DRS_VERSION = 4 #ifndef $(CELESTIA_NETWORK) # CELESTIA_NETWORK=mock @@ -173,3 +173,25 @@ release: release --clean --skip=validate .PHONY: release-dry-run release + +# Default DRS_VERSION if not set +DRS_VERSION ?= default-drs + +.PHONY: generate-genesis +generate-genesis: + @if [ -z "$(env)" ]; then \ + echo "Error: 'env' parameter is required. Use 'make generate-genesis env=mainnet' or 'make generate-genesis env=testnet'"; \ + exit 1; \ + fi + @if [ "$(env)" != "mainnet" ] && [ "$(env)" != "testnet" ]; then \ + echo "Error: 'env' must be either 'mainnet' or 'testnet'"; \ + exit 1; \ + fi + @echo "Building and installing rollapp-evm..." + @$(MAKE) install + @echo "Removing existing genesis file..." + @rm -f ${HOME}/.rollapp_evm/config/genesis.json + @echo "Initializing rollapp-evm..." + @rollapp-evm init test + @echo "Running genesis template script..." + @./scripts/generate-genesis-template.sh $(env) $(DRS_VERSION) diff --git a/README.md b/README.md index e58bdb8..03fee46 100644 --- a/README.md +++ b/README.md @@ -181,7 +181,7 @@ $EXECUTABLE tx sequencer create-sequencer sequencerConsensusKey --from $KEY_NAME ### Install dymension relayer ```shell -git clone https://github.com/dymensionxyz/go-relayer.git --branch v0.3.4-v2.5.2-relayer-canon-3 +git clone https://github.com/dymensionxyz/go-relayer.git --branch v0.3.4-v2.5.2-relayer-canon-6 cd go-relayer && make install ``` diff --git a/app/ante/ante.go b/app/ante/ante.go index 41aec5b..93ffc5e 100644 --- a/app/ante/ante.go +++ b/app/ante/ante.go @@ -22,6 +22,7 @@ import ( evmosante "github.com/evmos/evmos/v12/app/ante" evmosanteevm "github.com/evmos/evmos/v12/app/ante/evm" evmostypes "github.com/evmos/evmos/v12/types" + erc20keeper "github.com/evmos/evmos/v12/x/erc20/keeper" evmtypes "github.com/evmos/evmos/v12/x/evm/types" evmosvestingtypes "github.com/evmos/evmos/v12/x/vesting/types" tmlog "github.com/tendermint/tendermint/libs/log" @@ -38,9 +39,12 @@ func MustCreateHandler(codec codec.BinaryCodec, bankKeeper evmtypes.BankKeeper, feeMarketKeeper evmosanteevm.FeeMarketKeeper, evmKeeper evmosanteevm.EVMKeeper, + erc20Keeper erc20keeper.Keeper, ibcKeeper *ibckeeper.Keeper, distrKeeper distrkeeper.Keeper, sequencerKeeper seqkeeper.Keeper, + feeGrantKeeper authante.FeegrantKeeper, + authzKeeper evmosanteevm.AuthzKeeper, ) sdk.AnteHandler { ethOpts := evmosante.HandlerOptions{ Cdc: codec, @@ -48,14 +52,16 @@ func MustCreateHandler(codec codec.BinaryCodec, BankKeeper: bankKeeper, EvmKeeper: evmKeeper, StakingKeeper: stakingKeeper, - FeegrantKeeper: nil, + FeegrantKeeper: feeGrantKeeper, DistributionKeeper: distrKeeper, + ERC20Keeper: erc20Keeper, IBCKeeper: ibcKeeper, FeeMarketKeeper: feeMarketKeeper, SignModeHandler: txConfig.SignModeHandler(), SigGasConsumer: evmosante.SigVerificationGasConsumer, MaxTxGasWanted: maxGasWanted, TxFeeChecker: evmosanteevm.NewDynamicFeeChecker(evmKeeper), + AuthzKeeper: authzKeeper, } opts := HandlerOptions{ @@ -99,12 +105,18 @@ func (o HandlerOptions) validate() error { if o.EvmKeeper == nil { return errorsmod.Wrap(sdkerrors.ErrLogic, "evm keeper missing") } + if o.ERC20Keeper == nil { + return errorsmod.Wrap(sdkerrors.ErrLogic, "erc20 keeper missing") + } if o.DistributionKeeper == nil { return errorsmod.Wrap(sdkerrors.ErrLogic, "distribution keeper missing") } if o.StakingKeeper == nil { return errorsmod.Wrap(sdkerrors.ErrLogic, "staking keeper missing") } + if o.FeegrantKeeper == nil { + return errorsmod.Wrap(sdkerrors.ErrLogic, "feegrant keeper missing") + } /* Our stuff diff --git a/app/ante/handlers.go b/app/ante/handlers.go index e318564..b3a3485 100644 --- a/app/ante/handlers.go +++ b/app/ante/handlers.go @@ -25,10 +25,11 @@ func newEVMAnteHandler(options HandlerOptions) sdk.AnteHandler { evmante.NewEthMinGasPriceDecorator(options.FeeMarketKeeper, options.EvmKeeper), evmante.NewEthValidateBasicDecorator(options.EvmKeeper), evmante.NewEthSigVerificationDecorator(options.EvmKeeper), + evmante.NewEthAuthorizationDecorator(options.AuthzKeeper), evmante.NewEthAccountVerificationDecorator(options.AccountKeeper, options.EvmKeeper), evmante.NewCanTransferDecorator(options.EvmKeeper), // we intentionally omit the eth vesting transaction decorator - evmante.NewEthGasConsumeDecorator(options.BankKeeper, options.DistributionKeeper, options.EvmKeeper, options.StakingKeeper, options.MaxTxGasWanted), + evmante.NewEthGasConsumeDecorator(options.AccountKeeper, options.BankKeeper, options.ERC20Keeper, options.DistributionKeeper, options.EvmKeeper, options.StakingKeeper, options.MaxTxGasWanted), evmante.NewEthIncrementSenderSequenceDecorator(options.AccountKeeper), evmante.NewGasWantedDecorator(options.EvmKeeper, options.FeeMarketKeeper), // emit eth tx hash and index at the very last ante handler. @@ -79,7 +80,7 @@ func cosmosHandler(options HandlerOptions, sigChecker sdk.AnteDecorator) sdk.Ant NewCreateAccountDecorator(options.AccountKeeper), ante.NewConsumeGasForTxSizeDecorator(options.AccountKeeper), rdkante.NewBypassIBCFeeDecorator( - cosmosante.NewDeductFeeDecorator(options.AccountKeeper, options.BankKeeper, options.DistributionKeeper, options.FeegrantKeeper, options.StakingKeeper, options.TxFeeChecker), + cosmosante.NewDeductFeeDecorator(options.AccountKeeper, options.BankKeeper, options.ERC20Keeper, options.DistributionKeeper, options.FeegrantKeeper, options.StakingKeeper, options.TxFeeChecker), options.DistrKeeper, options.SequencersKeeper, ), diff --git a/app/app.go b/app/app.go index cc0aec0..21d3311 100644 --- a/app/app.go +++ b/app/app.go @@ -10,6 +10,7 @@ import ( "github.com/cosmos/cosmos-sdk/x/authz" authzkeeper "github.com/cosmos/cosmos-sdk/x/authz/keeper" authzmodule "github.com/cosmos/cosmos-sdk/x/authz/module" + "github.com/dymensionxyz/dymension-rdk/server/proposal" "github.com/gogo/protobuf/proto" "github.com/gorilla/mux" "github.com/rakyll/statik/fs" @@ -131,7 +132,6 @@ import ( "github.com/evmos/evmos/v12/ethereum/eip712" ethermint "github.com/evmos/evmos/v12/types" - claimstypes "github.com/evmos/evmos/v12/x/claims/types" "github.com/evmos/evmos/v12/x/erc20" erc20client "github.com/evmos/evmos/v12/x/erc20/client" erc20keeper "github.com/evmos/evmos/v12/x/erc20/keeper" @@ -152,11 +152,17 @@ import ( hubtypes "github.com/dymensionxyz/dymension-rdk/x/hub/types" // Upgrade handlers - v2_2_0_upgrade "github.com/dymensionxyz/rollapp-evm/app/upgrades/v2.2.0" // Force-load the tracer engines to trigger registration due to Go-Ethereum v1.10.15 changes _ "github.com/ethereum/go-ethereum/eth/tracers/js" _ "github.com/ethereum/go-ethereum/eth/tracers/native" + + dymintversion "github.com/dymensionxyz/dymint/version" + + "github.com/dymensionxyz/rollapp-evm/app/upgrades" + drs2 "github.com/dymensionxyz/rollapp-evm/app/upgrades/drs-2" + drs3 "github.com/dymensionxyz/rollapp-evm/app/upgrades/drs-3" + drs4 "github.com/dymensionxyz/rollapp-evm/app/upgrades/drs-4" ) const ( @@ -181,6 +187,8 @@ var ( feemarkettypes.StoreKey, erc20types.StoreKey, } + // Upgrades contains the upgrade handlers for the application + Upgrades = []upgrades.Upgrade{drs2.Upgrade, drs3.Upgrade, drs4.Upgrade} ) func getGovProposalHandlers() []govclient.ProposalHandler { @@ -533,7 +541,7 @@ func NewRollapp( govRouter := govv1beta1.NewRouter() govRouter. AddRoute(govtypes.RouterKey, govv1beta1.ProposalHandler). - AddRoute(paramproposal.RouterKey, params.NewParamChangeProposalHandler(app.ParamsKeeper)). + AddRoute(paramproposal.RouterKey, proposal.NewCustomParamChangeProposalHandler(app.ParamsKeeper, app.BankKeeper)). AddRoute(distrtypes.RouterKey, distr.NewCommunityPoolSpendProposalHandler(app.DistrKeeper)). AddRoute(upgradetypes.RouterKey, upgrade.NewSoftwareUpgradeProposalHandler(app.UpgradeKeeper)). AddRoute(ibcclienttypes.RouterKey, ibcclient.NewClientProposalHandler(app.IBCKeeper.ClientKeeper)). @@ -564,6 +572,7 @@ func NewRollapp( app.AccountKeeper, app.BankKeeper, app.MintKeeper, + app.IBCKeeper.ChannelKeeper, ) app.HubKeeper = hubkeeper.NewKeeper( @@ -614,7 +623,6 @@ func NewRollapp( transferStack, app.HubGenesisKeeper, app.BankKeeper, - app.IBCKeeper.ChannelKeeper, ) // Create static IBC router, add transfer route, then set and seal it @@ -810,9 +818,12 @@ func NewRollapp( app.BankKeeper, app.FeeMarketKeeper, app.EvmKeeper, + app.Erc20Keeper, app.IBCKeeper, app.DistrKeeper, app.SequencersKeeper, + app.FeeGrantKeeper, + app.AuthzKeeper, ) app.SetAnteHandler(h) app.setPostHandler() @@ -861,6 +872,13 @@ func (app *App) BeginBlocker(ctx sdk.Context, req abci.RequestBeginBlock) abci.R resp := app.mm.BeginBlock(ctx, req) resp.ConsensusMessagesResponses = consensusResponses + drsVersion, err := dymintversion.GetDRSVersion() + if err != nil { + panic(fmt.Errorf("Unable to get DRS version from binary: %w", err)) + } + if drsVersion != app.RollappParamsKeeper.Version(ctx) { + panic(fmt.Errorf("DRS version mismatch. rollapp DRS version: %d binary DRS version:%d", app.RollappParamsKeeper.Version(ctx), drsVersion)) + } return resp } @@ -1102,39 +1120,6 @@ func initParamsKeeper(appCodec codec.BinaryCodec, legacyAmino *codec.LegacyAmino return paramsKeeper } -func (app *App) setupUpgradeHandlers() { - UpgradeName := "v2.2.0" - - app.UpgradeKeeper.SetUpgradeHandler( - UpgradeName, - v2_2_0_upgrade.CreateUpgradeHandler( - app.mm, app.configurator, - ), - ) - - // When a planned update height is reached, the old binary will panic - // writing on disk the height and name of the update that triggered it - // This will read that value, and execute the preparations for the upgrade. - upgradeInfo, err := app.UpgradeKeeper.ReadUpgradeInfoFromDisk() - if err != nil { - panic(fmt.Errorf("failed to read upgrade info from disk: %w", err)) - } - - // Pre upgrade handler - switch upgradeInfo.Name { - // do nothing - } - - if upgradeInfo.Name == UpgradeName && !app.UpgradeKeeper.IsSkipHeight(upgradeInfo.Height) { - - storeUpgrades := storetypes.StoreUpgrades{ - Deleted: []string{claimstypes.ModuleName}, - } - - app.SetStoreLoader(upgradetypes.UpgradeStoreLoader(upgradeInfo.Height, &storeUpgrades)) - } -} - var evmAccountName = proto.MessageName(ðermint.EthAccount{}) func shouldBumpEvmAccountSequence(accountProtoName string, account authtypes.AccountI) (bool, error) { @@ -1149,3 +1134,31 @@ func shouldBumpEvmAccountSequence(accountProtoName string, account authtypes.Acc } return evmAccount.Type() == ethermint.AccountTypeEOA, nil } + +func (app *App) setupUpgradeHandlers() { + for _, u := range Upgrades { + app.setupUpgradeHandler(u) + } +} + +func (app *App) setupUpgradeHandler(upgrade upgrades.Upgrade) { + app.UpgradeKeeper.SetUpgradeHandler( + upgrade.Name, + upgrade.CreateHandler( + app.RollappParamsKeeper, + app.EvmKeeper, + app.mm, + app.configurator, + ), + ) + + upgradeInfo, err := app.UpgradeKeeper.ReadUpgradeInfoFromDisk() + if err != nil { + panic(fmt.Errorf("failed to read upgrade info from disk: %w", err)) + } + + if upgradeInfo.Name == upgrade.Name && !app.UpgradeKeeper.IsSkipHeight(upgradeInfo.Height) { + // configure store loader with the store upgrades + app.SetStoreLoader(upgradetypes.UpgradeStoreLoader(upgradeInfo.Height, &upgrade.StoreUpgrades)) + } +} diff --git a/app/test_helpers.go b/app/test_helpers.go index 25d78f7..89e0887 100644 --- a/app/test_helpers.go +++ b/app/test_helpers.go @@ -5,6 +5,8 @@ import ( "testing" "time" + version "github.com/dymensionxyz/dymint/version" + appcodec "github.com/cosmos/cosmos-sdk/codec" codectypes "github.com/cosmos/cosmos-sdk/codec/types" "github.com/cosmos/cosmos-sdk/crypto/codec" @@ -87,8 +89,8 @@ func SetupWithGenesisValSet(t *testing.T, valSet *types2.ValidatorSet, genAccs [ app, genesisState := setup(true, 5) genesisState = genesisStateWithValSet(t, app, genesisState, valSet, genAccs, balances...) + version.DRS = "1" genesisState = setRollappVersion(app.appCodec, genesisState, 1) - denomMD := banktypes.Metadata{ Description: "Stake token", DenomUnits: []*banktypes.DenomUnit{ @@ -121,6 +123,7 @@ func SetupWithGenesisValSet(t *testing.T, valSet *types2.ValidatorSet, genAccs [ ConsensusParams: utils.DefaultConsensusParams, AppStateBytes: stateBytes, ChainId: TestChainID, + GenesisChecksum: "abcdef", }, ) diff --git a/app/upgrades/drs-2/constants.go b/app/upgrades/drs-2/constants.go new file mode 100644 index 0000000..f1b446e --- /dev/null +++ b/app/upgrades/drs-2/constants.go @@ -0,0 +1,19 @@ +package drs2 + +import ( + storetypes "github.com/cosmos/cosmos-sdk/store/types" + "github.com/dymensionxyz/rollapp-evm/app/upgrades" + claimstypes "github.com/evmos/evmos/v12/x/claims/types" +) + +const ( + UpgradeName = "drs-2" +) + +var Upgrade = upgrades.Upgrade{ + Name: UpgradeName, + CreateHandler: CreateUpgradeHandler, + StoreUpgrades: storetypes.StoreUpgrades{ + Deleted: []string{claimstypes.ModuleName}, + }, +} diff --git a/app/upgrades/drs-2/upgrade.go b/app/upgrades/drs-2/upgrade.go new file mode 100644 index 0000000..ad866dd --- /dev/null +++ b/app/upgrades/drs-2/upgrade.go @@ -0,0 +1,50 @@ +package drs2 + +import ( + sdk "github.com/cosmos/cosmos-sdk/types" + "github.com/cosmos/cosmos-sdk/types/module" + upgradetypes "github.com/cosmos/cosmos-sdk/x/upgrade/types" + rollappparamskeeper "github.com/dymensionxyz/dymension-rdk/x/rollappparams/keeper" + rollappparamstypes "github.com/dymensionxyz/dymension-rdk/x/rollappparams/types" + evmkeeper "github.com/evmos/evmos/v12/x/evm/keeper" +) + +func CreateUpgradeHandler( + rpKeeper rollappparamskeeper.Keeper, + evmKeeper *evmkeeper.Keeper, + mm *module.Manager, + configurator module.Configurator, +) upgradetypes.UpgradeHandler { + return func(ctx sdk.Context, _ upgradetypes.Plan, fromVM module.VersionMap) (module.VersionMap, error) { + // upgrade drs to 2 + if err := rpKeeper.SetVersion(ctx, uint32(2)); err != nil { + return nil, err + } + + if err := HandleUpgrade(ctx, rpKeeper, evmKeeper); err != nil { + return nil, err + } + return mm.RunMigrations(ctx, configurator, fromVM) + } +} + +func HandleUpgrade( + ctx sdk.Context, + rpKeeper rollappparamskeeper.Keeper, + evmKeeper *evmkeeper.Keeper, +) error { + // migrate rollapp params with missing min-gas-prices + if err := rpKeeper.SetMinGasPrices(ctx, rollappparamstypes.DefaultParams().MinGasPrices); err != nil { + return err + } + + // migrate evm params with missing gasDenom + evmParams := evmKeeper.GetParams(ctx) + evmParams.GasDenom = evmParams.EvmDenom + + if err := evmKeeper.SetParams(ctx, evmParams); err != nil { + return err + } + + return nil +} diff --git a/app/upgrades/drs-3/constants.go b/app/upgrades/drs-3/constants.go new file mode 100644 index 0000000..21af7af --- /dev/null +++ b/app/upgrades/drs-3/constants.go @@ -0,0 +1,17 @@ +package drs3 + +import ( + storetypes "github.com/cosmos/cosmos-sdk/store/types" + + "github.com/dymensionxyz/rollapp-evm/app/upgrades" +) + +const ( + UpgradeName = "drs-3" +) + +var Upgrade = upgrades.Upgrade{ + Name: UpgradeName, + CreateHandler: CreateUpgradeHandler, + StoreUpgrades: storetypes.StoreUpgrades{}, +} diff --git a/app/upgrades/drs-3/upgrade.go b/app/upgrades/drs-3/upgrade.go new file mode 100644 index 0000000..dc5769b --- /dev/null +++ b/app/upgrades/drs-3/upgrade.go @@ -0,0 +1,39 @@ +package drs3 + +import ( + sdk "github.com/cosmos/cosmos-sdk/types" + "github.com/cosmos/cosmos-sdk/types/module" + upgradetypes "github.com/cosmos/cosmos-sdk/x/upgrade/types" + rollappparamskeeper "github.com/dymensionxyz/dymension-rdk/x/rollappparams/keeper" + evmkeeper "github.com/evmos/evmos/v12/x/evm/keeper" + + drs2 "github.com/dymensionxyz/rollapp-evm/app/upgrades/drs-2" +) + +func CreateUpgradeHandler( + rpKeeper rollappparamskeeper.Keeper, + evmKeeper *evmkeeper.Keeper, + mm *module.Manager, + configurator module.Configurator, +) upgradetypes.UpgradeHandler { + return func(ctx sdk.Context, plan upgradetypes.Plan, fromVM module.VersionMap) (module.VersionMap, error) { + if err := HandleUpgrade(ctx, rpKeeper, evmKeeper); err != nil { + return nil, err + } + return mm.RunMigrations(ctx, configurator, fromVM) + } +} + +func HandleUpgrade(ctx sdk.Context, rpKeeper rollappparamskeeper.Keeper, evmKeeper *evmkeeper.Keeper) error { + if rpKeeper.Version(ctx) < 2 { + // first run drs-2 migration + if err := drs2.HandleUpgrade(ctx, rpKeeper, evmKeeper); err != nil { + return err + } + } + // upgrade drs to 3 + if err := rpKeeper.SetVersion(ctx, uint32(3)); err != nil { + return err + } + return nil +} diff --git a/app/upgrades/drs-4/constants.go b/app/upgrades/drs-4/constants.go new file mode 100644 index 0000000..7e5743e --- /dev/null +++ b/app/upgrades/drs-4/constants.go @@ -0,0 +1,17 @@ +package drs4 + +import ( + storetypes "github.com/cosmos/cosmos-sdk/store/types" + + "github.com/dymensionxyz/rollapp-evm/app/upgrades" +) + +const ( + UpgradeName = "drs-4" +) + +var Upgrade = upgrades.Upgrade{ + Name: UpgradeName, + CreateHandler: CreateUpgradeHandler, + StoreUpgrades: storetypes.StoreUpgrades{}, +} diff --git a/app/upgrades/drs-4/upgrade.go b/app/upgrades/drs-4/upgrade.go new file mode 100644 index 0000000..6e9b39f --- /dev/null +++ b/app/upgrades/drs-4/upgrade.go @@ -0,0 +1,32 @@ +package drs4 + +import ( + sdk "github.com/cosmos/cosmos-sdk/types" + "github.com/cosmos/cosmos-sdk/types/module" + upgradetypes "github.com/cosmos/cosmos-sdk/x/upgrade/types" + rollappparamskeeper "github.com/dymensionxyz/dymension-rdk/x/rollappparams/keeper" + evmkeeper "github.com/evmos/evmos/v12/x/evm/keeper" + + drs3 "github.com/dymensionxyz/rollapp-evm/app/upgrades/drs-3" +) + +func CreateUpgradeHandler( + rpKeeper rollappparamskeeper.Keeper, + evmKeeper *evmkeeper.Keeper, + mm *module.Manager, + configurator module.Configurator, +) upgradetypes.UpgradeHandler { + return func(ctx sdk.Context, plan upgradetypes.Plan, fromVM module.VersionMap) (module.VersionMap, error) { + if rpKeeper.Version(ctx) < 3 { + // first run drs-3 migration + if err := drs3.HandleUpgrade(ctx, rpKeeper, evmKeeper); err != nil { + return nil, err + } + } + // upgrade drs to 4 + if err := rpKeeper.SetVersion(ctx, uint32(4)); err != nil { + return nil, err + } + return mm.RunMigrations(ctx, configurator, fromVM) + } +} diff --git a/app/upgrades/types.go b/app/upgrades/types.go new file mode 100644 index 0000000..a153c77 --- /dev/null +++ b/app/upgrades/types.go @@ -0,0 +1,29 @@ +package upgrades + +import ( + storetypes "github.com/cosmos/cosmos-sdk/store/types" + "github.com/cosmos/cosmos-sdk/types/module" + upgradetypes "github.com/cosmos/cosmos-sdk/x/upgrade/types" + rollappparamskeeper "github.com/dymensionxyz/dymension-rdk/x/rollappparams/keeper" + evmkeeper "github.com/evmos/evmos/v12/x/evm/keeper" +) + +// Upgrade defines a struct containing necessary fields that a SoftwareUpgradeProposal +// must have written, in order for the state migration to go smoothly. +// An upgrade must implement this struct, and then set it in the app.go. +// The app.go will then define the handler. +type Upgrade struct { + // Upgrade version name, for the upgrade handler, e.g. `v4` + Name string + + // CreateHandler defines the function that creates an upgrade handler + CreateHandler func( + rpKeeper rollappparamskeeper.Keeper, + evmKeeper *evmkeeper.Keeper, + mm *module.Manager, + configurator module.Configurator, + ) upgradetypes.UpgradeHandler + + // Store upgrades, should be used for any new modules introduced, new modules deleted, or store names renamed. + StoreUpgrades storetypes.StoreUpgrades +} diff --git a/app/upgrades/v2.2.0/upgrade.go b/app/upgrades/v2.2.0/upgrade.go deleted file mode 100644 index 3fbf388..0000000 --- a/app/upgrades/v2.2.0/upgrade.go +++ /dev/null @@ -1,16 +0,0 @@ -package v2_2_0 - -import ( - sdk "github.com/cosmos/cosmos-sdk/types" - "github.com/cosmos/cosmos-sdk/types/module" - upgradetypes "github.com/cosmos/cosmos-sdk/x/upgrade/types" -) - -func CreateUpgradeHandler( - mm *module.Manager, - configurator module.Configurator, -) upgradetypes.UpgradeHandler { - return func(ctx sdk.Context, _ upgradetypes.Plan, fromVM module.VersionMap) (module.VersionMap, error) { - return mm.RunMigrations(ctx, configurator, fromVM) - } -} diff --git a/cmd/rollappd/cmd/root.go b/cmd/rollappd/cmd/root.go index e95af1b..7492e8c 100644 --- a/cmd/rollappd/cmd/root.go +++ b/cmd/rollappd/cmd/root.go @@ -156,7 +156,12 @@ func initRootCmd( ) { // Set config sdkconfig := sdk.GetConfig() - rdk_utils.SetPrefixes(sdkconfig, app.AccountAddressPrefix) + // Add ability to override bech32 prefix from env variable + prefix := app.AccountAddressPrefix + if overridePrefix := os.Getenv("OVERRIDE_BECH32"); overridePrefix != "" { + prefix = overridePrefix + } + rdk_utils.SetPrefixes(sdkconfig, prefix) utils.SetBip44CoinType(sdkconfig) sdkconfig.Seal() diff --git a/genesis-templates/DRS/1/genesis-mainnet.json b/genesis-templates/DRS/1/genesis-mainnet.json new file mode 100644 index 0000000..838998c --- /dev/null +++ b/genesis-templates/DRS/1/genesis-mainnet.json @@ -0,0 +1,300 @@ +{ + "genesis_time": "2024-12-09T13:49:53.101151Z", + "chain_id": "rollappevm_1234-1", + "initial_height": "1", + "consensus_params": { + "block": { + "max_bytes": "500000", + "max_gas": "400000000", + "time_iota_ms": "1000" + }, + "evidence": { + "max_age_num_blocks": "100000", + "max_age_duration": "172800000000000", + "max_bytes": "500000" + }, + "validator": { + "pub_key_types": [ + "ed25519" + ] + }, + "version": {} + }, + "app_hash": "", + "app_state": { + "auth": { + "params": { + "max_memo_characters": "256", + "tx_sig_limit": "7", + "tx_size_cost_per_byte": "10", + "sig_verify_cost_ed25519": "590", + "sig_verify_cost_secp256k1": "1000" + }, + "accounts": [] + }, + "authz": { + "authorization": [] + }, + "bank": { + "params": { + "send_enabled": [], + "default_send_enabled": true + }, + "balances": [], + "supply": [], + "denom_metadata": [] + }, + "capability": { + "index": "1", + "owners": [] + }, + "distribution": { + "params": { + "community_tax": "0.00002", + "base_proposer_reward": "0.8", + "bonus_proposer_reward": "0.000000000000000000", + "withdraw_addr_enabled": true + }, + "fee_pool": { + "community_pool": [] + }, + "delegator_withdraw_infos": [], + "previous_proposer": "", + "outstanding_rewards": [], + "validator_accumulated_commissions": [], + "validator_historical_rewards": [], + "validator_current_rewards": [], + "delegator_starting_infos": [], + "validator_slash_events": [] + }, + "epochs": { + "epochs": [ + { + "identifier": "minute", + "start_time": "0001-01-01T00:00:00Z", + "duration": "60s", + "current_epoch": "0", + "current_epoch_start_time": "0001-01-01T00:00:00Z", + "epoch_counting_started": false, + "current_epoch_start_height": "0" + }, + { + "identifier": "hour", + "start_time": "0001-01-01T00:00:00Z", + "duration": "3600s", + "current_epoch": "0", + "current_epoch_start_time": "0001-01-01T00:00:00Z", + "epoch_counting_started": false, + "current_epoch_start_height": "0" + }, + { + "identifier": "day", + "start_time": "0001-01-01T00:00:00Z", + "duration": "86400s", + "current_epoch": "0", + "current_epoch_start_time": "0001-01-01T00:00:00Z", + "epoch_counting_started": false, + "current_epoch_start_height": "0" + }, + { + "identifier": "week", + "start_time": "0001-01-01T00:00:00Z", + "duration": "604800s", + "current_epoch": "0", + "current_epoch_start_time": "0001-01-01T00:00:00Z", + "epoch_counting_started": false, + "current_epoch_start_height": "0" + }, + { + "identifier": "year", + "start_time": "0001-01-01T00:00:00Z", + "duration": "31536000s", + "current_epoch": "0", + "current_epoch_start_time": "0001-01-01T00:00:00Z", + "epoch_counting_started": false, + "current_epoch_start_height": "0" + } + ] + }, + "erc20": { + "params": { + "enable_erc20": true, + "enable_evm_hook": true + }, + "token_pairs": [] + }, + "evm": { + "accounts": [], + "params": { + "evm_denom": "aevmos", + "enable_create": true, + "enable_call": true, + "extra_eips": [ + "3855" + ], + "chain_config": { + "homestead_block": "0", + "dao_fork_block": "0", + "dao_fork_support": true, + "eip150_block": "0", + "eip150_hash": "0x0000000000000000000000000000000000000000000000000000000000000000", + "eip155_block": "0", + "eip158_block": "0", + "byzantium_block": "0", + "constantinople_block": "0", + "petersburg_block": "0", + "istanbul_block": "0", + "muir_glacier_block": "0", + "berlin_block": "0", + "london_block": "0", + "arrow_glacier_block": "0", + "gray_glacier_block": "0", + "merge_netsplit_block": "0", + "shanghai_block": "0", + "cancun_block": "0" + }, + "allow_unprotected_txs": false + } + }, + "feegrant": { + "allowances": [] + }, + "feemarket": { + "params": { + "no_base_fee": false, + "base_fee_change_denominator": 8, + "elasticity_multiplier": 2, + "enable_height": "0", + "base_fee": "1000000000", + "min_gas_price": "20000000000.000000000000000000", + "min_gas_multiplier": "0.500000000000000000" + }, + "block_gas": "0" + }, + "genutil": { + "gen_txs": [] + }, + "gov": { + "starting_proposal_id": "1", + "deposits": [], + "votes": [], + "proposals": [], + "deposit_params": { + "min_deposit": [ + { + "denom": "stake", + "amount": "1000000000000000000000" + } + ], + "max_deposit_period": "172800s" + }, + "voting_params": { + "voting_period": "432000s" + }, + "tally_params": { + "quorum": "0.334000000000000000", + "threshold": "0.500000000000000000", + "veto_threshold": "0.334000000000000000" + } + }, + "hubgenesis": { + "params": {}, + "genesis_accounts": [] + }, + "hubs": { + "state": { + "hub": { + "registered_denoms": [] + } + } + }, + "ibc": { + "client_genesis": { + "clients": [], + "clients_consensus": [], + "clients_metadata": [], + "params": { + "allowed_clients": [ + "06-solomachine", + "07-tendermint" + ] + }, + "create_localhost": false, + "next_client_sequence": "0" + }, + "connection_genesis": { + "connections": [], + "client_connection_paths": [], + "next_connection_sequence": "0", + "params": { + "max_expected_time_per_block": "30000000000" + } + }, + "channel_genesis": { + "channels": [], + "acknowledgements": [], + "commitments": [], + "receipts": [], + "send_sequences": [], + "recv_sequences": [], + "ack_sequences": [], + "next_channel_sequence": "0" + } + }, + "mint": { + "minter": { + "current_inflation_rate": "0.080000000000000000" + }, + "params": { + "mint_denom": "stake", + "mint_epoch_identifier": "hour", + "mint_start_epoch": "1", + "inflation_change_epoch_identifier": "year", + "inflation_rate_change": "0.010000000000000000", + "target_inflation_rate": "0.020000000000000000" + } + }, + "params": null, + "rollappparams": { + "params": { + "da": "celestia", + "drs_version": 1 + } + }, + "sequencers": { + "params": { + "unbonding_time": "1814400s", + "historical_entries": 10000 + }, + "sequencers": [] + }, + "staking": { + "params": { + "unbonding_time": "1814400s", + "max_validators": 100, + "max_entries": 7, + "historical_entries": 10000, + "bond_denom": "stake", + "min_commission_rate": "0.050000000000000000" + }, + "last_total_power": "0", + "last_validator_powers": [], + "validators": [], + "delegations": [], + "unbonding_delegations": [], + "redelegations": [], + "exported": false + }, + "timeupgrade": null, + "transfer": { + "port_id": "transfer", + "denom_traces": [], + "params": { + "send_enabled": true, + "receive_enabled": true + } + }, + "upgrade": {}, + "vesting": {} + } +} diff --git a/genesis-templates/DRS/1/genesis-testnet.json b/genesis-templates/DRS/1/genesis-testnet.json new file mode 100644 index 0000000..e402cd4 --- /dev/null +++ b/genesis-templates/DRS/1/genesis-testnet.json @@ -0,0 +1,300 @@ +{ + "genesis_time": "2024-12-09T13:50:29.691627Z", + "chain_id": "rollappevm_1234-1", + "initial_height": "1", + "consensus_params": { + "block": { + "max_bytes": "500000", + "max_gas": "400000000", + "time_iota_ms": "1000" + }, + "evidence": { + "max_age_num_blocks": "100000", + "max_age_duration": "172800000000000", + "max_bytes": "500000" + }, + "validator": { + "pub_key_types": [ + "ed25519" + ] + }, + "version": {} + }, + "app_hash": "", + "app_state": { + "auth": { + "params": { + "max_memo_characters": "256", + "tx_sig_limit": "7", + "tx_size_cost_per_byte": "10", + "sig_verify_cost_ed25519": "590", + "sig_verify_cost_secp256k1": "1000" + }, + "accounts": [] + }, + "authz": { + "authorization": [] + }, + "bank": { + "params": { + "send_enabled": [], + "default_send_enabled": true + }, + "balances": [], + "supply": [], + "denom_metadata": [] + }, + "capability": { + "index": "1", + "owners": [] + }, + "distribution": { + "params": { + "community_tax": "0.00002", + "base_proposer_reward": "0.8", + "bonus_proposer_reward": "0.000000000000000000", + "withdraw_addr_enabled": true + }, + "fee_pool": { + "community_pool": [] + }, + "delegator_withdraw_infos": [], + "previous_proposer": "", + "outstanding_rewards": [], + "validator_accumulated_commissions": [], + "validator_historical_rewards": [], + "validator_current_rewards": [], + "delegator_starting_infos": [], + "validator_slash_events": [] + }, + "epochs": { + "epochs": [ + { + "identifier": "minute", + "start_time": "0001-01-01T00:00:00Z", + "duration": "60s", + "current_epoch": "0", + "current_epoch_start_time": "0001-01-01T00:00:00Z", + "epoch_counting_started": false, + "current_epoch_start_height": "0" + }, + { + "identifier": "hour", + "start_time": "0001-01-01T00:00:00Z", + "duration": "3600s", + "current_epoch": "0", + "current_epoch_start_time": "0001-01-01T00:00:00Z", + "epoch_counting_started": false, + "current_epoch_start_height": "0" + }, + { + "identifier": "day", + "start_time": "0001-01-01T00:00:00Z", + "duration": "86400s", + "current_epoch": "0", + "current_epoch_start_time": "0001-01-01T00:00:00Z", + "epoch_counting_started": false, + "current_epoch_start_height": "0" + }, + { + "identifier": "week", + "start_time": "0001-01-01T00:00:00Z", + "duration": "604800s", + "current_epoch": "0", + "current_epoch_start_time": "0001-01-01T00:00:00Z", + "epoch_counting_started": false, + "current_epoch_start_height": "0" + }, + { + "identifier": "year", + "start_time": "0001-01-01T00:00:00Z", + "duration": "31536000s", + "current_epoch": "0", + "current_epoch_start_time": "0001-01-01T00:00:00Z", + "epoch_counting_started": false, + "current_epoch_start_height": "0" + } + ] + }, + "erc20": { + "params": { + "enable_erc20": true, + "enable_evm_hook": true + }, + "token_pairs": [] + }, + "evm": { + "accounts": [], + "params": { + "evm_denom": "aevmos", + "enable_create": true, + "enable_call": true, + "extra_eips": [ + "3855" + ], + "chain_config": { + "homestead_block": "0", + "dao_fork_block": "0", + "dao_fork_support": true, + "eip150_block": "0", + "eip150_hash": "0x0000000000000000000000000000000000000000000000000000000000000000", + "eip155_block": "0", + "eip158_block": "0", + "byzantium_block": "0", + "constantinople_block": "0", + "petersburg_block": "0", + "istanbul_block": "0", + "muir_glacier_block": "0", + "berlin_block": "0", + "london_block": "0", + "arrow_glacier_block": "0", + "gray_glacier_block": "0", + "merge_netsplit_block": "0", + "shanghai_block": "0", + "cancun_block": "0" + }, + "allow_unprotected_txs": false + } + }, + "feegrant": { + "allowances": [] + }, + "feemarket": { + "params": { + "no_base_fee": false, + "base_fee_change_denominator": 8, + "elasticity_multiplier": 2, + "enable_height": "0", + "base_fee": "1000000000", + "min_gas_price": "20000000000.000000000000000000", + "min_gas_multiplier": "0.500000000000000000" + }, + "block_gas": "0" + }, + "genutil": { + "gen_txs": [] + }, + "gov": { + "starting_proposal_id": "1", + "deposits": [], + "votes": [], + "proposals": [], + "deposit_params": { + "min_deposit": [ + { + "denom": "stake", + "amount": "1000000000000000000000" + } + ], + "max_deposit_period": "172800s" + }, + "voting_params": { + "voting_period": "300s" + }, + "tally_params": { + "quorum": "0.334000000000000000", + "threshold": "0.500000000000000000", + "veto_threshold": "0.334000000000000000" + } + }, + "hubgenesis": { + "params": {}, + "genesis_accounts": [] + }, + "hubs": { + "state": { + "hub": { + "registered_denoms": [] + } + } + }, + "ibc": { + "client_genesis": { + "clients": [], + "clients_consensus": [], + "clients_metadata": [], + "params": { + "allowed_clients": [ + "06-solomachine", + "07-tendermint" + ] + }, + "create_localhost": false, + "next_client_sequence": "0" + }, + "connection_genesis": { + "connections": [], + "client_connection_paths": [], + "next_connection_sequence": "0", + "params": { + "max_expected_time_per_block": "30000000000" + } + }, + "channel_genesis": { + "channels": [], + "acknowledgements": [], + "commitments": [], + "receipts": [], + "send_sequences": [], + "recv_sequences": [], + "ack_sequences": [], + "next_channel_sequence": "0" + } + }, + "mint": { + "minter": { + "current_inflation_rate": "0.080000000000000000" + }, + "params": { + "mint_denom": "stake", + "mint_epoch_identifier": "hour", + "mint_start_epoch": "1", + "inflation_change_epoch_identifier": "year", + "inflation_rate_change": "0.010000000000000000", + "target_inflation_rate": "0.020000000000000000" + } + }, + "params": null, + "rollappparams": { + "params": { + "da": "celestia", + "drs_version": 1 + } + }, + "sequencers": { + "params": { + "unbonding_time": "1309600s", + "historical_entries": 10000 + }, + "sequencers": [] + }, + "staking": { + "params": { + "unbonding_time": "1309600s", + "max_validators": 100, + "max_entries": 7, + "historical_entries": 10000, + "bond_denom": "stake", + "min_commission_rate": "0.050000000000000000" + }, + "last_total_power": "0", + "last_validator_powers": [], + "validators": [], + "delegations": [], + "unbonding_delegations": [], + "redelegations": [], + "exported": false + }, + "timeupgrade": null, + "transfer": { + "port_id": "transfer", + "denom_traces": [], + "params": { + "send_enabled": true, + "receive_enabled": true + } + }, + "upgrade": {}, + "vesting": {} + } +} diff --git a/genesis-templates/DRS/2/genesis-mainnet.json b/genesis-templates/DRS/2/genesis-mainnet.json new file mode 100644 index 0000000..7b30e25 --- /dev/null +++ b/genesis-templates/DRS/2/genesis-mainnet.json @@ -0,0 +1,303 @@ +{ + "genesis_time": "2024-12-12T17:19:38.388208Z", + "chain_id": "rollappevm_1234-1", + "initial_height": "1", + "consensus_params": { + "block": { + "max_bytes": "500000", + "max_gas": "400000000", + "time_iota_ms": "1000" + }, + "evidence": { + "max_age_num_blocks": "100000", + "max_age_duration": "172800000000000", + "max_bytes": "500000" + }, + "validator": { + "pub_key_types": [ + "ed25519" + ] + }, + "version": {} + }, + "app_hash": "", + "app_state": { + "auth": { + "params": { + "max_memo_characters": "256", + "tx_sig_limit": "7", + "tx_size_cost_per_byte": "10", + "sig_verify_cost_ed25519": "590", + "sig_verify_cost_secp256k1": "1000" + }, + "accounts": [] + }, + "authz": { + "authorization": [] + }, + "bank": { + "params": { + "send_enabled": [], + "default_send_enabled": true + }, + "balances": [], + "supply": [], + "denom_metadata": [] + }, + "capability": { + "index": "1", + "owners": [] + }, + "distribution": { + "params": { + "community_tax": "0.00002", + "base_proposer_reward": "0.8", + "bonus_proposer_reward": "0.000000000000000000", + "withdraw_addr_enabled": true + }, + "fee_pool": { + "community_pool": [] + }, + "delegator_withdraw_infos": [], + "previous_proposer": "", + "outstanding_rewards": [], + "validator_accumulated_commissions": [], + "validator_historical_rewards": [], + "validator_current_rewards": [], + "delegator_starting_infos": [], + "validator_slash_events": [] + }, + "epochs": { + "epochs": [ + { + "identifier": "minute", + "start_time": "0001-01-01T00:00:00Z", + "duration": "60s", + "current_epoch": "0", + "current_epoch_start_time": "0001-01-01T00:00:00Z", + "epoch_counting_started": false, + "current_epoch_start_height": "0" + }, + { + "identifier": "hour", + "start_time": "0001-01-01T00:00:00Z", + "duration": "3600s", + "current_epoch": "0", + "current_epoch_start_time": "0001-01-01T00:00:00Z", + "epoch_counting_started": false, + "current_epoch_start_height": "0" + }, + { + "identifier": "day", + "start_time": "0001-01-01T00:00:00Z", + "duration": "86400s", + "current_epoch": "0", + "current_epoch_start_time": "0001-01-01T00:00:00Z", + "epoch_counting_started": false, + "current_epoch_start_height": "0" + }, + { + "identifier": "week", + "start_time": "0001-01-01T00:00:00Z", + "duration": "604800s", + "current_epoch": "0", + "current_epoch_start_time": "0001-01-01T00:00:00Z", + "epoch_counting_started": false, + "current_epoch_start_height": "0" + }, + { + "identifier": "year", + "start_time": "0001-01-01T00:00:00Z", + "duration": "31536000s", + "current_epoch": "0", + "current_epoch_start_time": "0001-01-01T00:00:00Z", + "epoch_counting_started": false, + "current_epoch_start_height": "0" + } + ] + }, + "erc20": { + "params": { + "enable_erc20": true, + "enable_evm_hook": true, + "registration_fee": "10000000000000000000" + }, + "token_pairs": [] + }, + "evm": { + "accounts": [], + "params": { + "evm_denom": "aevmos", + "enable_create": true, + "enable_call": true, + "extra_eips": [ + "3855" + ], + "chain_config": { + "homestead_block": "0", + "dao_fork_block": "0", + "dao_fork_support": true, + "eip150_block": "0", + "eip150_hash": "0x0000000000000000000000000000000000000000000000000000000000000000", + "eip155_block": "0", + "eip158_block": "0", + "byzantium_block": "0", + "constantinople_block": "0", + "petersburg_block": "0", + "istanbul_block": "0", + "muir_glacier_block": "0", + "berlin_block": "0", + "london_block": "0", + "arrow_glacier_block": "0", + "gray_glacier_block": "0", + "merge_netsplit_block": "0", + "shanghai_block": "0", + "cancun_block": "0" + }, + "allow_unprotected_txs": false, + "gas_denom": "aevmos" + } + }, + "feegrant": { + "allowances": [] + }, + "feemarket": { + "params": { + "no_base_fee": false, + "base_fee_change_denominator": 8, + "elasticity_multiplier": 2, + "enable_height": "0", + "base_fee": "1000000000", + "min_gas_price": "20000000000.000000000000000000", + "min_gas_multiplier": "0.500000000000000000" + }, + "block_gas": "0" + }, + "genutil": { + "gen_txs": [] + }, + "gov": { + "starting_proposal_id": "1", + "deposits": [], + "votes": [], + "proposals": [], + "deposit_params": { + "min_deposit": [ + { + "denom": "stake", + "amount": "1000000000000000000000" + } + ], + "max_deposit_period": "172800s" + }, + "voting_params": { + "voting_period": "432000s" + }, + "tally_params": { + "quorum": "0.334000000000000000", + "threshold": "0.500000000000000000", + "veto_threshold": "0.334000000000000000" + } + }, + "hubgenesis": { + "params": {}, + "genesis_accounts": [] + }, + "hubs": { + "state": { + "hub": { + "registered_denoms": [] + } + } + }, + "ibc": { + "client_genesis": { + "clients": [], + "clients_consensus": [], + "clients_metadata": [], + "params": { + "allowed_clients": [ + "06-solomachine", + "07-tendermint" + ] + }, + "create_localhost": false, + "next_client_sequence": "0" + }, + "connection_genesis": { + "connections": [], + "client_connection_paths": [], + "next_connection_sequence": "0", + "params": { + "max_expected_time_per_block": "30000000000" + } + }, + "channel_genesis": { + "channels": [], + "acknowledgements": [], + "commitments": [], + "receipts": [], + "send_sequences": [], + "recv_sequences": [], + "ack_sequences": [], + "next_channel_sequence": "0" + } + }, + "mint": { + "minter": { + "current_inflation_rate": "0.080000000000000000" + }, + "params": { + "mint_denom": "stake", + "mint_epoch_identifier": "hour", + "mint_start_epoch": "1", + "inflation_change_epoch_identifier": "year", + "inflation_rate_change": "0.010000000000000000", + "target_inflation_rate": "0.020000000000000000" + } + }, + "params": null, + "rollappparams": { + "params": { + "da": "celestia", + "drs_version": 2, + "min_gas_prices": [] + } + }, + "sequencers": { + "params": { + "unbonding_time": "1814400s", + "historical_entries": 10000 + }, + "sequencers": [] + }, + "staking": { + "params": { + "unbonding_time": "1814400s", + "max_validators": 100, + "max_entries": 7, + "historical_entries": 10000, + "bond_denom": "stake", + "min_commission_rate": "0.050000000000000000" + }, + "last_total_power": "0", + "last_validator_powers": [], + "validators": [], + "delegations": [], + "unbonding_delegations": [], + "redelegations": [], + "exported": false + }, + "timeupgrade": null, + "transfer": { + "port_id": "transfer", + "denom_traces": [], + "params": { + "send_enabled": true, + "receive_enabled": true + } + }, + "upgrade": {}, + "vesting": {} + } +} diff --git a/genesis-templates/DRS/2/genesis-testnet.json b/genesis-templates/DRS/2/genesis-testnet.json new file mode 100644 index 0000000..d0f2ac8 --- /dev/null +++ b/genesis-templates/DRS/2/genesis-testnet.json @@ -0,0 +1,303 @@ +{ + "genesis_time": "2024-12-12T17:19:55.783133Z", + "chain_id": "rollappevm_1234-1", + "initial_height": "1", + "consensus_params": { + "block": { + "max_bytes": "500000", + "max_gas": "400000000", + "time_iota_ms": "1000" + }, + "evidence": { + "max_age_num_blocks": "100000", + "max_age_duration": "172800000000000", + "max_bytes": "500000" + }, + "validator": { + "pub_key_types": [ + "ed25519" + ] + }, + "version": {} + }, + "app_hash": "", + "app_state": { + "auth": { + "params": { + "max_memo_characters": "256", + "tx_sig_limit": "7", + "tx_size_cost_per_byte": "10", + "sig_verify_cost_ed25519": "590", + "sig_verify_cost_secp256k1": "1000" + }, + "accounts": [] + }, + "authz": { + "authorization": [] + }, + "bank": { + "params": { + "send_enabled": [], + "default_send_enabled": true + }, + "balances": [], + "supply": [], + "denom_metadata": [] + }, + "capability": { + "index": "1", + "owners": [] + }, + "distribution": { + "params": { + "community_tax": "0.00002", + "base_proposer_reward": "0.8", + "bonus_proposer_reward": "0.000000000000000000", + "withdraw_addr_enabled": true + }, + "fee_pool": { + "community_pool": [] + }, + "delegator_withdraw_infos": [], + "previous_proposer": "", + "outstanding_rewards": [], + "validator_accumulated_commissions": [], + "validator_historical_rewards": [], + "validator_current_rewards": [], + "delegator_starting_infos": [], + "validator_slash_events": [] + }, + "epochs": { + "epochs": [ + { + "identifier": "minute", + "start_time": "0001-01-01T00:00:00Z", + "duration": "60s", + "current_epoch": "0", + "current_epoch_start_time": "0001-01-01T00:00:00Z", + "epoch_counting_started": false, + "current_epoch_start_height": "0" + }, + { + "identifier": "hour", + "start_time": "0001-01-01T00:00:00Z", + "duration": "3600s", + "current_epoch": "0", + "current_epoch_start_time": "0001-01-01T00:00:00Z", + "epoch_counting_started": false, + "current_epoch_start_height": "0" + }, + { + "identifier": "day", + "start_time": "0001-01-01T00:00:00Z", + "duration": "86400s", + "current_epoch": "0", + "current_epoch_start_time": "0001-01-01T00:00:00Z", + "epoch_counting_started": false, + "current_epoch_start_height": "0" + }, + { + "identifier": "week", + "start_time": "0001-01-01T00:00:00Z", + "duration": "604800s", + "current_epoch": "0", + "current_epoch_start_time": "0001-01-01T00:00:00Z", + "epoch_counting_started": false, + "current_epoch_start_height": "0" + }, + { + "identifier": "year", + "start_time": "0001-01-01T00:00:00Z", + "duration": "31536000s", + "current_epoch": "0", + "current_epoch_start_time": "0001-01-01T00:00:00Z", + "epoch_counting_started": false, + "current_epoch_start_height": "0" + } + ] + }, + "erc20": { + "params": { + "enable_erc20": true, + "enable_evm_hook": true, + "registration_fee": "10000000000000000000" + }, + "token_pairs": [] + }, + "evm": { + "accounts": [], + "params": { + "evm_denom": "aevmos", + "enable_create": true, + "enable_call": true, + "extra_eips": [ + "3855" + ], + "chain_config": { + "homestead_block": "0", + "dao_fork_block": "0", + "dao_fork_support": true, + "eip150_block": "0", + "eip150_hash": "0x0000000000000000000000000000000000000000000000000000000000000000", + "eip155_block": "0", + "eip158_block": "0", + "byzantium_block": "0", + "constantinople_block": "0", + "petersburg_block": "0", + "istanbul_block": "0", + "muir_glacier_block": "0", + "berlin_block": "0", + "london_block": "0", + "arrow_glacier_block": "0", + "gray_glacier_block": "0", + "merge_netsplit_block": "0", + "shanghai_block": "0", + "cancun_block": "0" + }, + "allow_unprotected_txs": false, + "gas_denom": "aevmos" + } + }, + "feegrant": { + "allowances": [] + }, + "feemarket": { + "params": { + "no_base_fee": false, + "base_fee_change_denominator": 8, + "elasticity_multiplier": 2, + "enable_height": "0", + "base_fee": "1000000000", + "min_gas_price": "20000000000.000000000000000000", + "min_gas_multiplier": "0.500000000000000000" + }, + "block_gas": "0" + }, + "genutil": { + "gen_txs": [] + }, + "gov": { + "starting_proposal_id": "1", + "deposits": [], + "votes": [], + "proposals": [], + "deposit_params": { + "min_deposit": [ + { + "denom": "stake", + "amount": "1000000000000000000000" + } + ], + "max_deposit_period": "172800s" + }, + "voting_params": { + "voting_period": "300s" + }, + "tally_params": { + "quorum": "0.334000000000000000", + "threshold": "0.500000000000000000", + "veto_threshold": "0.334000000000000000" + } + }, + "hubgenesis": { + "params": {}, + "genesis_accounts": [] + }, + "hubs": { + "state": { + "hub": { + "registered_denoms": [] + } + } + }, + "ibc": { + "client_genesis": { + "clients": [], + "clients_consensus": [], + "clients_metadata": [], + "params": { + "allowed_clients": [ + "06-solomachine", + "07-tendermint" + ] + }, + "create_localhost": false, + "next_client_sequence": "0" + }, + "connection_genesis": { + "connections": [], + "client_connection_paths": [], + "next_connection_sequence": "0", + "params": { + "max_expected_time_per_block": "30000000000" + } + }, + "channel_genesis": { + "channels": [], + "acknowledgements": [], + "commitments": [], + "receipts": [], + "send_sequences": [], + "recv_sequences": [], + "ack_sequences": [], + "next_channel_sequence": "0" + } + }, + "mint": { + "minter": { + "current_inflation_rate": "0.080000000000000000" + }, + "params": { + "mint_denom": "stake", + "mint_epoch_identifier": "hour", + "mint_start_epoch": "1", + "inflation_change_epoch_identifier": "year", + "inflation_rate_change": "0.010000000000000000", + "target_inflation_rate": "0.020000000000000000" + } + }, + "params": null, + "rollappparams": { + "params": { + "da": "celestia", + "drs_version": 2, + "min_gas_prices": [] + } + }, + "sequencers": { + "params": { + "unbonding_time": "1309600s", + "historical_entries": 10000 + }, + "sequencers": [] + }, + "staking": { + "params": { + "unbonding_time": "1309600s", + "max_validators": 100, + "max_entries": 7, + "historical_entries": 10000, + "bond_denom": "stake", + "min_commission_rate": "0.050000000000000000" + }, + "last_total_power": "0", + "last_validator_powers": [], + "validators": [], + "delegations": [], + "unbonding_delegations": [], + "redelegations": [], + "exported": false + }, + "timeupgrade": null, + "transfer": { + "port_id": "transfer", + "denom_traces": [], + "params": { + "send_enabled": true, + "receive_enabled": true + } + }, + "upgrade": {}, + "vesting": {} + } +} diff --git a/genesis-templates/DRS/3/genesis-mainnet.json b/genesis-templates/DRS/3/genesis-mainnet.json new file mode 100644 index 0000000..851f789 --- /dev/null +++ b/genesis-templates/DRS/3/genesis-mainnet.json @@ -0,0 +1,303 @@ +{ + "genesis_time": "2024-12-16T14:08:08.129181Z", + "chain_id": "rollappevm_1234-1", + "initial_height": "1", + "consensus_params": { + "block": { + "max_bytes": "500000", + "max_gas": "400000000", + "time_iota_ms": "1000" + }, + "evidence": { + "max_age_num_blocks": "100000", + "max_age_duration": "172800000000000", + "max_bytes": "500000" + }, + "validator": { + "pub_key_types": [ + "ed25519" + ] + }, + "version": {} + }, + "app_hash": "", + "app_state": { + "auth": { + "params": { + "max_memo_characters": "256", + "tx_sig_limit": "7", + "tx_size_cost_per_byte": "10", + "sig_verify_cost_ed25519": "590", + "sig_verify_cost_secp256k1": "1000" + }, + "accounts": [] + }, + "authz": { + "authorization": [] + }, + "bank": { + "params": { + "send_enabled": [], + "default_send_enabled": true + }, + "balances": [], + "supply": [], + "denom_metadata": [] + }, + "capability": { + "index": "1", + "owners": [] + }, + "distribution": { + "params": { + "community_tax": "0.00002", + "base_proposer_reward": "0.8", + "bonus_proposer_reward": "0.000000000000000000", + "withdraw_addr_enabled": true + }, + "fee_pool": { + "community_pool": [] + }, + "delegator_withdraw_infos": [], + "previous_proposer": "", + "outstanding_rewards": [], + "validator_accumulated_commissions": [], + "validator_historical_rewards": [], + "validator_current_rewards": [], + "delegator_starting_infos": [], + "validator_slash_events": [] + }, + "epochs": { + "epochs": [ + { + "identifier": "minute", + "start_time": "0001-01-01T00:00:00Z", + "duration": "60s", + "current_epoch": "0", + "current_epoch_start_time": "0001-01-01T00:00:00Z", + "epoch_counting_started": false, + "current_epoch_start_height": "0" + }, + { + "identifier": "hour", + "start_time": "0001-01-01T00:00:00Z", + "duration": "3600s", + "current_epoch": "0", + "current_epoch_start_time": "0001-01-01T00:00:00Z", + "epoch_counting_started": false, + "current_epoch_start_height": "0" + }, + { + "identifier": "day", + "start_time": "0001-01-01T00:00:00Z", + "duration": "86400s", + "current_epoch": "0", + "current_epoch_start_time": "0001-01-01T00:00:00Z", + "epoch_counting_started": false, + "current_epoch_start_height": "0" + }, + { + "identifier": "week", + "start_time": "0001-01-01T00:00:00Z", + "duration": "604800s", + "current_epoch": "0", + "current_epoch_start_time": "0001-01-01T00:00:00Z", + "epoch_counting_started": false, + "current_epoch_start_height": "0" + }, + { + "identifier": "year", + "start_time": "0001-01-01T00:00:00Z", + "duration": "31536000s", + "current_epoch": "0", + "current_epoch_start_time": "0001-01-01T00:00:00Z", + "epoch_counting_started": false, + "current_epoch_start_height": "0" + } + ] + }, + "erc20": { + "params": { + "enable_erc20": true, + "enable_evm_hook": true, + "registration_fee": "10000000000000000000" + }, + "token_pairs": [] + }, + "evm": { + "accounts": [], + "params": { + "evm_denom": "aevmos", + "enable_create": true, + "enable_call": true, + "extra_eips": [ + "3855" + ], + "chain_config": { + "homestead_block": "0", + "dao_fork_block": "0", + "dao_fork_support": true, + "eip150_block": "0", + "eip150_hash": "0x0000000000000000000000000000000000000000000000000000000000000000", + "eip155_block": "0", + "eip158_block": "0", + "byzantium_block": "0", + "constantinople_block": "0", + "petersburg_block": "0", + "istanbul_block": "0", + "muir_glacier_block": "0", + "berlin_block": "0", + "london_block": "0", + "arrow_glacier_block": "0", + "gray_glacier_block": "0", + "merge_netsplit_block": "0", + "shanghai_block": "0", + "cancun_block": "0" + }, + "allow_unprotected_txs": false, + "gas_denom": "aevmos" + } + }, + "feegrant": { + "allowances": [] + }, + "feemarket": { + "params": { + "no_base_fee": false, + "base_fee_change_denominator": 8, + "elasticity_multiplier": 2, + "enable_height": "0", + "base_fee": "1000000000", + "min_gas_price": "20000000000.000000000000000000", + "min_gas_multiplier": "0.500000000000000000" + }, + "block_gas": "0" + }, + "genutil": { + "gen_txs": [] + }, + "gov": { + "starting_proposal_id": "1", + "deposits": [], + "votes": [], + "proposals": [], + "deposit_params": { + "min_deposit": [ + { + "denom": "stake", + "amount": "1000000000000000000000" + } + ], + "max_deposit_period": "172800s" + }, + "voting_params": { + "voting_period": "432000s" + }, + "tally_params": { + "quorum": "0.334000000000000000", + "threshold": "0.500000000000000000", + "veto_threshold": "0.334000000000000000" + } + }, + "hubgenesis": { + "params": {}, + "genesis_accounts": [] + }, + "hubs": { + "state": { + "hub": { + "registered_denoms": [] + } + } + }, + "ibc": { + "client_genesis": { + "clients": [], + "clients_consensus": [], + "clients_metadata": [], + "params": { + "allowed_clients": [ + "06-solomachine", + "07-tendermint" + ] + }, + "create_localhost": false, + "next_client_sequence": "0" + }, + "connection_genesis": { + "connections": [], + "client_connection_paths": [], + "next_connection_sequence": "0", + "params": { + "max_expected_time_per_block": "30000000000" + } + }, + "channel_genesis": { + "channels": [], + "acknowledgements": [], + "commitments": [], + "receipts": [], + "send_sequences": [], + "recv_sequences": [], + "ack_sequences": [], + "next_channel_sequence": "0" + } + }, + "mint": { + "minter": { + "current_inflation_rate": "0.080000000000000000" + }, + "params": { + "mint_denom": "stake", + "mint_epoch_identifier": "hour", + "mint_start_epoch": "1", + "inflation_change_epoch_identifier": "year", + "inflation_rate_change": "0.010000000000000000", + "target_inflation_rate": "0.020000000000000000" + } + }, + "params": null, + "rollappparams": { + "params": { + "da": "celestia", + "drs_version": 3, + "min_gas_prices": [] + } + }, + "sequencers": { + "params": { + "unbonding_time": "1814400s", + "historical_entries": 10000 + }, + "sequencers": [] + }, + "staking": { + "params": { + "unbonding_time": "1814400s", + "max_validators": 100, + "max_entries": 7, + "historical_entries": 10000, + "bond_denom": "stake", + "min_commission_rate": "0.050000000000000000" + }, + "last_total_power": "0", + "last_validator_powers": [], + "validators": [], + "delegations": [], + "unbonding_delegations": [], + "redelegations": [], + "exported": false + }, + "timeupgrade": null, + "transfer": { + "port_id": "transfer", + "denom_traces": [], + "params": { + "send_enabled": true, + "receive_enabled": true + } + }, + "upgrade": {}, + "vesting": {} + } +} diff --git a/genesis-templates/DRS/3/genesis-testnet.json b/genesis-templates/DRS/3/genesis-testnet.json new file mode 100644 index 0000000..a4e48c5 --- /dev/null +++ b/genesis-templates/DRS/3/genesis-testnet.json @@ -0,0 +1,303 @@ +{ + "genesis_time": "2024-12-16T14:07:20.919264Z", + "chain_id": "rollappevm_1234-1", + "initial_height": "1", + "consensus_params": { + "block": { + "max_bytes": "500000", + "max_gas": "400000000", + "time_iota_ms": "1000" + }, + "evidence": { + "max_age_num_blocks": "100000", + "max_age_duration": "172800000000000", + "max_bytes": "500000" + }, + "validator": { + "pub_key_types": [ + "ed25519" + ] + }, + "version": {} + }, + "app_hash": "", + "app_state": { + "auth": { + "params": { + "max_memo_characters": "256", + "tx_sig_limit": "7", + "tx_size_cost_per_byte": "10", + "sig_verify_cost_ed25519": "590", + "sig_verify_cost_secp256k1": "1000" + }, + "accounts": [] + }, + "authz": { + "authorization": [] + }, + "bank": { + "params": { + "send_enabled": [], + "default_send_enabled": true + }, + "balances": [], + "supply": [], + "denom_metadata": [] + }, + "capability": { + "index": "1", + "owners": [] + }, + "distribution": { + "params": { + "community_tax": "0.00002", + "base_proposer_reward": "0.8", + "bonus_proposer_reward": "0.000000000000000000", + "withdraw_addr_enabled": true + }, + "fee_pool": { + "community_pool": [] + }, + "delegator_withdraw_infos": [], + "previous_proposer": "", + "outstanding_rewards": [], + "validator_accumulated_commissions": [], + "validator_historical_rewards": [], + "validator_current_rewards": [], + "delegator_starting_infos": [], + "validator_slash_events": [] + }, + "epochs": { + "epochs": [ + { + "identifier": "minute", + "start_time": "0001-01-01T00:00:00Z", + "duration": "60s", + "current_epoch": "0", + "current_epoch_start_time": "0001-01-01T00:00:00Z", + "epoch_counting_started": false, + "current_epoch_start_height": "0" + }, + { + "identifier": "hour", + "start_time": "0001-01-01T00:00:00Z", + "duration": "3600s", + "current_epoch": "0", + "current_epoch_start_time": "0001-01-01T00:00:00Z", + "epoch_counting_started": false, + "current_epoch_start_height": "0" + }, + { + "identifier": "day", + "start_time": "0001-01-01T00:00:00Z", + "duration": "86400s", + "current_epoch": "0", + "current_epoch_start_time": "0001-01-01T00:00:00Z", + "epoch_counting_started": false, + "current_epoch_start_height": "0" + }, + { + "identifier": "week", + "start_time": "0001-01-01T00:00:00Z", + "duration": "604800s", + "current_epoch": "0", + "current_epoch_start_time": "0001-01-01T00:00:00Z", + "epoch_counting_started": false, + "current_epoch_start_height": "0" + }, + { + "identifier": "year", + "start_time": "0001-01-01T00:00:00Z", + "duration": "31536000s", + "current_epoch": "0", + "current_epoch_start_time": "0001-01-01T00:00:00Z", + "epoch_counting_started": false, + "current_epoch_start_height": "0" + } + ] + }, + "erc20": { + "params": { + "enable_erc20": true, + "enable_evm_hook": true, + "registration_fee": "10000000000000000000" + }, + "token_pairs": [] + }, + "evm": { + "accounts": [], + "params": { + "evm_denom": "aevmos", + "enable_create": true, + "enable_call": true, + "extra_eips": [ + "3855" + ], + "chain_config": { + "homestead_block": "0", + "dao_fork_block": "0", + "dao_fork_support": true, + "eip150_block": "0", + "eip150_hash": "0x0000000000000000000000000000000000000000000000000000000000000000", + "eip155_block": "0", + "eip158_block": "0", + "byzantium_block": "0", + "constantinople_block": "0", + "petersburg_block": "0", + "istanbul_block": "0", + "muir_glacier_block": "0", + "berlin_block": "0", + "london_block": "0", + "arrow_glacier_block": "0", + "gray_glacier_block": "0", + "merge_netsplit_block": "0", + "shanghai_block": "0", + "cancun_block": "0" + }, + "allow_unprotected_txs": false, + "gas_denom": "aevmos" + } + }, + "feegrant": { + "allowances": [] + }, + "feemarket": { + "params": { + "no_base_fee": false, + "base_fee_change_denominator": 8, + "elasticity_multiplier": 2, + "enable_height": "0", + "base_fee": "1000000000", + "min_gas_price": "20000000000.000000000000000000", + "min_gas_multiplier": "0.500000000000000000" + }, + "block_gas": "0" + }, + "genutil": { + "gen_txs": [] + }, + "gov": { + "starting_proposal_id": "1", + "deposits": [], + "votes": [], + "proposals": [], + "deposit_params": { + "min_deposit": [ + { + "denom": "stake", + "amount": "1000000000000000000000" + } + ], + "max_deposit_period": "172800s" + }, + "voting_params": { + "voting_period": "300s" + }, + "tally_params": { + "quorum": "0.334000000000000000", + "threshold": "0.500000000000000000", + "veto_threshold": "0.334000000000000000" + } + }, + "hubgenesis": { + "params": {}, + "genesis_accounts": [] + }, + "hubs": { + "state": { + "hub": { + "registered_denoms": [] + } + } + }, + "ibc": { + "client_genesis": { + "clients": [], + "clients_consensus": [], + "clients_metadata": [], + "params": { + "allowed_clients": [ + "06-solomachine", + "07-tendermint" + ] + }, + "create_localhost": false, + "next_client_sequence": "0" + }, + "connection_genesis": { + "connections": [], + "client_connection_paths": [], + "next_connection_sequence": "0", + "params": { + "max_expected_time_per_block": "30000000000" + } + }, + "channel_genesis": { + "channels": [], + "acknowledgements": [], + "commitments": [], + "receipts": [], + "send_sequences": [], + "recv_sequences": [], + "ack_sequences": [], + "next_channel_sequence": "0" + } + }, + "mint": { + "minter": { + "current_inflation_rate": "0.080000000000000000" + }, + "params": { + "mint_denom": "stake", + "mint_epoch_identifier": "hour", + "mint_start_epoch": "1", + "inflation_change_epoch_identifier": "year", + "inflation_rate_change": "0.010000000000000000", + "target_inflation_rate": "0.020000000000000000" + } + }, + "params": null, + "rollappparams": { + "params": { + "da": "celestia", + "drs_version": 3, + "min_gas_prices": [] + } + }, + "sequencers": { + "params": { + "unbonding_time": "1309600s", + "historical_entries": 10000 + }, + "sequencers": [] + }, + "staking": { + "params": { + "unbonding_time": "1309600s", + "max_validators": 100, + "max_entries": 7, + "historical_entries": 10000, + "bond_denom": "stake", + "min_commission_rate": "0.050000000000000000" + }, + "last_total_power": "0", + "last_validator_powers": [], + "validators": [], + "delegations": [], + "unbonding_delegations": [], + "redelegations": [], + "exported": false + }, + "timeupgrade": null, + "transfer": { + "port_id": "transfer", + "denom_traces": [], + "params": { + "send_enabled": true, + "receive_enabled": true + } + }, + "upgrade": {}, + "vesting": {} + } +} diff --git a/genesis-templates/DRS/4/genesis-mainnet.json b/genesis-templates/DRS/4/genesis-mainnet.json new file mode 100644 index 0000000..bb32116 --- /dev/null +++ b/genesis-templates/DRS/4/genesis-mainnet.json @@ -0,0 +1,303 @@ +{ + "genesis_time": "2024-12-20T17:33:08.407378Z", + "chain_id": "rollappevm_1234-1", + "initial_height": "1", + "consensus_params": { + "block": { + "max_bytes": "500000", + "max_gas": "400000000", + "time_iota_ms": "1000" + }, + "evidence": { + "max_age_num_blocks": "100000", + "max_age_duration": "172800000000000", + "max_bytes": "500000" + }, + "validator": { + "pub_key_types": [ + "ed25519" + ] + }, + "version": {} + }, + "app_hash": "", + "app_state": { + "auth": { + "params": { + "max_memo_characters": "256", + "tx_sig_limit": "7", + "tx_size_cost_per_byte": "10", + "sig_verify_cost_ed25519": "590", + "sig_verify_cost_secp256k1": "1000" + }, + "accounts": [] + }, + "authz": { + "authorization": [] + }, + "bank": { + "params": { + "send_enabled": [], + "default_send_enabled": true + }, + "balances": [], + "supply": [], + "denom_metadata": [] + }, + "capability": { + "index": "1", + "owners": [] + }, + "distribution": { + "params": { + "community_tax": "0.00002", + "base_proposer_reward": "0.8", + "bonus_proposer_reward": "0.000000000000000000", + "withdraw_addr_enabled": true + }, + "fee_pool": { + "community_pool": [] + }, + "delegator_withdraw_infos": [], + "previous_proposer": "", + "outstanding_rewards": [], + "validator_accumulated_commissions": [], + "validator_historical_rewards": [], + "validator_current_rewards": [], + "delegator_starting_infos": [], + "validator_slash_events": [] + }, + "epochs": { + "epochs": [ + { + "identifier": "minute", + "start_time": "0001-01-01T00:00:00Z", + "duration": "60s", + "current_epoch": "0", + "current_epoch_start_time": "0001-01-01T00:00:00Z", + "epoch_counting_started": false, + "current_epoch_start_height": "0" + }, + { + "identifier": "hour", + "start_time": "0001-01-01T00:00:00Z", + "duration": "3600s", + "current_epoch": "0", + "current_epoch_start_time": "0001-01-01T00:00:00Z", + "epoch_counting_started": false, + "current_epoch_start_height": "0" + }, + { + "identifier": "day", + "start_time": "0001-01-01T00:00:00Z", + "duration": "86400s", + "current_epoch": "0", + "current_epoch_start_time": "0001-01-01T00:00:00Z", + "epoch_counting_started": false, + "current_epoch_start_height": "0" + }, + { + "identifier": "week", + "start_time": "0001-01-01T00:00:00Z", + "duration": "604800s", + "current_epoch": "0", + "current_epoch_start_time": "0001-01-01T00:00:00Z", + "epoch_counting_started": false, + "current_epoch_start_height": "0" + }, + { + "identifier": "year", + "start_time": "0001-01-01T00:00:00Z", + "duration": "31536000s", + "current_epoch": "0", + "current_epoch_start_time": "0001-01-01T00:00:00Z", + "epoch_counting_started": false, + "current_epoch_start_height": "0" + } + ] + }, + "erc20": { + "params": { + "enable_erc20": true, + "enable_evm_hook": true, + "registration_fee": "10000000000000000000" + }, + "token_pairs": [] + }, + "evm": { + "accounts": [], + "params": { + "evm_denom": "aevmos", + "enable_create": true, + "enable_call": true, + "extra_eips": [ + "3855" + ], + "chain_config": { + "homestead_block": "0", + "dao_fork_block": "0", + "dao_fork_support": true, + "eip150_block": "0", + "eip150_hash": "0x0000000000000000000000000000000000000000000000000000000000000000", + "eip155_block": "0", + "eip158_block": "0", + "byzantium_block": "0", + "constantinople_block": "0", + "petersburg_block": "0", + "istanbul_block": "0", + "muir_glacier_block": "0", + "berlin_block": "0", + "london_block": "0", + "arrow_glacier_block": "0", + "gray_glacier_block": "0", + "merge_netsplit_block": "0", + "shanghai_block": "0", + "cancun_block": "0" + }, + "allow_unprotected_txs": false, + "gas_denom": "aevmos" + } + }, + "feegrant": { + "allowances": [] + }, + "feemarket": { + "params": { + "no_base_fee": false, + "base_fee_change_denominator": 8, + "elasticity_multiplier": 2, + "enable_height": "0", + "base_fee": "1000000000", + "min_gas_price": "20000000000.000000000000000000", + "min_gas_multiplier": "0.500000000000000000" + }, + "block_gas": "0" + }, + "genutil": { + "gen_txs": [] + }, + "gov": { + "starting_proposal_id": "1", + "deposits": [], + "votes": [], + "proposals": [], + "deposit_params": { + "min_deposit": [ + { + "denom": "stake", + "amount": "1000000000000000000000" + } + ], + "max_deposit_period": "172800s" + }, + "voting_params": { + "voting_period": "432000s" + }, + "tally_params": { + "quorum": "0.334000000000000000", + "threshold": "0.500000000000000000", + "veto_threshold": "0.334000000000000000" + } + }, + "hubgenesis": { + "params": {}, + "genesis_accounts": [] + }, + "hubs": { + "state": { + "hub": { + "registered_denoms": [] + } + } + }, + "ibc": { + "client_genesis": { + "clients": [], + "clients_consensus": [], + "clients_metadata": [], + "params": { + "allowed_clients": [ + "06-solomachine", + "07-tendermint" + ] + }, + "create_localhost": false, + "next_client_sequence": "0" + }, + "connection_genesis": { + "connections": [], + "client_connection_paths": [], + "next_connection_sequence": "0", + "params": { + "max_expected_time_per_block": "30000000000" + } + }, + "channel_genesis": { + "channels": [], + "acknowledgements": [], + "commitments": [], + "receipts": [], + "send_sequences": [], + "recv_sequences": [], + "ack_sequences": [], + "next_channel_sequence": "0" + } + }, + "mint": { + "minter": { + "current_inflation_rate": "0.080000000000000000" + }, + "params": { + "mint_denom": "stake", + "mint_epoch_identifier": "hour", + "mint_start_epoch": "1", + "inflation_change_epoch_identifier": "year", + "inflation_rate_change": "0.010000000000000000", + "target_inflation_rate": "0.020000000000000000" + } + }, + "params": null, + "rollappparams": { + "params": { + "da": "celestia", + "drs_version": 4, + "min_gas_prices": [] + } + }, + "sequencers": { + "params": { + "unbonding_time": "1814400s", + "historical_entries": 10000 + }, + "sequencers": [] + }, + "staking": { + "params": { + "unbonding_time": "1814400s", + "max_validators": 100, + "max_entries": 7, + "historical_entries": 10000, + "bond_denom": "stake", + "min_commission_rate": "0.050000000000000000" + }, + "last_total_power": "0", + "last_validator_powers": [], + "validators": [], + "delegations": [], + "unbonding_delegations": [], + "redelegations": [], + "exported": false + }, + "timeupgrade": null, + "transfer": { + "port_id": "transfer", + "denom_traces": [], + "params": { + "send_enabled": true, + "receive_enabled": true + } + }, + "upgrade": {}, + "vesting": {} + } +} diff --git a/genesis-templates/DRS/4/genesis-testnet.json b/genesis-templates/DRS/4/genesis-testnet.json new file mode 100644 index 0000000..92d2575 --- /dev/null +++ b/genesis-templates/DRS/4/genesis-testnet.json @@ -0,0 +1,303 @@ +{ + "genesis_time": "2024-12-20T17:32:31.680919Z", + "chain_id": "rollappevm_1234-1", + "initial_height": "1", + "consensus_params": { + "block": { + "max_bytes": "500000", + "max_gas": "400000000", + "time_iota_ms": "1000" + }, + "evidence": { + "max_age_num_blocks": "100000", + "max_age_duration": "172800000000000", + "max_bytes": "500000" + }, + "validator": { + "pub_key_types": [ + "ed25519" + ] + }, + "version": {} + }, + "app_hash": "", + "app_state": { + "auth": { + "params": { + "max_memo_characters": "256", + "tx_sig_limit": "7", + "tx_size_cost_per_byte": "10", + "sig_verify_cost_ed25519": "590", + "sig_verify_cost_secp256k1": "1000" + }, + "accounts": [] + }, + "authz": { + "authorization": [] + }, + "bank": { + "params": { + "send_enabled": [], + "default_send_enabled": true + }, + "balances": [], + "supply": [], + "denom_metadata": [] + }, + "capability": { + "index": "1", + "owners": [] + }, + "distribution": { + "params": { + "community_tax": "0.00002", + "base_proposer_reward": "0.8", + "bonus_proposer_reward": "0.000000000000000000", + "withdraw_addr_enabled": true + }, + "fee_pool": { + "community_pool": [] + }, + "delegator_withdraw_infos": [], + "previous_proposer": "", + "outstanding_rewards": [], + "validator_accumulated_commissions": [], + "validator_historical_rewards": [], + "validator_current_rewards": [], + "delegator_starting_infos": [], + "validator_slash_events": [] + }, + "epochs": { + "epochs": [ + { + "identifier": "minute", + "start_time": "0001-01-01T00:00:00Z", + "duration": "60s", + "current_epoch": "0", + "current_epoch_start_time": "0001-01-01T00:00:00Z", + "epoch_counting_started": false, + "current_epoch_start_height": "0" + }, + { + "identifier": "hour", + "start_time": "0001-01-01T00:00:00Z", + "duration": "3600s", + "current_epoch": "0", + "current_epoch_start_time": "0001-01-01T00:00:00Z", + "epoch_counting_started": false, + "current_epoch_start_height": "0" + }, + { + "identifier": "day", + "start_time": "0001-01-01T00:00:00Z", + "duration": "86400s", + "current_epoch": "0", + "current_epoch_start_time": "0001-01-01T00:00:00Z", + "epoch_counting_started": false, + "current_epoch_start_height": "0" + }, + { + "identifier": "week", + "start_time": "0001-01-01T00:00:00Z", + "duration": "604800s", + "current_epoch": "0", + "current_epoch_start_time": "0001-01-01T00:00:00Z", + "epoch_counting_started": false, + "current_epoch_start_height": "0" + }, + { + "identifier": "year", + "start_time": "0001-01-01T00:00:00Z", + "duration": "31536000s", + "current_epoch": "0", + "current_epoch_start_time": "0001-01-01T00:00:00Z", + "epoch_counting_started": false, + "current_epoch_start_height": "0" + } + ] + }, + "erc20": { + "params": { + "enable_erc20": true, + "enable_evm_hook": true, + "registration_fee": "10000000000000000000" + }, + "token_pairs": [] + }, + "evm": { + "accounts": [], + "params": { + "evm_denom": "aevmos", + "enable_create": true, + "enable_call": true, + "extra_eips": [ + "3855" + ], + "chain_config": { + "homestead_block": "0", + "dao_fork_block": "0", + "dao_fork_support": true, + "eip150_block": "0", + "eip150_hash": "0x0000000000000000000000000000000000000000000000000000000000000000", + "eip155_block": "0", + "eip158_block": "0", + "byzantium_block": "0", + "constantinople_block": "0", + "petersburg_block": "0", + "istanbul_block": "0", + "muir_glacier_block": "0", + "berlin_block": "0", + "london_block": "0", + "arrow_glacier_block": "0", + "gray_glacier_block": "0", + "merge_netsplit_block": "0", + "shanghai_block": "0", + "cancun_block": "0" + }, + "allow_unprotected_txs": false, + "gas_denom": "aevmos" + } + }, + "feegrant": { + "allowances": [] + }, + "feemarket": { + "params": { + "no_base_fee": false, + "base_fee_change_denominator": 8, + "elasticity_multiplier": 2, + "enable_height": "0", + "base_fee": "1000000000", + "min_gas_price": "20000000000.000000000000000000", + "min_gas_multiplier": "0.500000000000000000" + }, + "block_gas": "0" + }, + "genutil": { + "gen_txs": [] + }, + "gov": { + "starting_proposal_id": "1", + "deposits": [], + "votes": [], + "proposals": [], + "deposit_params": { + "min_deposit": [ + { + "denom": "stake", + "amount": "1000000000000000000000" + } + ], + "max_deposit_period": "172800s" + }, + "voting_params": { + "voting_period": "300s" + }, + "tally_params": { + "quorum": "0.334000000000000000", + "threshold": "0.500000000000000000", + "veto_threshold": "0.334000000000000000" + } + }, + "hubgenesis": { + "params": {}, + "genesis_accounts": [] + }, + "hubs": { + "state": { + "hub": { + "registered_denoms": [] + } + } + }, + "ibc": { + "client_genesis": { + "clients": [], + "clients_consensus": [], + "clients_metadata": [], + "params": { + "allowed_clients": [ + "06-solomachine", + "07-tendermint" + ] + }, + "create_localhost": false, + "next_client_sequence": "0" + }, + "connection_genesis": { + "connections": [], + "client_connection_paths": [], + "next_connection_sequence": "0", + "params": { + "max_expected_time_per_block": "30000000000" + } + }, + "channel_genesis": { + "channels": [], + "acknowledgements": [], + "commitments": [], + "receipts": [], + "send_sequences": [], + "recv_sequences": [], + "ack_sequences": [], + "next_channel_sequence": "0" + } + }, + "mint": { + "minter": { + "current_inflation_rate": "0.080000000000000000" + }, + "params": { + "mint_denom": "stake", + "mint_epoch_identifier": "hour", + "mint_start_epoch": "1", + "inflation_change_epoch_identifier": "year", + "inflation_rate_change": "0.010000000000000000", + "target_inflation_rate": "0.020000000000000000" + } + }, + "params": null, + "rollappparams": { + "params": { + "da": "celestia", + "drs_version": 4, + "min_gas_prices": [] + } + }, + "sequencers": { + "params": { + "unbonding_time": "1309600s", + "historical_entries": 10000 + }, + "sequencers": [] + }, + "staking": { + "params": { + "unbonding_time": "1309600s", + "max_validators": 100, + "max_entries": 7, + "historical_entries": 10000, + "bond_denom": "stake", + "min_commission_rate": "0.050000000000000000" + }, + "last_total_power": "0", + "last_validator_powers": [], + "validators": [], + "delegations": [], + "unbonding_delegations": [], + "redelegations": [], + "exported": false + }, + "timeupgrade": null, + "transfer": { + "port_id": "transfer", + "denom_traces": [], + "params": { + "send_enabled": true, + "receive_enabled": true + } + }, + "upgrade": {}, + "vesting": {} + } +} diff --git a/go.mod b/go.mod index e25b8c4..3a8c65c 100644 --- a/go.mod +++ b/go.mod @@ -10,9 +10,8 @@ require ( github.com/bcdevtools/evm-block-explorer-rpc-cosmos v1.1.4 github.com/cosmos/cosmos-sdk v0.46.16 github.com/cosmos/ibc-go/v6 v6.2.1 - github.com/dymensionxyz/cosmosclient v0.4.2-beta.0.20241121093220-e0d7ad456fbd - github.com/dymensionxyz/dymension-rdk v1.6.1-0.20241202152140-ffec6e81a1ca - github.com/dymensionxyz/dymint v1.2.0-rc01.0.20241203150638-c0e39f93d729 + github.com/dymensionxyz/dymension-rdk v1.8.0-rc02 + github.com/dymensionxyz/dymint v1.3.0-rc03 github.com/ethereum/go-ethereum v1.12.0 github.com/evmos/evmos/v12 v12.1.6 github.com/gogo/protobuf v1.3.3 @@ -118,6 +117,7 @@ require ( github.com/dop251/goja v0.0.0-20230122112309-96b1610dd4f7 // indirect github.com/dustin/go-humanize v1.0.1 // indirect github.com/dvsekhvalnov/jose2go v1.5.0 // indirect + github.com/dymensionxyz/cosmosclient v0.4.2-beta.0.20241121093220-e0d7ad456fbd // indirect github.com/dymensionxyz/gerr-cosmos v1.0.0 // indirect github.com/dymensionxyz/sdk-utils v0.1.2-0.20240909101947-e1b483ada9c8 // indirect github.com/edsrzf/mmap-go v1.0.0 // indirect @@ -361,7 +361,7 @@ replace ( // Dymension Forks replace ( github.com/cosmos/cosmos-sdk => github.com/dymensionxyz/cosmos-sdk v0.46.17-0.20241128210616-e9dfe47b8c73 - github.com/evmos/evmos/v12 => github.com/dymensionxyz/evmos/v12 v12.1.6-dymension-v0.4.3 + github.com/evmos/evmos/v12 => github.com/dymensionxyz/evmos/v12 v12.1.6-dymension-v0.5.0-rc01 github.com/gorilla/rpc => github.com/dymensionxyz/rpc v1.3.1 github.com/osmosis-labs/osmosis/v15 => github.com/dymensionxyz/osmosis/v15 v15.2.0-dymension-v1.1.2 github.com/tendermint/tendermint => github.com/dymensionxyz/cometbft v0.34.29-0.20241128205759-2a9d5f015da5 diff --git a/go.sum b/go.sum index 50d631b..077b723 100644 --- a/go.sum +++ b/go.sum @@ -577,12 +577,12 @@ github.com/dymensionxyz/cosmos-sdk v0.46.17-0.20241128210616-e9dfe47b8c73 h1:A0O github.com/dymensionxyz/cosmos-sdk v0.46.17-0.20241128210616-e9dfe47b8c73/go.mod h1:VPUuzF+l+ekSGPV7VVB8m0OMQfwp3QdKWNZjvkU3A1U= github.com/dymensionxyz/cosmosclient v0.4.2-beta.0.20241121093220-e0d7ad456fbd h1:V89QyOFM84o9w0iFdctMU6So8SS/Xt32JWAXGqJduT0= github.com/dymensionxyz/cosmosclient v0.4.2-beta.0.20241121093220-e0d7ad456fbd/go.mod h1:3weqpVj/TqTFpC0LjEB3H+HZSpm7BrQ1QkEg1Ahy6KY= -github.com/dymensionxyz/dymension-rdk v1.6.1-0.20241202152140-ffec6e81a1ca h1:jW7rlPl/VdJTnm5Ie9aUsyFG3cwM0KdN+0LTV70/nN4= -github.com/dymensionxyz/dymension-rdk v1.6.1-0.20241202152140-ffec6e81a1ca/go.mod h1:AA0rq+4H+yn/Agnx5L8ermhhny3FYgCv6UW9DzK5vss= -github.com/dymensionxyz/dymint v1.2.0-rc01.0.20241203150638-c0e39f93d729 h1:2HtdhYN0DSqBQTcSeK9+QXBJz8CF7u1YrLu8odkCFSY= -github.com/dymensionxyz/dymint v1.2.0-rc01.0.20241203150638-c0e39f93d729/go.mod h1:C3VbfePK85aRCdA1iHzB2AYD+n1gKR9Pw+wm3wQUXvE= -github.com/dymensionxyz/evmos/v12 v12.1.6-dymension-v0.4.3 h1:jSnj5psbuEq5s5MhbwI26I5gKtlb9mi95pv8r0e9ybI= -github.com/dymensionxyz/evmos/v12 v12.1.6-dymension-v0.4.3/go.mod h1:CI6D89pkoiIm4BjoMFNnEaCLdKBEobLuwvhS0c1zh7Y= +github.com/dymensionxyz/dymension-rdk v1.8.0-rc02 h1:HLWcGucC0t325IsnTlgJDt0JuBqlfDLXFApj7JAvDjE= +github.com/dymensionxyz/dymension-rdk v1.8.0-rc02/go.mod h1:p9rl2xNsbubJcxGnTIVF9D8aKAM+oPkCVdQ6Z6PM2Tw= +github.com/dymensionxyz/dymint v1.3.0-rc03 h1:JRAGrLDMdM642lbcnIgRp3iuHhvLkq0z6LWKZlWLQyI= +github.com/dymensionxyz/dymint v1.3.0-rc03/go.mod h1:C3VbfePK85aRCdA1iHzB2AYD+n1gKR9Pw+wm3wQUXvE= +github.com/dymensionxyz/evmos/v12 v12.1.6-dymension-v0.5.0-rc01 h1:+Hqi+7/ZA7jupjs14XEVAKDpYbnLPUL+Gi5FrJq3D6A= +github.com/dymensionxyz/evmos/v12 v12.1.6-dymension-v0.5.0-rc01/go.mod h1:CI6D89pkoiIm4BjoMFNnEaCLdKBEobLuwvhS0c1zh7Y= github.com/dymensionxyz/gerr-cosmos v1.0.0 h1:oi91rgOkpJWr41oX9JOyjvvBnhGY54tj513x8VlDAEc= github.com/dymensionxyz/gerr-cosmos v1.0.0/go.mod h1:n+0olxPogzWqFKba45mCpvrHLGmeS8W9UZjggHnWk6c= github.com/dymensionxyz/rpc v1.3.1 h1:7EXWIobaBes5zldRvTIg7TmNsEKjicrWA/OjCc0NaGs= diff --git a/scripts/generate-genesis-template.sh b/scripts/generate-genesis-template.sh new file mode 100755 index 0000000..2777576 --- /dev/null +++ b/scripts/generate-genesis-template.sh @@ -0,0 +1,111 @@ +#!/bin/bash +set -x + +# Get environment parameter +if [ $# -lt 2 ]; then + echo "Error: Both Environment (mainnet/testnet) and DRS parameters are required" + exit 1 +fi + +ENVIRONMENT=$1 +DRS=$2 + +if [ "$ENVIRONMENT" != "mainnet" ] && [ "$ENVIRONMENT" != "testnet" ]; then + echo "Error: Environment must be either 'mainnet' or 'testnet'" + exit 1 +fi + +if [ "$GENESIS_FILE" = "" ]; then + DEFAULT_GENESIS_FILE_PATH="${HOME}/.rollapp_evm/config/genesis.json" + echo "GENESIS_FILE is not set, using default: ${DEFAULT_GENESIS_FILE_PATH}" + export GENESIS_FILE=$DEFAULT_GENESIS_FILE_PATH +fi + +update_params() { + local success=true + + # Create temp directory and copy genesis file + TEMP_DIR=$(mktemp -d) + TEMP_GENESIS="${TEMP_DIR}/genesis_temp.json" + cp "$GENESIS_FILE" "$TEMP_GENESIS" + + BLOCK_SIZE="500000" + + # Update all dasel commands to use TEMP_GENESIS instead of GENESIS_FILE + dasel put -f "$TEMP_GENESIS" '.consensus_params.block.max_gas' -v "400000000" || success=false + dasel put -f "$TEMP_GENESIS" '.consensus_params.block.max_bytes' -v "$BLOCK_SIZE" || success=false + dasel put -f "$TEMP_GENESIS" '.consensus_params.evidence.max_bytes' -v "$BLOCK_SIZE" || success=false + dasel put -f "$TEMP_GENESIS" 'app_state.distribution.params.base_proposer_reward' -v '0.8' || success=false + dasel put -f "$TEMP_GENESIS" 'app_state.distribution.params.community_tax' -v "0.00002" || success=false + dasel put -t bool -f "$GENESIS_FILE" 'app_state.feemarket.params.no_base_fee' -v false || success=false + dasel put -f "$GENESIS_FILE" '.app_state.feemarket.params.min_gas_price' -v "1000000000.0" || success=false + dasel put -f "$GENESIS_FILE" '.app_state.auth.accounts' -t json -r json -v '[]' || success=false + dasel put -f "$GENESIS_FILE" '.app_state.bank.balances' -t json -r json -v '[]' || success=false + dasel put -f "$TEMP_GENESIS" 'app_state.rollappparams.params.drs_version' -v "$DRS" -t int || success=false + dasel put -f "$TEMP_GENESIS" 'app_state.rollappparams.params.da' -v "celestia" || success=false + + +# Update jq command to use temp file + if ! jq '.app_state.evm.params.extra_eips = ["3855"]' "$TEMP_GENESIS" > "${TEMP_DIR}/temp.json"; then + echo "Error updating JSON file" + success=false + else + mv "${TEMP_DIR}/temp.json" "$TEMP_GENESIS" + fi + + + # Update jq command to use temp file + if ! jq '.app_state.gov.deposit_params.min_deposit[0].amount = "1000000000000000000000"' "$TEMP_GENESIS" > "${TEMP_DIR}/temp.json"; then + echo "Error updating JSON file" + success=false + else + mv "${TEMP_DIR}/temp.json" "$TEMP_GENESIS" + fi + + # these vary depending on environment + if [ "$ENVIRONMENT" = "mainnet" ]; then + UNBONDING_TIME="1814400s" # 2 weeks + VOTING_PERIOD="432000s" # 5 days + else + UNBONDING_TIME="1309600s" # ~2 weeks + 1 day + VOTING_PERIOD="300s" + fi + + dasel put -f "$TEMP_GENESIS" '.app_state.sequencers.params.unbonding_time' -v "$UNBONDING_TIME" || success=false + dasel put -f "$TEMP_GENESIS" '.app_state.staking.params.unbonding_time' -v "$UNBONDING_TIME" || success=false + dasel put -f "$TEMP_GENESIS" 'app_state.gov.voting_params.voting_period' -v "$VOTING_PERIOD" || success=false + + if [ "$success" = false ]; then + echo "An error occurred." + rm -rf "$TEMP_DIR" + return 1 + fi + + # Create templates directory with DRS subdirectory if it doesn't exist + mkdir -p "./genesis-templates/DRS/${DRS}" + + # Copy the modified genesis file to the DRS-specific template location + cp "$TEMP_GENESIS" "./genesis-templates/DRS/${DRS}/genesis-${ENVIRONMENT}.json" + + # Cleanup temp directory + rm -rf "$TEMP_DIR" + + set +x +} + +update_params + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/scripts/init.sh b/scripts/init.sh index 6bfb3d8..4b367fd 100755 --- a/scripts/init.sh +++ b/scripts/init.sh @@ -66,6 +66,7 @@ set_denom() { dasel put -f "$GENESIS_FILE" '.app_state.staking.params.bond_denom' -v "$denom" || success=false dasel put -t string -f "$GENESIS_FILE" '.app_state.gov.deposit_params.min_deposit.[0].denom' -v "$denom" || success=false dasel put -f "$GENESIS_FILE" '.app_state.evm.params.evm_denom' -v "$denom" || success=false + dasel put -f "$GENESIS_FILE" '.app_state.evm.params.gas_denom' -v "$denom" || success=false dasel put -f "$GENESIS_FILE" '.app_state.claims.params.claims_denom' -v "$denom" || success=false if [ "$success" = false ]; then diff --git a/scripts/minimal_update_genesis_params.sh b/scripts/minimal_update_genesis_params.sh deleted file mode 100755 index 2033172..0000000 --- a/scripts/minimal_update_genesis_params.sh +++ /dev/null @@ -1,38 +0,0 @@ -#!/bin/bash - set -x -if [ "$GENESIS_FILE" = "" ]; then - DEFAULT_GENESIS_FILE_PATH="${HOME}/.rollapp_evm/config/genesis.json" - echo "GENESIS_FILE is not set, using default: ${DEFAULT_GENESIS_FILE_PATH}" - export GENESIS_FILE=$DEFAULT_GENESIS_FILE_PATH -fi - -update_params() { - local success=true - - BLOCK_SIZE="500000" - - dasel put -f "$GENESIS_FILE" '.consensus_params.block.max_gas' -v "400000000" || success=false - dasel put -f "$GENESIS_FILE" '.consensus_params.block.max_bytes' -v "$BLOCK_SIZE" || success=false - dasel put -f "$GENESIS_FILE" '.consensus_params.evidence.max_bytes' -v "$BLOCK_SIZE" || success=false - dasel put -t bool -f "$GENESIS_FILE" 'app_state.feemarket.params.no_base_fee' -v false || success=false - dasel put -f "$GENESIS_FILE" '.app_state.evm.params.extra_eips.[]' -v '3855' || success=false - dasel put -f "$GENESIS_FILE" '.app_state.feemarket.params.min_gas_price' -v "10000000.0" || success=false - dasel put -f "$GENESIS_FILE" '.app_state.distribution.params.base_proposer_reward' -v '0.8' || success=false - dasel put -f "$GENESIS_FILE" '.app_state.distribution.params.community_tax' -v "0.00002" || success=false - dasel put -f "$GENESIS_FILE" '.app_state.auth.accounts' -t json -r json -v '[]' || success=false # 2 weeks - dasel put -f "$GENESIS_FILE" '.app_state.bank.balances' -t json -r json -v '[]' || success=false # 2 weeks - dasel put -f "$GENESIS_FILE" '.app_state.genutil.gen_txs' -t json -r json -v '[]' || success=false # 2 weeks - - # these vary depending on environment - dasel put -f "$GENESIS_FILE" '.app_state.gov.voting_params.voting_period' -v "300s" || success=false - dasel put -f "$GENESIS_FILE" '.app_state.sequencers.params.unbonding_time' -v "1209600s" || success=false # 2 weeks - dasel put -f "$GENESIS_FILE" '.app_state.staking.params.unbonding_time' -v "1209600s" || success=false # 2 weeks - - if [ "$success" = false ]; then - echo "An error occurred." - return 1 - fi - set +x -} - -update_params