Skip to content

Commit

Permalink
feat(sequencers): wire sequencer rewards functionality (#316)
Browse files Browse the repository at this point in the history
  • Loading branch information
omritoptix authored Aug 25, 2024
1 parent 06f6258 commit 646dfab
Show file tree
Hide file tree
Showing 5 changed files with 27 additions and 9 deletions.
22 changes: 21 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -175,7 +175,27 @@ sh scripts/add_vesting_accounts_to_genesis_file.sh
### Run rollapp locally

```shell
$EXECUTABLE start --log_level=debug
$EXECUTABLE start --log_level=debug
```

## Set Sequencer reward address (optional)

```shell
# Add a new key for the reward address
$EXECUTABLE keys add reward
REWARD=$($EXECUTABLE keys show reward -a)

# This assumes mock default sequencer consensus key location. for different location, update the path.
KEY="${ROLLAPP_HOME_DIR}/config/priv_validator_key.json"

# set the kerying backend to test
$EXECUTABLE config keyring-backend test

# Import the consensus key into the rollapp keyring
$EXECUTABLE tx sequencer unsafe-import-cons-key sequencerConsensusKey $KEY

# Update the sequencer reward address
$EXECUTABLE tx sequencer create-sequencer sequencerConsensusKey --from $KEY_NAME_ROLLAPP --fees 20000000000000$BASE_DENOM --reward-addr $REWARD --keyring-backend test -y
```

## Setup IBC between rollapp and local dymension hub node
Expand Down
4 changes: 3 additions & 1 deletion app/app.go
Original file line number Diff line number Diff line change
Expand Up @@ -849,7 +849,9 @@ func (app *App) InitChainer(ctx sdk.Context, req abci.RequestInitChain) abci.Res
if len(req.Validators) == 0 {
panic("Dymint have no sequencers defined on InitChain")
}
app.SequencersKeeper.SetDymintSequencers(ctx, req.Validators)

// Passing the dymint sequencers to the sequencer module from RequestInitChain
app.SequencersKeeper.MustSetDymintValidatorUpdates(ctx, req.Validators)

app.UpgradeKeeper.SetModuleVersionMap(ctx, app.mm.GetVersionMap())
res := app.mm.InitGenesis(ctx, app.appCodec, genesisState)
Expand Down
2 changes: 1 addition & 1 deletion go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ 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/dymension-rdk v1.6.1-0.20240729074116-005f2bb6dd18
github.com/dymensionxyz/dymension-rdk v1.6.1-0.20240825105050-28628bcb329a
github.com/dymensionxyz/dymint v1.2.0-rc01.0.20240822065420-88ba1fee3735
github.com/ethereum/go-ethereum v1.12.0
github.com/evmos/evmos/v12 v12.1.6
Expand Down
4 changes: 2 additions & 2 deletions go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -559,8 +559,8 @@ github.com/dvsekhvalnov/jose2go v1.5.0 h1:3j8ya4Z4kMCwT5nXIKFSV84YS+HdqSSO0VsTQx
github.com/dvsekhvalnov/jose2go v1.5.0/go.mod h1:QsHjhyTlD/lAVqn/NSbVZmSCGeDehTB/mPZadG+mhXU=
github.com/dymensionxyz/cosmosclient v0.4.2-beta.0.20240821081230-b4018b2bac13 h1:u5yeve5jZR6TdRjjR+vYT/8PWKbhwCZxUmAu+/Tnxyg=
github.com/dymensionxyz/cosmosclient v0.4.2-beta.0.20240821081230-b4018b2bac13/go.mod h1:jabDQYXrccscSE0fXkh7eQFYPWJCRiuWKonFGObVq6s=
github.com/dymensionxyz/dymension-rdk v1.6.1-0.20240729074116-005f2bb6dd18 h1:LAcB7zrQ4S8A4d/j6Hk3mS/1Rq1IPSSyQPejB4KGeHc=
github.com/dymensionxyz/dymension-rdk v1.6.1-0.20240729074116-005f2bb6dd18/go.mod h1:M7YD1jsbAUYlnpfE0cj0MP0esKI3J6NsrVFAit+Rx+8=
github.com/dymensionxyz/dymension-rdk v1.6.1-0.20240825105050-28628bcb329a h1:/ne4Kco52xXYWSqLke400PGzE/wMJ+9zuGPQ1h35MMU=
github.com/dymensionxyz/dymension-rdk v1.6.1-0.20240825105050-28628bcb329a/go.mod h1:Hj1zPMvJ8blfvOzEwI8pbekTb8bidYbx3EdNjMeK/Aw=
github.com/dymensionxyz/dymension/v3 v3.1.0-rc03.0.20240411195658-f7cd96f53b56 h1:cmpJYdRviuUfmlJdHrcAND8Jd6JIY4rp63bWAQzPr54=
github.com/dymensionxyz/dymension/v3 v3.1.0-rc03.0.20240411195658-f7cd96f53b56/go.mod h1:3Pfrr8j/BR9ztNKztGfC5PqDiO6CcrzMLCJtFtPEVW4=
github.com/dymensionxyz/dymint v1.2.0-rc01.0.20240822065420-88ba1fee3735 h1:hi2oVpQGpbEW5sgPHa/MAdwckAhlYFK9Tp/g36bc+F4=
Expand Down
4 changes: 0 additions & 4 deletions scripts/init.sh
Original file line number Diff line number Diff line change
Expand Up @@ -290,10 +290,6 @@ update_configuration
"$EXECUTABLE" keys add "$KEY_NAME_ROLLAPP" --keyring-backend test
"$EXECUTABLE" add-genesis-account "$KEY_NAME_ROLLAPP" "$TOTAL_SUPPLY$BASE_DENOM" --keyring-backend test

# Set sequencer's operator address
operator_address=$("$EXECUTABLE" keys show "$KEY_NAME_ROLLAPP" -a --keyring-backend test --bech val)
dasel put -f "$GENESIS_FILE" '.app_state.sequencers.genesis_operator_address' -v "$operator_address"

# Ask if to include a governor on genesis
echo "Do you want to include a governor on genesis? (Y/n) "
read -r answer
Expand Down

0 comments on commit 646dfab

Please sign in to comment.