|
|
|
@ -5,6 +5,7 @@ import ( |
|
|
|
|
"reflect" |
|
|
|
|
"strings" |
|
|
|
|
"testing" |
|
|
|
|
"time" |
|
|
|
|
|
|
|
|
|
harmonyconfig "github.com/harmony-one/harmony/internal/configs/harmony" |
|
|
|
|
|
|
|
|
@ -118,8 +119,13 @@ func TestHarmonyFlags(t *testing.T) { |
|
|
|
|
AllowedTxsFile: "./.hmy/allowedtxs.txt", |
|
|
|
|
RosettaFixFile: "", |
|
|
|
|
AccountSlots: 16, |
|
|
|
|
GlobalSlots: 5120, |
|
|
|
|
GlobalSlots: 4096, |
|
|
|
|
LocalAccountsFile: "./.hmy/locals.txt", |
|
|
|
|
AccountQueue: 64, |
|
|
|
|
GlobalQueue: 5120, |
|
|
|
|
Lifetime: 30 * time.Minute, |
|
|
|
|
PriceLimit: 100e9, |
|
|
|
|
PriceBump: 1, |
|
|
|
|
}, |
|
|
|
|
Pprof: harmonyconfig.PprofConfig{ |
|
|
|
|
Enabled: false, |
|
|
|
@ -1005,6 +1011,11 @@ func TestTxPoolFlags(t *testing.T) { |
|
|
|
|
AccountSlots: defaultConfig.TxPool.AccountSlots, |
|
|
|
|
LocalAccountsFile: defaultConfig.TxPool.LocalAccountsFile, |
|
|
|
|
GlobalSlots: defaultConfig.TxPool.GlobalSlots, |
|
|
|
|
AccountQueue: defaultConfig.TxPool.AccountQueue, |
|
|
|
|
GlobalQueue: defaultConfig.TxPool.GlobalQueue, |
|
|
|
|
Lifetime: defaultConfig.TxPool.Lifetime, |
|
|
|
|
PriceLimit: 100e9, |
|
|
|
|
PriceBump: 1, |
|
|
|
|
}, |
|
|
|
|
}, |
|
|
|
|
{ |
|
|
|
@ -1015,7 +1026,12 @@ func TestTxPoolFlags(t *testing.T) { |
|
|
|
|
RosettaFixFile: "rosettafix.file", |
|
|
|
|
AccountSlots: defaultConfig.TxPool.AccountSlots, |
|
|
|
|
GlobalSlots: defaultConfig.TxPool.GlobalSlots, |
|
|
|
|
AccountQueue: defaultConfig.TxPool.AccountQueue, |
|
|
|
|
GlobalQueue: defaultConfig.TxPool.GlobalQueue, |
|
|
|
|
Lifetime: defaultConfig.TxPool.Lifetime, |
|
|
|
|
LocalAccountsFile: defaultConfig.TxPool.LocalAccountsFile, |
|
|
|
|
PriceLimit: 100e9, |
|
|
|
|
PriceBump: 1, |
|
|
|
|
}, |
|
|
|
|
}, |
|
|
|
|
{ |
|
|
|
@ -1026,7 +1042,12 @@ func TestTxPoolFlags(t *testing.T) { |
|
|
|
|
AllowedTxsFile: defaultConfig.TxPool.AllowedTxsFile, |
|
|
|
|
AccountSlots: defaultConfig.TxPool.AccountSlots, |
|
|
|
|
GlobalSlots: defaultConfig.TxPool.GlobalSlots, |
|
|
|
|
AccountQueue: defaultConfig.TxPool.AccountQueue, |
|
|
|
|
GlobalQueue: defaultConfig.TxPool.GlobalQueue, |
|
|
|
|
Lifetime: defaultConfig.TxPool.Lifetime, |
|
|
|
|
LocalAccountsFile: defaultConfig.TxPool.LocalAccountsFile, |
|
|
|
|
PriceLimit: 100e9, |
|
|
|
|
PriceBump: 1, |
|
|
|
|
}, |
|
|
|
|
}, |
|
|
|
|
{ |
|
|
|
@ -1038,6 +1059,11 @@ func TestTxPoolFlags(t *testing.T) { |
|
|
|
|
RosettaFixFile: "rosettafix.file", |
|
|
|
|
LocalAccountsFile: defaultConfig.TxPool.LocalAccountsFile, |
|
|
|
|
GlobalSlots: defaultConfig.TxPool.GlobalSlots, |
|
|
|
|
AccountQueue: defaultConfig.TxPool.AccountQueue, |
|
|
|
|
GlobalQueue: defaultConfig.TxPool.GlobalQueue, |
|
|
|
|
Lifetime: defaultConfig.TxPool.Lifetime, |
|
|
|
|
PriceLimit: 100e9, |
|
|
|
|
PriceBump: 1, |
|
|
|
|
}, |
|
|
|
|
}, |
|
|
|
|
{ |
|
|
|
@ -1049,6 +1075,11 @@ func TestTxPoolFlags(t *testing.T) { |
|
|
|
|
AccountSlots: defaultConfig.TxPool.AccountSlots, |
|
|
|
|
LocalAccountsFile: "locals.txt", |
|
|
|
|
GlobalSlots: defaultConfig.TxPool.GlobalSlots, |
|
|
|
|
AccountQueue: defaultConfig.TxPool.AccountQueue, |
|
|
|
|
GlobalQueue: defaultConfig.TxPool.GlobalQueue, |
|
|
|
|
Lifetime: defaultConfig.TxPool.Lifetime, |
|
|
|
|
PriceLimit: 100e9, |
|
|
|
|
PriceBump: 1, |
|
|
|
|
}, |
|
|
|
|
}, |
|
|
|
|
{ |
|
|
|
@ -1060,6 +1091,27 @@ func TestTxPoolFlags(t *testing.T) { |
|
|
|
|
AccountSlots: defaultConfig.TxPool.AccountSlots, |
|
|
|
|
LocalAccountsFile: defaultConfig.TxPool.LocalAccountsFile, |
|
|
|
|
GlobalSlots: 10240, |
|
|
|
|
AccountQueue: defaultConfig.TxPool.AccountQueue, |
|
|
|
|
GlobalQueue: defaultConfig.TxPool.GlobalQueue, |
|
|
|
|
Lifetime: defaultConfig.TxPool.Lifetime, |
|
|
|
|
PriceLimit: 100e9, |
|
|
|
|
PriceBump: 1, |
|
|
|
|
}, |
|
|
|
|
}, |
|
|
|
|
{ |
|
|
|
|
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, |
|
|
|
|
LocalAccountsFile: defaultConfig.TxPool.LocalAccountsFile, |
|
|
|
|
GlobalSlots: defaultConfig.TxPool.GlobalSlots, |
|
|
|
|
AccountQueue: 128, |
|
|
|
|
GlobalQueue: 10240, |
|
|
|
|
Lifetime: 15 * time.Minute, |
|
|
|
|
PriceLimit: 100, |
|
|
|
|
PriceBump: 2, |
|
|
|
|
}, |
|
|
|
|
}, |
|
|
|
|
} |
|
|
|
|