From e736dce2984f04f3e7e626a5e48ff26c2852339a Mon Sep 17 00:00:00 2001 From: Raymond Sukanto Date: Thu, 5 Sep 2024 08:38:09 -0400 Subject: [PATCH 1/2] update subnet sdk --- subnet/subnet.go | 18 ++---------------- 1 file changed, 2 insertions(+), 16 deletions(-) diff --git a/subnet/subnet.go b/subnet/subnet.go index aa359e6..706ee24 100644 --- a/subnet/subnet.go +++ b/subnet/subnet.go @@ -25,7 +25,6 @@ import ( "github.com/ava-labs/subnet-evm/commontype" "github.com/ava-labs/subnet-evm/core" "github.com/ava-labs/subnet-evm/params" - "github.com/ava-labs/subnet-evm/precompile/contracts/txallowlist" "github.com/ethereum/go-ethereum/common" ) @@ -221,21 +220,8 @@ func createEvmGenesis( return nil, fmt.Errorf("genesis params precompiles cannot be empty") } - if conf != nil && conf.GenesisPrecompiles[txallowlist.ConfigKey] != nil { - allowListCfg, ok := conf.GenesisPrecompiles[txallowlist.ConfigKey].(*txallowlist.Config) - if !ok { - return nil, fmt.Errorf( - "expected config of type txallowlist.AllowListConfig, but got %T", - allowListCfg, - ) - } - - if err := ensureAdminsHaveBalance( - allowListCfg.AdminAddresses, - allocation); err != nil { - return nil, err - } - } + conf.FeeConfig = subnetEVMParams.FeeConfig + conf.GenesisPrecompiles = subnetEVMParams.Precompiles conf.ChainID = subnetEVMParams.ChainID From 5b08e319a8ecc8b44f56c2d664aa037dfd252470 Mon Sep 17 00:00:00 2001 From: Raymond Sukanto Date: Thu, 5 Sep 2024 08:50:36 -0400 Subject: [PATCH 2/2] update subnet sdk --- subnet/subnet.go | 19 ------------------- 1 file changed, 19 deletions(-) diff --git a/subnet/subnet.go b/subnet/subnet.go index 706ee24..77cc2fb 100644 --- a/subnet/subnet.go +++ b/subnet/subnet.go @@ -25,7 +25,6 @@ import ( "github.com/ava-labs/subnet-evm/commontype" "github.com/ava-labs/subnet-evm/core" "github.com/ava-labs/subnet-evm/params" - "github.com/ethereum/go-ethereum/common" ) type SubnetParams struct { @@ -244,24 +243,6 @@ func createEvmGenesis( return prettyJSON.Bytes(), nil } -func ensureAdminsHaveBalance(admins []common.Address, alloc core.GenesisAlloc) error { - if len(admins) < 1 { - return nil - } - - for _, admin := range admins { - // we can break at the first admin who has a non-zero balance - if bal, ok := alloc[admin]; ok && - bal.Balance != nil && - bal.Balance.Uint64() > uint64(0) { - return nil - } - } - return errors.New( - "none of the addresses in the transaction allow list precompile have any tokens allocated to them. Currently, no address can transact on the network. Airdrop some funds to one of the allow list addresses to continue", - ) -} - func vmID(vmName string) (ids.ID, error) { if len(vmName) > 32 { return ids.Empty, fmt.Errorf("VM name must be <= 32 bytes, found %d", len(vmName))