Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add missing export genesis to mainnet simulation branch #1505

Open
omritoptix opened this issue Nov 18, 2024 · 2 comments · Fixed by #1524
Open

Add missing export genesis to mainnet simulation branch #1505

omritoptix opened this issue Nov 18, 2024 · 2 comments · Fixed by #1524
Assignees

Comments

@omritoptix
Copy link
Contributor

omritoptix commented Nov 18, 2024

Currently we use ducnt/v3.1.0 as a starting point to export mainnet genesis.
2 methods are missing there in order to have a full relevant state of mainnet:

  1. RollappByEIP155KeyPrefix - we currently don't import those objects
  2. VFC contract - we currently don't import the existing contracts

we need to update the current branch to also export those genesis metrics.

@mtsitrin
Copy link
Contributor

why u think there's issue with RollappByEIP155KeyPrefix?
seems it's set together with the rollapp object, implicitly from the rollappId


// SetRollapp set a specific rollapp in the store from its index
func (k Keeper) SetRollapp(ctx sdk.Context, rollapp types.Rollapp) {
	store := prefix.NewStore(ctx.KVStore(k.storeKey), types.KeyPrefix(types.RollappKeyPrefix))
	b := k.cdc.MustMarshal(&rollapp)
	store.Set(types.RollappKey(
		rollapp.RollappId,
	), b)

	// check if chain-id is EVM compatible. no err check as rollapp is already validated
	rollappID, _ := types.NewChainID(rollapp.RollappId)
	if !rollappID.IsEIP155() {
		return
	}

	// In case the chain id is EVM compatible, we store it by EIP155 id, to be retrievable by EIP155 id key
	store = prefix.NewStore(ctx.KVStore(k.storeKey), types.KeyPrefix(types.RollappByEIP155KeyPrefix))
	store.Set(types.RollappByEIP155Key(
		rollappID.GetEIP155ID(),
	), b)
}

@omritoptix omritoptix assigned zale144 and unassigned mtsitrin Nov 20, 2024
@omritoptix
Copy link
Contributor Author

the only things left to pull into ducnt/v3.1.0 branch is the vfc migrations from this pr: dymensionxyz/ethermint#30 (review)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
3 participants