diff --git a/cmd/XDC/chaincmd.go b/cmd/XDC/chaincmd.go index 723481b697..9f49aac759 100644 --- a/cmd/XDC/chaincmd.go +++ b/cmd/XDC/chaincmd.go @@ -170,7 +170,7 @@ func initGenesis(ctx *cli.Context) error { } if genesis.Config.ChainId != nil { - common.CopyConstans(genesis.Config.ChainId.Uint64()) + common.CopyConstants(genesis.Config.ChainId.Uint64()) } // Open an initialise both full and light databases diff --git a/cmd/XDC/config.go b/cmd/XDC/config.go index f54ceb922b..307ecc1592 100644 --- a/cmd/XDC/config.go +++ b/cmd/XDC/config.go @@ -148,24 +148,11 @@ func makeConfigNode(ctx *cli.Context) (*node.Node, XDCConfig) { if ctx.IsSet(utils.MiningEnabledFlag.Name) { log.Warn("The flag --mine is deprecated and will be removed") } - // if !ctx.IsSet(debug.VerbosityFlag.Name) { - // debug.Verbosity(log.Lvl(cfg.Verbosity)) - // } if !ctx.IsSet(utils.NATFlag.Name) && cfg.NAT != "" { ctx.Set(utils.NATFlag.Name, cfg.NAT) } - // Check testnet is enable. - if ctx.Bool(utils.TestnetFlag.Name) { - common.IsTestnet = true - common.TRC21IssuerSMC = common.TRC21IssuerSMCTestNet - cfg.Eth.NetworkId = 51 - common.RelayerRegistrationSMC = common.RelayerRegistrationSMCTestnet - common.TIPTRC21Fee = common.TIPTRC21FeeTestnet - common.TIPXDCXCancellationFee = common.TIPXDCXCancellationFeeTestnet - } - if ctx.Bool(utils.EnableXDCPrefixFlag.Name) { common.Enable0xPrefix = false } diff --git a/cmd/utils/flags.go b/cmd/utils/flags.go index b67ca71dc2..353b39583b 100644 --- a/cmd/utils/flags.go +++ b/cmd/utils/flags.go @@ -1393,6 +1393,21 @@ func SetEthConfig(ctx *cli.Context, stack *node.Node, cfg *ethconfig.Config) { } if ctx.IsSet(NetworkIdFlag.Name) { cfg.NetworkId = ctx.Uint64(NetworkIdFlag.Name) + switch cfg.NetworkId { + case 50: + if !ctx.IsSet(MainnetFlag.Name) { + ctx.Set(MainnetFlag.Name, "true") + } + case 51: + common.IsTestnet = true + if !ctx.IsSet(TestnetFlag.Name) { + ctx.Set(TestnetFlag.Name, "true") + } + case 551: + if !ctx.IsSet(DevnetFlag.Name) { + ctx.Set(DevnetFlag.Name, "true") + } + } } if ctx.IsSet(CacheFlag.Name) || ctx.IsSet(CacheDatabaseFlag.Name) { @@ -1457,6 +1472,7 @@ func SetEthConfig(ctx *cli.Context, stack *node.Node, cfg *ethconfig.Config) { } cfg.Genesis = core.DefaultGenesisBlock() case ctx.Bool(TestnetFlag.Name): + common.IsTestnet = true if !ctx.IsSet(NetworkIdFlag.Name) { cfg.NetworkId = 51 } diff --git a/common/constants.all.go b/common/constants.all.go index 1cee29e31e..ad156929c6 100644 --- a/common/constants.all.go +++ b/common/constants.all.go @@ -42,80 +42,64 @@ type constant struct { blackListHFNumber uint64 maxMasternodesV2 int // Last v1 masternodes - tip2019Block *big.Int - tipSigning *big.Int - tipRandomize *big.Int - tipNoHalvingMNReward *big.Int // hardfork no halving masternodes reward - tipXDCX *big.Int - tipXDCXLending *big.Int - tipXDCXCancellationFee *big.Int - tipXDCXCancellationFeeTestnet *big.Int - tipTRC21Fee *big.Int - tipTRC21FeeTestnet *big.Int - tipIncreaseMasternodes *big.Int // Upgrade MN Count at Block. - berlinBlock *big.Int - londonBlock *big.Int - mergeBlock *big.Int - shanghaiBlock *big.Int - blockNumberGas50x *big.Int - TIPV2SwitchBlock *big.Int - tipXDCXMinerDisable *big.Int - tipXDCXReceiverDisable *big.Int - eip1559Block *big.Int - cancunBlock *big.Int + tip2019Block *big.Int + tipSigning *big.Int + tipRandomize *big.Int + tipNoHalvingMNReward *big.Int // hard fork no halving masternodes reward + tipXDCX *big.Int + tipXDCXLending *big.Int + tipXDCXCancellationFee *big.Int + tipTRC21Fee *big.Int + tipIncreaseMasternodes *big.Int // Upgrade MN Count at Block. + berlinBlock *big.Int + londonBlock *big.Int + mergeBlock *big.Int + shanghaiBlock *big.Int + blockNumberGas50x *big.Int + TIPV2SwitchBlock *big.Int + tipXDCXMinerDisable *big.Int + tipXDCXReceiverDisable *big.Int + eip1559Block *big.Int + cancunBlock *big.Int - trc21IssuerSMCTestNet Address - trc21IssuerSMC Address - xdcxListingSMC Address - xdcxListingSMCTestNet Address - - relayerRegistrationSMC Address - relayerRegistrationSMCTestnet Address - lendingRegistrationSMC Address - lendingRegistrationSMCTestnet Address + trc21IssuerSMC Address + xdcxListingSMC Address + relayerRegistrationSMC Address + lendingRegistrationSMC Address ignoreSignerCheckBlockArray map[uint64]struct{} blacklist map[Address]struct{} } -// variables for specific networks, copy values from MaintnetConstant to pass tests +// variables for specific networks, copy values from maintnet constant to pass tests var ( BlackListHFNumber = MaintnetConstant.blackListHFNumber MaxMasternodesV2 = MaintnetConstant.maxMasternodesV2 // Last v1 masternodes - TIP2019Block = MaintnetConstant.tip2019Block - TIPSigning = MaintnetConstant.tipSigning - TIPRandomize = MaintnetConstant.tipRandomize - TIPNoHalvingMNReward = MaintnetConstant.tipNoHalvingMNReward - TIPXDCX = MaintnetConstant.tipXDCX - TIPXDCXLending = MaintnetConstant.tipXDCXLending - TIPXDCXCancellationFee = MaintnetConstant.tipXDCXCancellationFee - TIPXDCXCancellationFeeTestnet = MaintnetConstant.tipXDCXCancellationFeeTestnet - TIPTRC21Fee = MaintnetConstant.tipTRC21Fee - TIPTRC21FeeTestnet = MaintnetConstant.tipTRC21FeeTestnet - TIPIncreaseMasternodes = MaintnetConstant.tipIncreaseMasternodes - BerlinBlock = MaintnetConstant.berlinBlock - LondonBlock = MaintnetConstant.londonBlock - MergeBlock = MaintnetConstant.mergeBlock - ShanghaiBlock = MaintnetConstant.shanghaiBlock - BlockNumberGas50x = MaintnetConstant.blockNumberGas50x - TIPXDCXMinerDisable = MaintnetConstant.tipXDCXMinerDisable - TIPXDCXReceiverDisable = MaintnetConstant.tipXDCXReceiverDisable - Eip1559Block = MaintnetConstant.eip1559Block - CancunBlock = MaintnetConstant.cancunBlock - TIPUpgradeReward = MaintnetConstant.tipUpgradeReward - TIPEpochHalving = MaintnetConstant.tipEpochHalving + TIP2019Block = MaintnetConstant.tip2019Block + TIPSigning = MaintnetConstant.tipSigning + TIPRandomize = MaintnetConstant.tipRandomize + TIPNoHalvingMNReward = MaintnetConstant.tipNoHalvingMNReward + TIPXDCX = MaintnetConstant.tipXDCX + TIPXDCXLending = MaintnetConstant.tipXDCXLending + TIPXDCXCancellationFee = MaintnetConstant.tipXDCXCancellationFee + TIPTRC21Fee = MaintnetConstant.tipTRC21Fee + TIPIncreaseMasternodes = MaintnetConstant.tipIncreaseMasternodes + BerlinBlock = MaintnetConstant.berlinBlock + LondonBlock = MaintnetConstant.londonBlock + MergeBlock = MaintnetConstant.mergeBlock + ShanghaiBlock = MaintnetConstant.shanghaiBlock + BlockNumberGas50x = MaintnetConstant.blockNumberGas50x + TIPXDCXMinerDisable = MaintnetConstant.tipXDCXMinerDisable + TIPXDCXReceiverDisable = MaintnetConstant.tipXDCXReceiverDisable + Eip1559Block = MaintnetConstant.eip1559Block + CancunBlock = MaintnetConstant.cancunBlock - TRC21IssuerSMC = MaintnetConstant.trc21IssuerSMC - TRC21IssuerSMCTestNet = MaintnetConstant.trc21IssuerSMCTestNet - XDCXListingSMC = MaintnetConstant.xdcxListingSMC - XDCXListingSMCTestNet = MaintnetConstant.xdcxListingSMCTestNet - - RelayerRegistrationSMC = MaintnetConstant.relayerRegistrationSMC - RelayerRegistrationSMCTestnet = MaintnetConstant.relayerRegistrationSMCTestnet - LendingRegistrationSMC = MaintnetConstant.lendingRegistrationSMC - LendingRegistrationSMCTestnet = MaintnetConstant.lendingRegistrationSMCTestnet + TRC21IssuerSMC = MaintnetConstant.trc21IssuerSMC + XDCXListingSMC = MaintnetConstant.xdcxListingSMC + RelayerRegistrationSMC = MaintnetConstant.relayerRegistrationSMC + LendingRegistrationSMC = MaintnetConstant.lendingRegistrationSMC ignoreSignerCheckBlockArray = MaintnetConstant.ignoreSignerCheckBlockArray blacklist = MaintnetConstant.blacklist @@ -134,9 +118,9 @@ func IsInBlacklist(address *Address) bool { return ok } -// CopyConstans only handles testnet, devnet, local. It does not -// handles mainnet since the default value is from mainnet. -func CopyConstans(chainID uint64) { +// CopyConstants only handles testnet, devnet, local network. +// It skips mainnet since the default value is from mainnet. +func CopyConstants(chainID uint64) { var c *constant if chainID == TestnetConstant.chainID { c = &TestnetConstant @@ -158,9 +142,7 @@ func CopyConstans(chainID uint64) { TIPXDCX = c.tipXDCX TIPXDCXLending = c.tipXDCXLending TIPXDCXCancellationFee = c.tipXDCXCancellationFee - TIPXDCXCancellationFeeTestnet = c.tipXDCXCancellationFeeTestnet TIPTRC21Fee = c.tipTRC21Fee - TIPTRC21FeeTestnet = c.tipTRC21FeeTestnet TIPIncreaseMasternodes = c.tipIncreaseMasternodes BerlinBlock = c.berlinBlock LondonBlock = c.londonBlock @@ -171,18 +153,11 @@ func CopyConstans(chainID uint64) { TIPXDCXReceiverDisable = c.tipXDCXReceiverDisable Eip1559Block = c.eip1559Block CancunBlock = c.cancunBlock - TIPUpgradeReward = c.tipUpgradeReward - TIPEpochHalving = c.tipEpochHalving TRC21IssuerSMC = c.trc21IssuerSMC - TRC21IssuerSMCTestNet = c.trc21IssuerSMCTestNet XDCXListingSMC = c.xdcxListingSMC - XDCXListingSMCTestNet = c.xdcxListingSMCTestNet - RelayerRegistrationSMC = c.relayerRegistrationSMC - RelayerRegistrationSMCTestnet = c.relayerRegistrationSMCTestnet LendingRegistrationSMC = c.lendingRegistrationSMC - LendingRegistrationSMCTestnet = c.lendingRegistrationSMCTestnet clear(ignoreSignerCheckBlockArray) maps.Copy(ignoreSignerCheckBlockArray, c.ignoreSignerCheckBlockArray) diff --git a/common/constants.devnet.go b/common/constants.devnet.go index 9b263abbeb..fa4e1227d2 100644 --- a/common/constants.devnet.go +++ b/common/constants.devnet.go @@ -9,38 +9,30 @@ var DevnetConstant = constant{ blackListHFNumber: 0, maxMasternodesV2: 108, - tip2019Block: big.NewInt(0), - tipSigning: big.NewInt(0), - tipRandomize: big.NewInt(0), - tipNoHalvingMNReward: big.NewInt(0), - tipXDCX: big.NewInt(0), - tipXDCXLending: big.NewInt(0), - tipXDCXCancellationFee: big.NewInt(0), - tipXDCXCancellationFeeTestnet: big.NewInt(0), - tipTRC21Fee: big.NewInt(13523400), - tipTRC21FeeTestnet: big.NewInt(225000), - tipIncreaseMasternodes: big.NewInt(0), - berlinBlock: big.NewInt(0), - londonBlock: big.NewInt(0), - mergeBlock: big.NewInt(0), - shanghaiBlock: big.NewInt(0), - blockNumberGas50x: big.NewInt(0), - TIPV2SwitchBlock: big.NewInt(0), - tipXDCXMinerDisable: big.NewInt(0), - tipXDCXReceiverDisable: big.NewInt(0), - eip1559Block: big.NewInt(0), - cancunBlock: big.NewInt(1702800), - tipUpgradeReward: big.NewInt(1773000), + tip2019Block: big.NewInt(0), + tipSigning: big.NewInt(0), + tipRandomize: big.NewInt(0), + tipNoHalvingMNReward: big.NewInt(0), + tipXDCX: big.NewInt(0), + tipXDCXLending: big.NewInt(0), + tipXDCXCancellationFee: big.NewInt(0), + tipTRC21Fee: big.NewInt(13523400), + tipIncreaseMasternodes: big.NewInt(0), + berlinBlock: big.NewInt(0), + londonBlock: big.NewInt(0), + mergeBlock: big.NewInt(0), + shanghaiBlock: big.NewInt(0), + blockNumberGas50x: big.NewInt(0), + TIPV2SwitchBlock: big.NewInt(0), + tipXDCXMinerDisable: big.NewInt(0), + tipXDCXReceiverDisable: big.NewInt(0), + eip1559Block: big.NewInt(0), + cancunBlock: big.NewInt(1702800), - trc21IssuerSMC: HexToAddress("0x8c0faeb5C6bEd2129b8674F262Fd45c4e9468bee"), - trc21IssuerSMCTestNet: HexToAddress("0x0E2C88753131CE01c7551B726b28BFD04e44003F"), - xdcxListingSMC: HexToAddress("0xDE34dD0f536170993E8CFF639DdFfCF1A85D3E53"), - xdcxListingSMCTestNet: HexToAddress("0x14B2Bf043b9c31827A472CE4F94294fE9a6277e0"), - - relayerRegistrationSMC: HexToAddress("0x16c63b79f9C8784168103C0b74E6A59EC2de4a02"), - relayerRegistrationSMCTestnet: HexToAddress("0xA1996F69f47ba14Cb7f661010A7C31974277958c"), - lendingRegistrationSMC: HexToAddress("0x7d761afd7ff65a79e4173897594a194e3c506e57"), - lendingRegistrationSMCTestnet: HexToAddress("0x28d7fC2Cf5c18203aaCD7459EFC6Af0643C97bE8"), + trc21IssuerSMC: HexToAddress("0x8c0faeb5C6bEd2129b8674F262Fd45c4e9468bee"), + xdcxListingSMC: HexToAddress("0xDE34dD0f536170993E8CFF639DdFfCF1A85D3E53"), + relayerRegistrationSMC: HexToAddress("0x16c63b79f9C8784168103C0b74E6A59EC2de4a02"), + lendingRegistrationSMC: HexToAddress("0x7d761afd7ff65a79e4173897594a194e3c506e57"), ignoreSignerCheckBlockArray: map[uint64]struct{}{ 1032300: {}, diff --git a/common/constants.local.go b/common/constants.local.go index e9c318bfaf..1e19bbcbc6 100644 --- a/common/constants.local.go +++ b/common/constants.local.go @@ -9,39 +9,30 @@ var localConstant = constant{ maxMasternodesV2: 108, blackListHFNumber: 0, - tip2019Block: big.NewInt(0), - tipSigning: big.NewInt(0), - tipRandomize: big.NewInt(0), - tipNoHalvingMNReward: big.NewInt(0), - tipXDCX: big.NewInt(0), - tipXDCXLending: big.NewInt(0), - tipXDCXCancellationFee: big.NewInt(0), - tipXDCXCancellationFeeTestnet: big.NewInt(0), - tipTRC21Fee: big.NewInt(13523400), - tipTRC21FeeTestnet: big.NewInt(225000), - tipIncreaseMasternodes: big.NewInt(0), - berlinBlock: big.NewInt(0), - londonBlock: big.NewInt(0), - mergeBlock: big.NewInt(0), - shanghaiBlock: big.NewInt(0), - blockNumberGas50x: big.NewInt(0), - TIPV2SwitchBlock: big.NewInt(0), - tipXDCXMinerDisable: big.NewInt(0), - tipXDCXReceiverDisable: big.NewInt(0), - eip1559Block: big.NewInt(0), - cancunBlock: big.NewInt(0), - tipUpgradeReward: big.NewInt(0), - tipEpochHalving: big.NewInt(0), + tip2019Block: big.NewInt(0), + tipSigning: big.NewInt(0), + tipRandomize: big.NewInt(0), + tipNoHalvingMNReward: big.NewInt(0), + tipXDCX: big.NewInt(0), + tipXDCXLending: big.NewInt(0), + tipXDCXCancellationFee: big.NewInt(0), + tipTRC21Fee: big.NewInt(0), + tipIncreaseMasternodes: big.NewInt(0), + berlinBlock: big.NewInt(0), + londonBlock: big.NewInt(0), + mergeBlock: big.NewInt(0), + shanghaiBlock: big.NewInt(0), + blockNumberGas50x: big.NewInt(0), + TIPV2SwitchBlock: big.NewInt(0), + tipXDCXMinerDisable: big.NewInt(0), + tipXDCXReceiverDisable: big.NewInt(0), + eip1559Block: big.NewInt(0), + cancunBlock: big.NewInt(0), - trc21IssuerSMC: HexToAddress("0x8c0faeb5C6bEd2129b8674F262Fd45c4e9468bee"), - trc21IssuerSMCTestNet: HexToAddress("0x0E2C88753131CE01c7551B726b28BFD04e44003F"), - xdcxListingSMC: HexToAddress("0xDE34dD0f536170993E8CFF639DdFfCF1A85D3E53"), - xdcxListingSMCTestNet: HexToAddress("0x14B2Bf043b9c31827A472CE4F94294fE9a6277e0"), - - relayerRegistrationSMC: HexToAddress("0x16c63b79f9C8784168103C0b74E6A59EC2de4a02"), - relayerRegistrationSMCTestnet: HexToAddress("0xA1996F69f47ba14Cb7f661010A7C31974277958c"), - lendingRegistrationSMC: HexToAddress("0x7d761afd7ff65a79e4173897594a194e3c506e57"), - lendingRegistrationSMCTestnet: HexToAddress("0x28d7fC2Cf5c18203aaCD7459EFC6Af0643C97bE8"), + trc21IssuerSMC: HexToAddress("0x8c0faeb5C6bEd2129b8674F262Fd45c4e9468bee"), + xdcxListingSMC: HexToAddress("0xDE34dD0f536170993E8CFF639DdFfCF1A85D3E53"), + relayerRegistrationSMC: HexToAddress("0x16c63b79f9C8784168103C0b74E6A59EC2de4a02"), + lendingRegistrationSMC: HexToAddress("0x7d761afd7ff65a79e4173897594a194e3c506e57"), ignoreSignerCheckBlockArray: map[uint64]struct{}{}, diff --git a/common/constants.mainnet.go b/common/constants.mainnet.go index bae150f74e..600cc9c8fb 100644 --- a/common/constants.mainnet.go +++ b/common/constants.mainnet.go @@ -9,38 +9,30 @@ var MaintnetConstant = constant{ blackListHFNumber: 38383838, maxMasternodesV2: 108, - tip2019Block: big.NewInt(1), - tipSigning: big.NewInt(3000000), - tipRandomize: big.NewInt(3464000), - tipNoHalvingMNReward: big.NewInt(38383838), - tipXDCX: big.NewInt(38383838), - tipXDCXLending: big.NewInt(38383838), - tipXDCXCancellationFee: big.NewInt(38383838), - tipXDCXCancellationFeeTestnet: big.NewInt(38383838), - tipTRC21Fee: big.NewInt(38383838), - tipTRC21FeeTestnet: big.NewInt(38383838), - tipIncreaseMasternodes: big.NewInt(5000000), - berlinBlock: big.NewInt(76321000), // Target 19th June 2024 - londonBlock: big.NewInt(76321000), // Target 19th June 2024 - mergeBlock: big.NewInt(76321000), // Target 19th June 2024 - shanghaiBlock: big.NewInt(76321000), // Target 19th June 2024 - blockNumberGas50x: big.NewInt(80370000), // Target 2nd Oct 2024 - TIPV2SwitchBlock: big.NewInt(80370000), // Target 2nd Oct 2024 - tipXDCXMinerDisable: big.NewInt(80370000), // Target 2nd Oct 2024 - tipXDCXReceiverDisable: big.NewInt(80370900), // Target 2nd Oct 2024, safer to release after disable miner - eip1559Block: big.NewInt(9999999999), - cancunBlock: big.NewInt(9999999999), - tipUpgradeReward: big.NewInt(9999999999), + tip2019Block: big.NewInt(1), + tipSigning: big.NewInt(3000000), + tipRandomize: big.NewInt(3464000), + tipNoHalvingMNReward: big.NewInt(38383838), + tipXDCX: big.NewInt(38383838), + tipXDCXLending: big.NewInt(38383838), + tipXDCXCancellationFee: big.NewInt(38383838), + tipTRC21Fee: big.NewInt(38383838), + tipIncreaseMasternodes: big.NewInt(5000000), + berlinBlock: big.NewInt(76321000), // Target 19th June 2024 + londonBlock: big.NewInt(76321000), // Target 19th June 2024 + mergeBlock: big.NewInt(76321000), // Target 19th June 2024 + shanghaiBlock: big.NewInt(76321000), // Target 19th June 2024 + blockNumberGas50x: big.NewInt(80370000), // Target 2nd Oct 2024 + TIPV2SwitchBlock: big.NewInt(80370000), // Target 2nd Oct 2024 + tipXDCXMinerDisable: big.NewInt(80370000), // Target 2nd Oct 2024 + tipXDCXReceiverDisable: big.NewInt(80370900), // Target 2nd Oct 2024, safer to release after disable miner + eip1559Block: big.NewInt(9999999999), + cancunBlock: big.NewInt(9999999999), - trc21IssuerSMC: HexToAddress("0x8c0faeb5C6bEd2129b8674F262Fd45c4e9468bee"), - trc21IssuerSMCTestNet: HexToAddress("0x0E2C88753131CE01c7551B726b28BFD04e44003F"), - xdcxListingSMC: HexToAddress("0xDE34dD0f536170993E8CFF639DdFfCF1A85D3E53"), - xdcxListingSMCTestNet: HexToAddress("0x14B2Bf043b9c31827A472CE4F94294fE9a6277e0"), - - relayerRegistrationSMC: HexToAddress("0x16c63b79f9C8784168103C0b74E6A59EC2de4a02"), - relayerRegistrationSMCTestnet: HexToAddress("0xA1996F69f47ba14Cb7f661010A7C31974277958c"), - lendingRegistrationSMC: HexToAddress("0x7d761afd7ff65a79e4173897594a194e3c506e57"), - lendingRegistrationSMCTestnet: HexToAddress("0x28d7fC2Cf5c18203aaCD7459EFC6Af0643C97bE8"), + trc21IssuerSMC: HexToAddress("0x8c0faeb5C6bEd2129b8674F262Fd45c4e9468bee"), + xdcxListingSMC: HexToAddress("0xDE34dD0f536170993E8CFF639DdFfCF1A85D3E53"), + relayerRegistrationSMC: HexToAddress("0x16c63b79f9C8784168103C0b74E6A59EC2de4a02"), + lendingRegistrationSMC: HexToAddress("0x7d761afd7ff65a79e4173897594a194e3c506e57"), ignoreSignerCheckBlockArray: map[uint64]struct{}{ 1032300: {}, diff --git a/common/constants.testnet.go b/common/constants.testnet.go index 23acf1f425..cf5f986b5c 100644 --- a/common/constants.testnet.go +++ b/common/constants.testnet.go @@ -16,9 +16,7 @@ var TestnetConstant = constant{ tipXDCX: big.NewInt(23779191), tipXDCXLending: big.NewInt(23779191), tipXDCXCancellationFee: big.NewInt(23779191), - tipXDCXCancellationFeeTestnet: big.NewInt(23779191), tipTRC21Fee: big.NewInt(23779191), - tipTRC21FeeTestnet: big.NewInt(23779191), tipIncreaseMasternodes: big.NewInt(5000000), blockNumberGas50x: big.NewInt(56828700), // Target 13rd Nov 2023 TIPV2SwitchBlock: big.NewInt(56828700), // Target 13rd Nov 2023 @@ -30,17 +28,11 @@ var TestnetConstant = constant{ tipXDCXReceiverDisable: big.NewInt(66825000), // Target 26 Aug 2024 eip1559Block: big.NewInt(71550000), // Target 14th Feb 2025 cancunBlock: big.NewInt(73425600), - tipUpgradeReward: big.NewInt(9999999999), - trc21IssuerSMC: HexToAddress("0x8c0faeb5C6bEd2129b8674F262Fd45c4e9468bee"), - trc21IssuerSMCTestNet: HexToAddress("0x0E2C88753131CE01c7551B726b28BFD04e44003F"), - xdcxListingSMC: HexToAddress("0xDE34dD0f536170993E8CFF639DdFfCF1A85D3E53"), - xdcxListingSMCTestNet: HexToAddress("0x14B2Bf043b9c31827A472CE4F94294fE9a6277e0"), - - relayerRegistrationSMC: HexToAddress("0x16c63b79f9C8784168103C0b74E6A59EC2de4a02"), - relayerRegistrationSMCTestnet: HexToAddress("0xA1996F69f47ba14Cb7f661010A7C31974277958c"), - lendingRegistrationSMC: HexToAddress("0x7d761afd7ff65a79e4173897594a194e3c506e57"), - lendingRegistrationSMCTestnet: HexToAddress("0x28d7fC2Cf5c18203aaCD7459EFC6Af0643C97bE8"), + trc21IssuerSMC: HexToAddress("0x0E2C88753131CE01c7551B726b28BFD04e44003F"), + xdcxListingSMC: HexToAddress("0x14B2Bf043b9c31827A472CE4F94294fE9a6277e0"), + relayerRegistrationSMC: HexToAddress("0xA1996F69f47ba14Cb7f661010A7C31974277958c"), + lendingRegistrationSMC: HexToAddress("0x28d7fC2Cf5c18203aaCD7459EFC6Af0643C97bE8"), ignoreSignerCheckBlockArray: map[uint64]struct{}{ 1032300: {}, diff --git a/consensus/XDPoS/api.go b/consensus/XDPoS/api.go index bdd3b1f8bc..420f0d7d59 100644 --- a/consensus/XDPoS/api.go +++ b/consensus/XDPoS/api.go @@ -261,17 +261,10 @@ func (api *API) NetworkInformation() NetworkInformation { info := NetworkInformation{} info.NetworkId = api.chain.Config().ChainId info.XDCValidatorAddress = common.MasternodeVotingSMCBinary - if common.IsTestnet { - info.LendingAddress = common.LendingRegistrationSMCTestnet - info.RelayerRegistrationAddress = common.RelayerRegistrationSMCTestnet - info.XDCXListingAddress = common.XDCXListingSMCTestNet - info.XDCZAddress = common.TRC21IssuerSMCTestNet - } else { - info.LendingAddress = common.LendingRegistrationSMC - info.RelayerRegistrationAddress = common.RelayerRegistrationSMC - info.XDCXListingAddress = common.XDCXListingSMC - info.XDCZAddress = common.TRC21IssuerSMC - } + info.LendingAddress = common.LendingRegistrationSMC + info.RelayerRegistrationAddress = common.RelayerRegistrationSMC + info.XDCXListingAddress = common.XDCXListingSMC + info.XDCZAddress = common.TRC21IssuerSMC info.ConsensusConfigs = *api.XDPoS.config return info diff --git a/core/types/transaction.go b/core/types/transaction.go index 369127c4c0..00b65fa0a7 100644 --- a/core/types/transaction.go +++ b/core/types/transaction.go @@ -547,15 +547,7 @@ func (tx *Transaction) IsVotingTransaction() (bool, *common.Address) { func (tx *Transaction) IsXDCXApplyTransaction() bool { to := tx.To() - if to == nil { - return false - } - - addr := common.XDCXListingSMC - if common.IsTestnet { - addr = common.XDCXListingSMCTestNet - } - if *to != addr { + if to == nil || *to != common.XDCXListingSMC { return false } data := tx.Data() @@ -570,15 +562,7 @@ func (tx *Transaction) IsXDCXApplyTransaction() bool { func (tx *Transaction) IsXDCZApplyTransaction() bool { to := tx.To() - if to == nil { - return false - } - - addr := common.TRC21IssuerSMC - if common.IsTestnet { - addr = common.TRC21IssuerSMCTestNet - } - if *to != addr { + if to == nil || *to != common.TRC21IssuerSMC { return false } data := tx.Data() diff --git a/eth/backend.go b/eth/backend.go index 1b9797540f..c6690e78eb 100644 --- a/eth/backend.go +++ b/eth/backend.go @@ -135,7 +135,7 @@ func New(ctx *node.ServiceContext, config *ethconfig.Config, XDCXServ *XDCx.XDCX if networkID == 0 { networkID = chainConfig.ChainId.Uint64() } - common.CopyConstans(networkID) + common.CopyConstants(networkID) log.Info(strings.Repeat("-", 153)) for _, line := range strings.Split(chainConfig.Description(), "\n") { diff --git a/params/config.go b/params/config.go index aa7eb0562d..99982f88f5 100644 --- a/params/config.go +++ b/params/config.go @@ -602,8 +602,6 @@ func (c *ChainConfig) Description() string { banner += fmt.Sprintf(" - Shanghai: %-8v\n", shanghaiBlock) banner += fmt.Sprintf(" - Eip1559: %-8v\n", eip1559Block) banner += fmt.Sprintf(" - Cancun: %-8v\n", cancunBlock) - banner += fmt.Sprintf(" - TIPUpgradeReward: %-8v\n", common.TIPUpgradeReward) - banner += fmt.Sprintf(" - TIPEpochHalving: %-8v\n", common.TIPEpochHalving) banner += fmt.Sprintf(" - Engine: %v", engine) return banner }