go-ethereum/cmd/XDC
Daniel Liu 1a9935625f
cmd/XDC: fix txpool gasPrice being overridden at checkpoints (#1878)
This commit removes two redundant SetGasPrice() calls in the startNode function that were causing multiple issues:

1. Overriding txpool's configured price limit with the miner's gas price setting, mixing two independent configurations:

- cfg.Eth.GasPrice (from --miner-gasprice --gasprice flag)
- cfg.TxPool.PriceLimit (from --txpool-pricelimit flag)

2. Reverting runtime gasPrice changes made via RPC. When users call miner_setGasPrice RPC method to adjust the gasPrice dynamically, the changes would be unexpectedly reverted at the next checkpoint when startNode re-applies cfg.Eth.GasPrice.

The txpool already initializes its gasPrice from config.PriceLimit during construction (core/txpool/txpool.go:333):

```go
func NewTxPool(config Config, chainconfig *params.ChainConfig, chain blockChain) *TxPool {
	pool := &TxPool{
		gasPrice:         new(big.Int).SetUint64(config.PriceLimit),
	}
```

When mining is started via RPC (miner_start), the MinerAPI.Start() method handles gasPrice propagation correctly.

This change ensures:

- The txpool respects its own configuration
- Runtime gasPrice adjustments via RPC persist across checkpoints
- No unexpected overriding of user-configured values
2025-12-22 12:01:38 +05:30
..
testdata all: normalize flag's name 2024-11-25 16:39:29 +08:00
accountcmd.go cmd: replace passPHRASE with passWORD in any user interactions #19932 (#1535) 2025-09-21 19:31:00 +08:00
accountcmd_test.go cmd, console: drop geth js command #25000 (#1534) 2025-09-24 07:47:21 +08:00
chaincmd.go all: use 0x-prefix string for type Address in log message (#1874) 2025-12-19 08:55:21 +04:00
config.go all: replace strings.Split with more efficient strings.SplitSeq (#1698) 2025-12-07 15:42:23 +05:30
consolecmd.go cmd/XDC, metrics/prometheus: fix staticcheck QF1012 (#1713) 2025-12-07 16:03:06 +05:30
consolecmd_test.go all: upgrade package version #30638 (#1745) 2025-11-15 16:46:54 +05:30
dao_test.go all: use T.TempDir to create temporary test directories (#24633) 2025-01-24 16:54:08 +08:00
dbcmd.go cmd, core, eth, trie: track deleted nodes #22225 #25757 (#1120) 2025-11-12 13:32:22 +05:30
main.go cmd/XDC: fix txpool gasPrice being overridden at checkpoints (#1878) 2025-12-22 12:01:38 +05:30
misccmd.go all: upgrade package version #30638 (#1745) 2025-11-15 16:46:54 +05:30
run_test.go all: use T.TempDir to create temporary test directories (#24633) 2025-01-24 16:54:08 +08:00
transactions.rlp new EVM Upgrade 2021-09-21 16:53:46 +05:30