From 069cd8ebce87c0a961a49ce1edcee4848e8d08e7 Mon Sep 17 00:00:00 2001 From: wanwiset25 Date: Thu, 10 Jul 2025 10:56:53 +0700 Subject: [PATCH] fix wrong storage in genesis due to rlp changed behavior (EIP-2718) --- cmd/puppeth/wizard_genesis.go | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/cmd/puppeth/wizard_genesis.go b/cmd/puppeth/wizard_genesis.go index 192ae03478..a2197bfffd 100644 --- a/cmd/puppeth/wizard_genesis.go +++ b/cmd/puppeth/wizard_genesis.go @@ -41,7 +41,6 @@ import ( randomizeContract "github.com/XinFinOrg/XDPoSChain/contracts/randomize" validatorContract "github.com/XinFinOrg/XDPoSChain/contracts/validator" "github.com/XinFinOrg/XDPoSChain/crypto" - "github.com/XinFinOrg/XDPoSChain/rlp" ) type GenesisInput struct { @@ -350,10 +349,7 @@ func (w *wizard) makeGenesis() { code, _ := contractBackend.CodeAt(ctx, validatorAddress, nil) storage := make(map[common.Hash]common.Hash) f := func(key, val common.Hash) bool { - decode := []byte{} - trim := bytes.TrimLeft(val.Bytes(), "\x00") - rlp.DecodeBytes(trim, &decode) - storage[key] = common.BytesToHash(decode) + storage[key] = common.BytesToHash(val.Bytes()) log.Info("DecodeBytes", "value", val.String(), "decode", storage[key].String()) return true }