diff --git a/config/config.go b/config/config.go index 132f6abcc..dd7abd59f 100644 --- a/config/config.go +++ b/config/config.go @@ -40,6 +40,7 @@ const ( flagSLGasLimit = "dymint.settlement_config.gas_limit" flagSLGasPrices = "dymint.settlement_config.gas_prices" flagSLGasFees = "dymint.settlement_config.gas_fees" + flagRollappID = "dymint.settlement_config.rollapp_id" ) // NodeConfig stores Dymint node configuration. @@ -132,6 +133,7 @@ func AddNodeFlags(cmd *cobra.Command) { cmd.Flags().String(flagSLGasFees, def.SettlementConfig.GasFees, "Settlement Layer gas fees") cmd.Flags().String(flagSLGasPrices, def.SettlementConfig.GasPrices, "Settlement Layer gas prices") cmd.Flags().Uint64(flagSLGasLimit, def.SettlementConfig.GasLimit, "Settlement Layer batch submit gas limit") + cmd.Flags().String(flagRollappID, def.SettlementConfig.RollappID, "The chainID of the rollapp") } func BindDymintFlags(cmd *cobra.Command, v *viper.Viper) error { @@ -186,6 +188,9 @@ func BindDymintFlags(cmd *cobra.Command, v *viper.Viper) error { if err := v.BindPFlag("gas_limit", cmd.Flags().Lookup(flagSLGasLimit)); err != nil { return err } + if err := v.BindPFlag("rollapp_id", cmd.Flags().Lookup(flagRollappID)); err != nil { + return err + } return nil } diff --git a/settlement/dymension/dymension.go b/settlement/dymension/dymension.go index 7f6f4b4ca..fb9c3b10f 100644 --- a/settlement/dymension/dymension.go +++ b/settlement/dymension/dymension.go @@ -6,6 +6,7 @@ import ( "strconv" "time" + "cosmossdk.io/errors" "github.com/avast/retry-go" "github.com/cosmos/cosmos-sdk/codec" cdctypes "github.com/cosmos/cosmos-sdk/codec/types" @@ -287,7 +288,7 @@ func (d *HubClient) GetBatchAtIndex(rollappID string, index uint64) (*settlement func (d *HubClient) GetSequencers(rollappID string) ([]*types.Sequencer, error) { sequencers, err := d.sequencerQueryClient.SequencersByRollapp(d.ctx, &sequencertypes.QueryGetSequencersByRollappRequest{RollappId: d.config.RollappID}) if err != nil { - return nil, settlement.ErrNoSequencerForRollapp + return nil, errors.Wrapf(settlement.ErrNoSequencerForRollapp, "rollappID: %s", rollappID) } sequencersList := []*types.Sequencer{} for _, sequencer := range sequencers.SequencerInfoList {