mirror of
https://github.com/ethereum/go-ethereum.git
synced 2026-06-19 21:31:37 +00:00
This commit simplifies the transaction pool's gas price validation logic while maintaining network security through the existing minimum gas price requirement. Changes: - Set default PriceLimit to 0 (was 1), allowing transactions with zero tip - Remove PriceLimit >= 1 validation in config sanitization - Simplify Pending() method by using EffectiveGasTipIntCmp consistently - Unify validateTxBasics() logic to use GasTipCapIntCmp for all transactions Key Points: 1. Economic Protection: All transactions still require gasPrice >= 12.5 Gwei (enforced by GetMinGasPrice check in validateTx), providing sufficient protection against DoS attacks even with zero tip. 2. Miner Incentives: Since XDPoSChain includes baseFee in miner rewards (unlike standard EIP-1559), miners still earn the full gasPrice even when tip is 0. This maintains miner revenue while allowing greater flexibility. 3. Special Transactions: BlockSigner and Randomize contract transactions remain exempt from gas price checks, as they are critical for consensus. 4. Code Quality: Reduces complexity by 11 lines and unifies validation logic, making the codebase more maintainable. Security Analysis: - No nil pointer risks: EffectiveGasTipIntCmp has built-in nil handling - No DoS vulnerability: 12.5 Gwei minimum ensures economic cost per transaction - EIP-1559 compatible: Existing minGasPrice check covers all validation needs - Backward compatible: Only relaxes restrictions, doesn't break existing behavior This change benefits system transactions and special use cases while maintaining all existing security guarantees through the network's minimum gas price floor. |
||
|---|---|---|
| .. | ||
| asm | ||
| bloombits | ||
| rawdb | ||
| state | ||
| tracing | ||
| txpool | ||
| types | ||
| vm | ||
| .gitignore | ||
| bench_test.go | ||
| block_validator.go | ||
| block_validator_test.go | ||
| blockchain.go | ||
| blockchain_insert.go | ||
| blockchain_reader.go | ||
| blockchain_test.go | ||
| blocks.go | ||
| chain_indexer.go | ||
| chain_indexer_test.go | ||
| chain_makers.go | ||
| chain_makers_test.go | ||
| dao_test.go | ||
| error.go | ||
| events.go | ||
| evm.go | ||
| gaspool.go | ||
| gen_genesis.go | ||
| genesis.go | ||
| genesis_alloc_devnet.go | ||
| genesis_alloc_mainnet.go | ||
| genesis_alloc_testnet.go | ||
| genesis_test.go | ||
| headerchain.go | ||
| mkalloc.go | ||
| sender_cacher.go | ||
| state_prefetcher.go | ||
| state_processor.go | ||
| state_processor_test.go | ||
| state_transition.go | ||
| token_validator.go | ||
| types.go | ||