Skip to content

Commit

Permalink
Merge remote-tracking branch 'origin/main' into feat/include-token-fa…
Browse files Browse the repository at this point in the history
…ctory-module
Faulty Tolly committed Nov 25, 2024
2 parents dfbcd2f + 8df5b11 commit 0760db6
Showing 8 changed files with 53 additions and 15 deletions.
4 changes: 2 additions & 2 deletions Makefile
Original file line number Diff line number Diff line change
@@ -34,7 +34,7 @@ ldflags = -X github.com/cosmos/cosmos-sdk/version.Name=$(NAME) \
-X github.com/cosmos/cosmos-sdk/version.Commit=$(COMMIT) \
-X github.com/tendermint/tendermint/version.TMCoreSemVer=$(TM_VERSION) \
-X github.com/dymensionxyz/rollapp-wasm/app.AccountAddressPrefix=$(BECH32_PREFIX) \
-X github.com/dymensionxyz/dymint/version.DrsVersion=$(DRS_VERSION)
-X github.com/dymensionxyz/dymint/version.DRS=$(DRS_VERSION)
BUILD_FLAGS := -ldflags '$(ldflags)'


@@ -121,4 +121,4 @@ release:
ghcr.io/goreleaser/goreleaser-cross:${GOLANG_CROSS_VERSION} \
release --clean --skip=validate

.PHONY: release-dry-run release
.PHONY: release-dry-run release
14 changes: 10 additions & 4 deletions app/app.go
Original file line number Diff line number Diff line change
@@ -480,11 +480,19 @@ func NewRollapp(
),
)

app.RollappParamsKeeper = rollappparamskeeper.NewKeeper(
app.GetSubspace(rollappparamstypes.ModuleName),
)

app.SequencersKeeper = *seqkeeper.NewKeeper(
appCodec,
keys[seqtypes.StoreKey],
app.GetSubspace(seqtypes.ModuleName),
authtypes.NewModuleAddress(seqtypes.ModuleName).String(),
app.AccountKeeper,
app.RollappParamsKeeper,
app.UpgradeKeeper,
[]seqkeeper.AccountBumpFilterFunc{},
)

app.IBCKeeper = ibckeeper.NewKeeper(
@@ -658,10 +666,6 @@ func NewRollapp(
&app.WasmKeeper,
)

app.RollappParamsKeeper = rollappparamskeeper.NewKeeper(
app.GetSubspace(rollappparamstypes.ModuleName),
)

wasmStack := wasm.NewIBCHandler(app.WasmKeeper, app.IBCKeeper.ChannelKeeper, app.IBCKeeper.ChannelKeeper)

// Create static IBC router, add transfer route, then set and seal it
@@ -867,6 +871,8 @@ func NewRollapp(
// Admission handler for consensus messages
app.setAdmissionHandler(consensus.AllowedMessagesHandler([]string{
proto.MessageName(new(seqtypes.ConsensusMsgUpsertSequencer)),
proto.MessageName(new(seqtypes.MsgBumpAccountSequences)),
proto.MessageName(new(seqtypes.MsgUpgradeDRS)),
}))

if loadLatest {
1 change: 1 addition & 0 deletions app/test_helpers.go
Original file line number Diff line number Diff line change
@@ -124,6 +124,7 @@ func SetupWithGenesisValSet(t *testing.T, valSet *types2.ValidatorSet, genAccs [
ConsensusParams: utils.DefaultConsensusParams,
AppStateBytes: stateBytes,
ChainId: TestChainID,
GenesisChecksum: "notwmpty",
},
)

5 changes: 3 additions & 2 deletions e2e/testing/chain.go
Original file line number Diff line number Diff line change
@@ -276,8 +276,9 @@ func NewTestChain(t *testing.T, chainIdx int, opts ...interface{}) *TestChain {
Validators: []abci.ValidatorUpdate{
{PubKey: pk, Power: 1},
},
AppStateBytes: genStateBytes,
InitialHeight: 0,
AppStateBytes: genStateBytes,
InitialHeight: 0,
GenesisChecksum: "notempty",
},
)

8 changes: 5 additions & 3 deletions go.mod
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
module github.com/dymensionxyz/rollapp-wasm

go 1.22.4
go 1.23.1

toolchain go1.23.3

require (
cosmossdk.io/collections v0.4.0
@@ -15,8 +17,8 @@ require (
github.com/cosmos/gogoproto v1.5.0
github.com/cosmos/ibc-go/v6 v6.3.0
github.com/dvsekhvalnov/jose2go v1.5.0
github.com/dymensionxyz/dymension-rdk v1.6.1-0.20241104174622-ef99c12f13b4
github.com/dymensionxyz/dymint v1.2.0-rc01.0.20241104173413-6ae1dc10f0bf
github.com/dymensionxyz/dymension-rdk v1.6.1-0.20241119103059-def6322e4345
github.com/dymensionxyz/dymint v1.2.0-rc01.0.20241119130703-a5453ad86b4c
github.com/ethereum/go-ethereum v1.12.0
github.com/evmos/evmos/v12 v12.1.6
github.com/gogo/protobuf v1.3.3
8 changes: 4 additions & 4 deletions go.sum
Original file line number Diff line number Diff line change
@@ -573,10 +573,10 @@ github.com/dymensionxyz/cometbft v0.34.29-0.20241104165035-feade34f8f89 h1:rGkCc
github.com/dymensionxyz/cometbft v0.34.29-0.20241104165035-feade34f8f89/go.mod h1:L9shMfbkZ8B+7JlwANEr+NZbBcn+hBpwdbeYvA5rLCw=
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.20241104174622-ef99c12f13b4 h1:3R7XqM0Hstb9GxZtuijarVSXTEDu24ywlyFUCjCT9sQ=
github.com/dymensionxyz/dymension-rdk v1.6.1-0.20241104174622-ef99c12f13b4/go.mod h1:y89w1OG4C4aF7yyW8bv9PwV3o1KkCx1hyt34ap04Rnk=
github.com/dymensionxyz/dymint v1.2.0-rc01.0.20241104173413-6ae1dc10f0bf h1:2ChqhjDO12ggf4Xh7dovYamrJlF3eyGIh3co0PAMsVk=
github.com/dymensionxyz/dymint v1.2.0-rc01.0.20241104173413-6ae1dc10f0bf/go.mod h1:Qc4FqIlTdIUROQIS0mkIWF5wA6C4AM6znoDKzkHJ5EY=
github.com/dymensionxyz/dymension-rdk v1.6.1-0.20241119103059-def6322e4345 h1:FcHidPgGEHh9ELwodNJkGcHqsG+mdPiGdughzG4W+X8=
github.com/dymensionxyz/dymension-rdk v1.6.1-0.20241119103059-def6322e4345/go.mod h1:y89w1OG4C4aF7yyW8bv9PwV3o1KkCx1hyt34ap04Rnk=
github.com/dymensionxyz/dymint v1.2.0-rc01.0.20241119130703-a5453ad86b4c h1:dZpHHZMssXklHO18XhzD/fj1QZjSnw1Wo3DOo24/dwE=
github.com/dymensionxyz/dymint v1.2.0-rc01.0.20241119130703-a5453ad86b4c/go.mod h1:ui7okdD4GRAySphS7XNOlbJKXIA2TAH/Wu6S8KV3o0M=
github.com/dymensionxyz/evmos/v12 v12.1.6-dymension-v0.4.2 h1:aVP3off7u2vsvRH7lHAUPTLdf9/AfnzC/rvvi0wC/co=
github.com/dymensionxyz/evmos/v12 v12.1.6-dymension-v0.4.2/go.mod h1:CI6D89pkoiIm4BjoMFNnEaCLdKBEobLuwvhS0c1zh7Y=
github.com/dymensionxyz/gerr-cosmos v1.0.0 h1:oi91rgOkpJWr41oX9JOyjvvBnhGY54tj513x8VlDAEc=
12 changes: 12 additions & 0 deletions scripts/ibc/setup_ibc.sh
Original file line number Diff line number Diff line change
@@ -103,6 +103,7 @@ rly keys add "$ROLLAPP_CHAIN_ID" "$RELAYER_KEY_FOR_ROLLAPP"
rly keys add "$SETTLEMENT_CHAIN_ID" "$RELAYER_KEY_FOR_HUB"

RLY_HUB_ADDR=$(rly keys show "$SETTLEMENT_CHAIN_ID")
RLY_ROLLAPP_ADDR=$(rly keys show "$ROLLAPP_CHAIN_ID")

echo '--------------------------------- Funding rly account on hub ['"$RLY_HUB_ADDR"']... --------------------------------'
DYM_BALANCE=$("$SETTLEMENT_EXECUTABLE" q bank balances "$RLY_HUB_ADDR" -o json | jq -r '.balances[0].amount')
@@ -113,13 +114,24 @@ else
"$SETTLEMENT_EXECUTABLE" tx bank send "$SETTLEMENT_KEY_NAME_GENESIS" "$RLY_HUB_ADDR" 100dym --keyring-backend test --fees 1dym --node "$SETTLEMENT_RPC_FOR_RELAYER" -y || exit 1
fi

echo '--------------------------------- Funding rly account on rollapp ['"$RLY_ROLLAPP_ADDR"']... --------------------------------'
ROLLAPP_BALANCE=$("$EXECUTABLE" q bank balances "$RLY_ROLLAPP_ADDR" -o json | jq -r '.balances[0].amount')

if [ "$(echo "$ROLLAPP_BALANCE >= 100000000000000000000" | bc)" -eq 1 ]; then
echo "${RLY_ROLLAPP_ADDR} already funded"
else
"$EXECUTABLE" tx bank send "$KEY_NAME_ROLLAPP" "$RLY_ROLLAPP_ADDR" "100000000000000000000$BASE_DENOM" --keyring-backend test --fees "10000000000000000$BASE_DENOM" --node "$ROLLAPP_RPC_FOR_RELAYER" -y || exit 1
fi


echo '--------------------------------- Creating IBC path... --------------------------------'

rly paths new "$SETTLEMENT_CHAIN_ID" "$ROLLAPP_CHAIN_ID" "$RELAYER_PATH" --src-port "$IBC_PORT" --dst-port "$IBC_PORT" --version "$IBC_VERSION"

dasel put -r yaml -f "$RLY_CONFIG_FILE" "chains.$SETTLEMENT_CHAIN_ID.value.http-addr" -v "$HUB_REST_URL";
dasel put -r yaml -f "$RLY_CONFIG_FILE" "chains.$SETTLEMENT_CHAIN_ID.value.is-dym-hub" -v true -t bool;
dasel put -r yaml -f "$RLY_CONFIG_FILE" "chains.$ROLLAPP_CHAIN_ID.value.is-dym-rollapp" -v true -t bool;
dasel put -r yaml -f "$RLY_CONFIG_FILE" "chains.$ROLLAPP_CHAIN_ID.value.trust-period" -v "1179360s"; # 10 days

rly tx link "$RELAYER_PATH" --src-port "$IBC_PORT" --dst-port "$IBC_PORT" --version "$IBC_VERSION" --max-clock-drift 70m

16 changes: 16 additions & 0 deletions scripts/init.sh
Original file line number Diff line number Diff line change
@@ -88,6 +88,21 @@ add_genesis_accounts() {
EOF
}

update_genesis_params() {
local success=true

dasel put -f "$GENESIS_FILE" '.app_state.gov.voting_params.voting_period' -v "300s" || success=false
dasel put -f "$GENESIS_FILE" '.app_state.gov.tally_params.threshold' -v "0.490000000000000000" || success=false
dasel put -f "$GENESIS_FILE" '.app_state.sequencers.params.unbonding_time' -v "1814400s" || success=false # 2 weeks
dasel put -f "$GENESIS_FILE" '.app_state.staking.params.unbonding_time' -v "1814400s" || success=false # 2 weeks

if [ "$success" = false ]; then
echo "An error occurred. Please refer to README.md"
return 1
fi
echo "Successfully updated the genesis file"
}

generate_denom_metadata() {
tee "$ROLLAPP_SETTLEMENT_INIT_DIR_PATH/denommetadata.json" >/dev/null <<EOF
[
@@ -274,5 +289,6 @@ if [ ! "$answer" != "${answer#[Nn]}" ]; then
set +x
fi

update_genesis_params
"$EXECUTABLE" validate-genesis

0 comments on commit 0760db6

Please sign in to comment.