diff --git a/cmd/config/config_migrations_test.go b/cmd/config/config_migrations_test.go index d64d4d41d1..08c8039db9 100644 --- a/cmd/config/config_migrations_test.go +++ b/cmd/config/config_migrations_test.go @@ -70,7 +70,6 @@ Version = "1.0.2" RpcFilterFile = "./.hmy/rpc_filter.txt" [TxPool] - BlacklistFile = "./.hmy/blacklist.txt" LocalAccountsFile = "./.hmy/locals.txt" AccountQueue = 64 GlobalQueue = 5120 @@ -145,7 +144,6 @@ Version = "1.0.3" RpcFilterFile = "./.hmy/rpc_filter.txt" [TxPool] - BlacklistFile = "./.hmy/blacklist.txt" LocalAccountsFile = "./.hmy/locals.txt" AccountQueue = 64 GlobalQueue = 5120 @@ -232,7 +230,6 @@ Version = "1.0.4" MinPeers = 6 [TxPool] - BlacklistFile = "./.hmy/blacklist.txt" LocalAccountsFile = "./.hmy/locals.txt" AccountQueue = 64 GlobalQueue = 5120 @@ -326,9 +323,8 @@ Version = "1.0.4" CacheSize = 512 [TxPool] - BlacklistFile = "./.hmy/blacklist.txt" LocalAccountsFile = "./.hmy/locals.txt" - AllowedTxsFile = "./.hmy/allowedtxs.txt" + AllowedTxsFile = "" AccountQueue = 64 GlobalQueue = 5120 Lifetime = "30m" diff --git a/cmd/config/config_test.go b/cmd/config/config_test.go index f8d106cb46..b8b254982b 100644 --- a/cmd/config/config_test.go +++ b/cmd/config/config_test.go @@ -83,9 +83,8 @@ Version = "1.0.4" ListenAddr = "127.0.0.1:6060" [TxPool] - BlacklistFile = "./.hmy/blacklist.txt" LocalAccountsFile = "./.hmy/locals.txt" - AllowedTxsFile = "./.hmy/allowedtxs.txt" + AllowedTxsFile = "" AccountQueue = 64 GlobalQueue = 5120 Lifetime = "30m" diff --git a/cmd/config/default.go b/cmd/config/default.go index 7874b1ead7..bff69f7d1d 100644 --- a/cmd/config/default.go +++ b/cmd/config/default.go @@ -92,8 +92,6 @@ var defaultConfig = harmonyconfig.HarmonyConfig{ KMSConfigFile: "", }, TxPool: harmonyconfig.TxPoolConfig{ - BlacklistFile: "./.hmy/blacklist.txt", - AllowedTxsFile: "./.hmy/allowedtxs.txt", RosettaFixFile: "", AccountSlots: core.DefaultTxPoolConfig.AccountSlots, LocalAccountsFile: "./.hmy/locals.txt", diff --git a/cmd/config/flags.go b/cmd/config/flags.go index 3ccb7223f8..aefb12032c 100644 --- a/cmd/config/flags.go +++ b/cmd/config/flags.go @@ -159,10 +159,7 @@ var ( tpGlobalQueueFlag, tpLifetimeFlag, rosettaFixFileFlag, - tpBlacklistFileFlag, - legacyTPBlacklistFileFlag, localAccountsFileFlag, - allowedTxsFileFlag, tpPriceLimitFlag, tpPriceBumpFlag, } @@ -1292,32 +1289,16 @@ var ( Usage: "number of executable transaction slots guaranteed per account", DefValue: int(defaultConfig.TxPool.AccountSlots), } - tpBlacklistFileFlag = cli.StringFlag{ - Name: "txpool.blacklist", - Usage: "file of blacklisted wallet addresses", - DefValue: defaultConfig.TxPool.BlacklistFile, - } rosettaFixFileFlag = cli.StringFlag{ Name: "txpool.rosettafixfile", Usage: "file of rosetta fix file", DefValue: defaultConfig.TxPool.RosettaFixFile, } - legacyTPBlacklistFileFlag = cli.StringFlag{ - Name: "blacklist", - Usage: "Path to newline delimited file of blacklisted wallet addresses", - DefValue: defaultConfig.TxPool.BlacklistFile, - Deprecated: "use --txpool.blacklist", - } localAccountsFileFlag = cli.StringFlag{ Name: "txpool.locals", Usage: "file of local wallet addresses", DefValue: defaultConfig.TxPool.LocalAccountsFile, } - allowedTxsFileFlag = cli.StringFlag{ - Name: "txpool.allowedtxs", - Usage: "file of allowed transactions", - DefValue: defaultConfig.TxPool.AllowedTxsFile, - } tpGlobalSlotsFlag = cli.IntFlag{ Name: "txpool.globalslots", Usage: "maximum global number of non-executable transactions in the pool", @@ -1382,17 +1363,9 @@ func applyTxPoolFlags(cmd *cobra.Command, config *harmonyconfig.HarmonyConfig) { } config.TxPool.GlobalQueue = uint64(value) } - if cli.IsFlagChanged(cmd, tpBlacklistFileFlag) { - config.TxPool.BlacklistFile = cli.GetStringFlagValue(cmd, tpBlacklistFileFlag) - } else if cli.IsFlagChanged(cmd, legacyTPBlacklistFileFlag) { - config.TxPool.BlacklistFile = cli.GetStringFlagValue(cmd, legacyTPBlacklistFileFlag) - } if cli.IsFlagChanged(cmd, localAccountsFileFlag) { config.TxPool.LocalAccountsFile = cli.GetStringFlagValue(cmd, localAccountsFileFlag) } - if cli.IsFlagChanged(cmd, allowedTxsFileFlag) { - config.TxPool.AllowedTxsFile = cli.GetStringFlagValue(cmd, allowedTxsFileFlag) - } if cli.IsFlagChanged(cmd, tpLifetimeFlag) { value, err := time.ParseDuration(cli.GetStringFlagValue(cmd, tpLifetimeFlag)) if err != nil { diff --git a/cmd/config/flags_test.go b/cmd/config/flags_test.go index 26bced60f3..939ac262b5 100644 --- a/cmd/config/flags_test.go +++ b/cmd/config/flags_test.go @@ -31,7 +31,7 @@ func TestHarmonyFlags(t *testing.T) { "/ip4/54.213.43.194/tcp/9874/p2p/QmZJJx6AdaoEkGLrYG4JeLCKeCKDjnFz2wfHNHxAqFSGA9,/ip4/13.113.101." + "219/tcp/12019/p2p/QmQayinFSgMMw5cSpDUiD9pQ2WeP6WNmGxpZ6ou3mdVFJX,/ip4/99.81.170.167/tcp/12019/p" + "2p/QmRVbTpEYup8dSaURZfF6ByrMTSKa4UyUzJhSjahFzRqNj --ip 8.8.8.8 --port 9000 --network_type=mainn" + - "et --dns_zone=t.hmny.io --blacklist=./.hmy/blacklist.txt --min_peers=6 --max_bls_keys_per_node=" + + "et --dns_zone=t.hmny.io --min_peers=6 --max_bls_keys_per_node=" + "10 --broadcast_invalid_tx=true --verbosity=3 --is_archival=false --shard_id=-1 --staking=true -" + "-aws-config-source file:config.json --p2p.disc.concurrency 5 --p2p.security.max-conn-per-ip 5 -" + "-localnet.blocks_per_epoch=64 --localnet.blocks_per_epoch_v2=64", @@ -128,8 +128,7 @@ func TestHarmonyFlags(t *testing.T) { KMSConfigFile: "config.json", }, TxPool: harmonyconfig.TxPoolConfig{ - BlacklistFile: "./.hmy/blacklist.txt", - AllowedTxsFile: "./.hmy/allowedtxs.txt", + AllowedTxsFile: "", RosettaFixFile: "", AccountSlots: 16, GlobalSlots: 4096, @@ -1269,7 +1268,6 @@ func TestTxPoolFlags(t *testing.T) { { args: []string{}, expConfig: harmonyconfig.TxPoolConfig{ - BlacklistFile: defaultConfig.TxPool.BlacklistFile, AllowedTxsFile: defaultConfig.TxPool.AllowedTxsFile, RosettaFixFile: defaultConfig.TxPool.RosettaFixFile, AccountSlots: defaultConfig.TxPool.AccountSlots, @@ -1283,10 +1281,9 @@ func TestTxPoolFlags(t *testing.T) { }, }, { - args: []string{"--txpool.blacklist", "blacklist.file", "--txpool.rosettafixfile", "rosettafix.file", "--txpool.allowedtxs", "allowedtxs.txt"}, + args: []string{"--txpool.rosettafixfile", "rosettafix.file"}, expConfig: harmonyconfig.TxPoolConfig{ - BlacklistFile: "blacklist.file", - AllowedTxsFile: "allowedtxs.txt", + AllowedTxsFile: "", RosettaFixFile: "rosettafix.file", AccountSlots: defaultConfig.TxPool.AccountSlots, GlobalSlots: defaultConfig.TxPool.GlobalSlots, @@ -1299,9 +1296,8 @@ func TestTxPoolFlags(t *testing.T) { }, }, { - args: []string{"--blacklist", "blacklist.file", "--txpool.rosettafixfile", "rosettafix.file"}, + args: []string{"--txpool.rosettafixfile", "rosettafix.file"}, expConfig: harmonyconfig.TxPoolConfig{ - BlacklistFile: "blacklist.file", RosettaFixFile: "rosettafix.file", AllowedTxsFile: defaultConfig.TxPool.AllowedTxsFile, AccountSlots: defaultConfig.TxPool.AccountSlots, @@ -1315,10 +1311,9 @@ func TestTxPoolFlags(t *testing.T) { }, }, { - args: []string{"--txpool.accountslots", "5", "--txpool.blacklist", "blacklist.file", "--txpool.rosettafixfile", "rosettafix.file"}, + args: []string{"--txpool.accountslots", "5", "--txpool.rosettafixfile", "rosettafix.file"}, expConfig: harmonyconfig.TxPoolConfig{ AccountSlots: 5, - BlacklistFile: "blacklist.file", AllowedTxsFile: defaultConfig.TxPool.AllowedTxsFile, RosettaFixFile: "rosettafix.file", LocalAccountsFile: defaultConfig.TxPool.LocalAccountsFile, @@ -1333,7 +1328,6 @@ func TestTxPoolFlags(t *testing.T) { { args: []string{"--txpool.locals", "locals.txt"}, expConfig: harmonyconfig.TxPoolConfig{ - BlacklistFile: defaultConfig.TxPool.BlacklistFile, AllowedTxsFile: defaultConfig.TxPool.AllowedTxsFile, RosettaFixFile: defaultConfig.TxPool.RosettaFixFile, AccountSlots: defaultConfig.TxPool.AccountSlots, @@ -1349,7 +1343,6 @@ func TestTxPoolFlags(t *testing.T) { { args: []string{"--txpool.globalslots", "10240"}, expConfig: harmonyconfig.TxPoolConfig{ - BlacklistFile: defaultConfig.TxPool.BlacklistFile, AllowedTxsFile: defaultConfig.TxPool.AllowedTxsFile, RosettaFixFile: defaultConfig.TxPool.RosettaFixFile, AccountSlots: defaultConfig.TxPool.AccountSlots, @@ -1365,7 +1358,6 @@ func TestTxPoolFlags(t *testing.T) { { args: []string{"--txpool.accountqueue", "128", "--txpool.globalqueue", "10240", "--txpool.lifetime", "15m", "--txpool.pricelimit", "100", "--txpool.pricebump", "2"}, expConfig: harmonyconfig.TxPoolConfig{ - BlacklistFile: defaultConfig.TxPool.BlacklistFile, AllowedTxsFile: defaultConfig.TxPool.AllowedTxsFile, RosettaFixFile: defaultConfig.TxPool.RosettaFixFile, AccountSlots: defaultConfig.TxPool.AccountSlots, diff --git a/cmd/harmony/main.go b/cmd/harmony/main.go index 8f75bbd767..808ca94842 100644 --- a/cmd/harmony/main.go +++ b/cmd/harmony/main.go @@ -48,7 +48,6 @@ import ( node "github.com/harmony-one/harmony/node/harmony" "github.com/harmony-one/harmony/numeric" "github.com/harmony-one/harmony/p2p" - rosetta_common "github.com/harmony-one/harmony/rosetta/common" rpc_common "github.com/harmony-one/harmony/rpc/harmony/common" "github.com/harmony-one/harmony/shard" "github.com/harmony-one/harmony/webhooks" @@ -710,15 +709,7 @@ func setupConsensusAndNode(hc harmonyconfig.HarmonyConfig, nodeConfig *nodeconfi aggregateSig = defaultConsensusConfig.AggregateSig } - blacklist, err := setupBlacklist(hc) - if err != nil { - utils.Logger().Warn().Msgf("Blacklist setup error: %s", err.Error()) - } - allowedTxs, err := setupAllowedTxs(hc) - if err != nil { - utils.Logger().Warn().Msgf("AllowedTxs setup error: %s", err.Error()) - } - localAccounts, err := setupLocalAccounts(hc, blacklist) + localAccounts, err := setupLocalAccounts(hc) if err != nil { utils.Logger().Warn().Msgf("local accounts setup error: %s", err.Error()) } @@ -741,7 +732,7 @@ func setupConsensusAndNode(hc harmonyconfig.HarmonyConfig, nodeConfig *nodeconfi os.Exit(1) } - currentNode := node.New(myHost, currentConsensus, blacklist, allowedTxs, localAccounts, &hc, registry) + currentNode := node.New(myHost, currentConsensus, localAccounts, &hc, registry) if hc.Legacy != nil && hc.Legacy.TPBroadcastInvalidTxn != nil { currentNode.BroadcastInvalidTx = *hc.Legacy.TPBroadcastInvalidTxn @@ -925,28 +916,6 @@ func setupSyncService(node *node.Node, host p2p.Host, hc harmonyconfig.HarmonyCo } } -func setupBlacklist(hc harmonyconfig.HarmonyConfig) (map[ethCommon.Address]struct{}, error) { - rosetta_common.InitRosettaFile(hc.TxPool.RosettaFixFile) - - utils.Logger().Debug().Msgf("Using blacklist file at `%s`", hc.TxPool.BlacklistFile) - dat, err := os.ReadFile(hc.TxPool.BlacklistFile) - if err != nil { - return nil, err - } - addrMap := make(map[ethCommon.Address]struct{}) - for _, line := range strings.Split(string(dat), "\n") { - if len(line) != 0 { // blacklist file may have trailing empty string line - b32 := strings.TrimSpace(strings.Split(string(line), "#")[0]) - addr, err := common.ParseAddr(b32) - if err != nil { - return nil, err - } - addrMap[addr] = struct{}{} - } - } - return addrMap, nil -} - func parseAllowedTxs(data []byte) (map[ethCommon.Address][]core.AllowedTxData, error) { allowedTxs := make(map[ethCommon.Address][]core.AllowedTxData) for _, line := range strings.Split(string(data), "\n") { @@ -978,30 +947,7 @@ func parseAllowedTxs(data []byte) (map[ethCommon.Address][]core.AllowedTxData, e return allowedTxs, nil } -func setupAllowedTxs(hc harmonyconfig.HarmonyConfig) (map[ethCommon.Address][]core.AllowedTxData, error) { - // check if the file exists - if _, err := os.Stat(hc.TxPool.AllowedTxsFile); err == nil { - // read the file and parse allowed transactions - utils.Logger().Debug().Msgf("Using AllowedTxs file at `%s`", hc.TxPool.AllowedTxsFile) - data, err := os.ReadFile(hc.TxPool.AllowedTxsFile) - if err != nil { - return nil, err - } - return parseAllowedTxs(data) - } else if errors.Is(err, os.ErrNotExist) { - // file path does not exist - utils.Logger().Debug(). - Str("AllowedTxsFile", hc.TxPool.AllowedTxsFile). - Msg("AllowedTxs file doesn't exist") - return make(map[ethCommon.Address][]core.AllowedTxData), nil - } else { - // some other errors happened - utils.Logger().Error().Err(err).Msg("setup allowedTxs failed") - return nil, err - } -} - -func setupLocalAccounts(hc harmonyconfig.HarmonyConfig, blacklist map[ethCommon.Address]struct{}) ([]ethCommon.Address, error) { +func setupLocalAccounts(hc harmonyconfig.HarmonyConfig) ([]ethCommon.Address, error) { file := hc.TxPool.LocalAccountsFile // check if file exist var fileData string @@ -1033,11 +979,6 @@ func setupLocalAccounts(hc harmonyconfig.HarmonyConfig, blacklist map[ethCommon. if err != nil { return nil, err } - // skip the blacklisted addresses - if _, exists := blacklist[addr]; exists { - utils.Logger().Warn().Msgf("local account with address %s is blacklisted", addr.String()) - continue - } localAccounts[addr] = struct{}{} } uniqueAddresses := make([]ethCommon.Address, 0, len(localAccounts)) diff --git a/core/error.go b/core/error.go index 2f9a41e45f..566d94f1d4 100644 --- a/core/error.go +++ b/core/error.go @@ -28,9 +28,6 @@ var ( // by a transaction is higher than what's left in the block. ErrGasLimitReached = errors.New("gas limit reached") - // ErrBlacklistedHash is returned if a block to import is on the blacklist. - ErrBlacklistedHash = errors.New("blacklisted hash") - // ErrNonceTooHigh is returned if the nonce of a transaction is higher than the // next one expected based on the local chain. ErrNonceTooHigh = errors.New("nonce too high") diff --git a/core/tx_pool.go b/core/tx_pool.go index 66254a4781..eaa6fffe37 100644 --- a/core/tx_pool.go +++ b/core/tx_pool.go @@ -17,7 +17,6 @@ package core import ( - "bytes" "fmt" "math" "math/big" @@ -94,14 +93,6 @@ var ( // ErrInvalidMsgForStakingDirective is returned if a staking message does not // match the related directive ErrInvalidMsgForStakingDirective = errors.New("staking message does not match directive message") - - // ErrBlacklistFrom is returned if a transaction's from/source address is blacklisted - ErrBlacklistFrom = errors.New("`from` address of transaction in blacklist and not in allowlist") - - // ErrBlacklistTo is returned if a transaction's to/destination address is blacklisted - ErrBlacklistTo = errors.New("`to` address of transaction in blacklist") - - ErrAllowedTxs = errors.New("transaction allowed whitelist check failed.") ) var ( @@ -171,9 +162,6 @@ type TxPoolConfig struct { Lifetime time.Duration // Maximum amount of time non-executable transaction are queued AddEvent func(tx types.PoolTransaction, local bool) // Fire add event - - Blacklist map[common.Address]struct{} // Set of accounts that cannot be a part of any transaction - AllowedTxs map[common.Address][]AllowedTxData // Set of allowed transactions can break the blocklist } // DefaultTxPoolConfig contains the default configurations for the transaction @@ -191,9 +179,6 @@ var DefaultTxPoolConfig = TxPoolConfig{ GlobalQueue: 5120, // --txpool.globalqueue Lifetime: 30 * time.Minute, // --txpool.lifetime - - Blacklist: map[common.Address]struct{}{}, - AllowedTxs: map[common.Address][]AllowedTxData{}, } // sanitize checks the provided user configurations and changes anything that's @@ -221,14 +206,6 @@ func (config *TxPoolConfig) sanitize() TxPoolConfig { Msg("Sanitizing invalid txpool price bump") conf.PriceBump = DefaultTxPoolConfig.PriceBump } - if conf.Blacklist == nil { - utils.Logger().Warn().Msg("Sanitizing nil blacklist set") - conf.Blacklist = DefaultTxPoolConfig.Blacklist - } - if conf.AllowedTxs == nil { - utils.Logger().Warn().Msg("Sanitizing nil allowedTxs set") - conf.AllowedTxs = DefaultTxPoolConfig.AllowedTxs - } if conf.AccountSlots == 0 { utils.Logger().Warn(). Uint64("provided", conf.AccountSlots). @@ -752,42 +729,6 @@ func (pool *TxPool) validateTx(tx types.PoolTransaction, local bool) error { return ErrInvalidSender } - // do whitelist check first, if tx not in whitelist, do blacklist check - if allowedTxs, exists := pool.config.AllowedTxs[from]; exists { - txIsAllowed := false - to := tx.To() - toAddr := common.Address{} - if to != nil { - toAddr = *to - for _, allowedTx := range allowedTxs { - if toAddr == allowedTx.To && bytes.Equal(tx.Data(), allowedTx.Data) { - txIsAllowed = true - break - } - } - } - if !txIsAllowed { - return errors.WithMessagef(ErrAllowedTxs, "transaction sender: %x, receiver: %x, input: %x", tx.From(), toAddr, tx.Data()) - } - } else { - // do blacklist check - // Make sure transaction does not have blacklisted addresses - if _, exists := (pool.config.Blacklist)[from]; exists { - if b32, err := hmyCommon.AddressToBech32(from); err == nil { - return errors.WithMessagef(ErrBlacklistFrom, "transaction sender is %s", b32) - } - return ErrBlacklistFrom - } - // Make sure transaction does not burn funds by sending funds to blacklisted address - if tx.To() != nil { - if _, exists := (pool.config.Blacklist)[*tx.To()]; exists { - if b32, err := hmyCommon.AddressToBech32(*tx.To()); err == nil { - return errors.WithMessagef(ErrBlacklistTo, "transaction receiver is %s with data: %x", b32, tx.Data()) - } - return ErrBlacklistTo - } - } - } // Drop non-local transactions under our own minimal accepted gas price local = local || pool.locals.contains(from) // account may be local even if the transaction arrived from the network if !local && pool.gasPrice.Cmp(tx.GasPrice()) > 0 { diff --git a/core/tx_pool_test.go b/core/tx_pool_test.go index 0d1dfbd2b9..f1e7ce5ce7 100644 --- a/core/tx_pool_test.go +++ b/core/tx_pool_test.go @@ -455,51 +455,6 @@ func TestMixedTransactions(t *testing.T) { } } -func TestBlacklistedTransactions(t *testing.T) { - // DO NOT parallelize, test will add accounts to tx pool config. - - // Create the pool - pool, _ := setupTxPool(nil) - defer pool.Stop() - - // Create testing keys - bannedFromKey, _ := crypto.GenerateKey() - goodFromKey, _ := crypto.GenerateKey() - - // Create testing transactions - badTx := transaction(0, 0, 25000, bannedFromKey) - goodTx := transaction(0, 0, 25000, goodFromKey) - bannedFromAcc, _ := deriveSender(badTx) - bannedToAcc := *badTx.To() - goodFromAcc, _ := deriveSender(goodTx) - - // Fund from accounts - pool.currentState.AddBalance(bannedFromAcc, big.NewInt(15030000000000000)) - pool.currentState.AddBalance(goodFromAcc, big.NewInt(15030000000000000)) - - DefaultTxPoolConfig.Blacklist[bannedToAcc] = struct{}{} - err := pool.AddRemotes(types.PoolTransactions{badTx}) - if err[0] != ErrBlacklistTo { - t.Error("expected", ErrBlacklistTo, "got", err[0]) - } - - delete(DefaultTxPoolConfig.Blacklist, bannedToAcc) - DefaultTxPoolConfig.Blacklist[bannedFromAcc] = struct{}{} - err = pool.AddRemotes(types.PoolTransactions{badTx}) - if err[0] != ErrBlacklistFrom { - t.Error("expected", ErrBlacklistFrom, "got", err[0]) - } - - // to acc is same for bad and good tx, so keep off blacklist for valid tx check - err = pool.AddRemotes(types.PoolTransactions{goodTx}) - if err[0] != nil { - t.Error("expected", nil, "got", err[0]) - } - - // cleanup blacklist config for other tests - DefaultTxPoolConfig.Blacklist = map[common.Address]struct{}{} -} - func TestTransactionQueue(t *testing.T) { t.Parallel() diff --git a/core_test/shardchain_test.go b/core_test/shardchain_test.go index ef4cc04cdb..f5531bee36 100644 --- a/core_test/shardchain_test.go +++ b/core_test/shardchain_test.go @@ -59,7 +59,7 @@ func TestAddNewBlock(t *testing.T) { } nodeconfig.SetNetworkType(nodeconfig.Testnet) var block *types.Block - node := node.New(host, consensus, nil, nil, nil, nil, reg) + node := node.New(host, consensus, nil, nil, reg) commitSigs := make(chan []byte, 1) commitSigs <- []byte{} block, err = node.Worker.FinalizeNewBlock( diff --git a/internal/configs/harmony/harmony.go b/internal/configs/harmony/harmony.go index 6aa7d5ad2e..ed3fec60c2 100644 --- a/internal/configs/harmony/harmony.go +++ b/internal/configs/harmony/harmony.go @@ -226,7 +226,6 @@ type BlsConfig struct { } type TxPoolConfig struct { - BlacklistFile string AllowedTxsFile string RosettaFixFile string AccountSlots uint64 diff --git a/node/harmony/node.go b/node/harmony/node.go index 868dd291f0..fb10bde8ba 100644 --- a/node/harmony/node.go +++ b/node/harmony/node.go @@ -967,8 +967,6 @@ func (node *Node) GetSyncID() [SyncIDLength]byte { func New( host p2p.Host, consensusObj *consensus.Consensus, - blacklist map[common.Address]struct{}, - allowedTxs map[common.Address][]core.AllowedTxData, localAccounts []common.Address, harmonyconfig *harmonyconfig.HarmonyConfig, registry *registry.Registry, @@ -1045,8 +1043,6 @@ func New( txPoolConfig.PriceBump = 10 } - txPoolConfig.Blacklist = blacklist - txPoolConfig.AllowedTxs = allowedTxs txPoolConfig.Journal = fmt.Sprintf("%v/%v", node.NodeConfig.DBDir, txPoolConfig.Journal) txPoolConfig.AddEvent = func(tx types.PoolTransaction, local bool) { // in tikv mode, writer will publish tx pool update to all reader diff --git a/node/harmony/node_handler_test.go b/node/harmony/node_handler_test.go index 65c960e028..752122a8de 100644 --- a/node/harmony/node_handler_test.go +++ b/node/harmony/node_handler_test.go @@ -54,7 +54,7 @@ func TestAddNewBlock(t *testing.T) { t.Fatalf("Cannot craeate consensus: %v", err) } nodeconfig.SetNetworkType(nodeconfig.Testnet) - node := New(host, consensus, nil, nil, nil, nil, reg) + node := New(host, consensus, nil, nil, reg) txs := make(map[common.Address]types.Transactions) stks := staking.StakingTransactions{} @@ -117,7 +117,7 @@ func TestVerifyNewBlock(t *testing.T) { archiveMode := make(map[uint32]bool) archiveMode[0] = true archiveMode[1] = false - node := New(host, consensusObj, nil, nil, nil, nil, reg) + node := New(host, consensusObj, nil, nil, reg) txs := make(map[common.Address]types.Transactions) stks := staking.StakingTransactions{} @@ -176,7 +176,7 @@ func TestVerifyVRF(t *testing.T) { archiveMode := make(map[uint32]bool) archiveMode[0] = true archiveMode[1] = false - node := New(host, consensus, nil, nil, nil, nil, reg) + node := New(host, consensus, nil, nil, reg) txs := make(map[common.Address]types.Transactions) stks := staking.StakingTransactions{} diff --git a/node/harmony/node_newblock_test.go b/node/harmony/node_newblock_test.go index 5780b7cda0..a128298417 100644 --- a/node/harmony/node_newblock_test.go +++ b/node/harmony/node_newblock_test.go @@ -58,7 +58,7 @@ func TestFinalizeNewBlockAsync(t *testing.T) { t.Fatalf("Cannot craeate consensus: %v", err) } - node := New(host, consensusObj, nil, nil, nil, nil, reg) + node := New(host, consensusObj, nil, nil, reg) node.Worker.UpdateCurrent() diff --git a/node/harmony/node_test.go b/node/harmony/node_test.go index d278a55e32..e1f29a36ce 100644 --- a/node/harmony/node_test.go +++ b/node/harmony/node_test.go @@ -140,7 +140,7 @@ func TestNewNode(t *testing.T) { t.Fatalf("Cannot craeate consensus: %v", err) } - node := New(host, consensus, nil, nil, nil, nil, reg) + node := New(host, consensus, nil, nil, reg) if node.Consensus == nil { t.Error("Consensus is not initialized for the node") }