params/config_etc.go — Version Comparison
|
v1.17.3 |
v1.17.4 |
| Branch |
etc/v1.17.3-full-node |
etc/v1.17.4-full-node |
| Delta |
+330 -0 |
+341 -0 |
Diff between branches
diff --git a/params/config_etc.go b/params/config_etc.go
index 21569677b..6e9f9a592 100644
--- a/params/config_etc.go
+++ b/params/config_etc.go
@@ -112,8 +112,12 @@ var (
}
)
-// IsClassic returns whether this chain is an Ethereum Classic chain.
-// ETC mainnet has ChainID 61, Mordor testnet has ChainID 63.
+// IsClassic returns whether this config is one of the well-known Ethereum
+// Classic networks: ETC mainnet (ChainID 61) or Mordor testnet (ChainID 63).
+// It identifies presets for datadir/genesis resolution and CLI purposes only;
+// consensus rules never branch on it. Block-validity behavior is derived from
+// the individual config keys (IsPow, IsEIP1559, the ECIP fields), so custom
+// chains get ETC semantics by setting those keys, not by borrowing a chain ID.
func (c *ChainConfig) IsClassic() bool {
if c.ChainID == nil {
return false
@@ -184,11 +188,19 @@ func (c *ChainConfig) IsSpiral(num *big.Int) bool {
}
// IsEIP1559 returns whether EIP-1559 (fee market) is active at the given block.
-// Note: ETC has London (Mystique) WITHOUT EIP-1559, so this returns false for ETC.
-// For most chains, IsEIP1559 is equivalent to IsLondon.
+// To date no perpetual PoW chain (ethash with no terminal total difficulty)
+// has activated a fee market: they run London as Mystique, i.e. the London
+// opcodes WITHOUT the fee market, so this defaults to false when IsPow. For
+// every other chain, IsEIP1559 is equivalent to IsLondon.
+//
+// This is a default, not a law of nature: a future fee-market activation on
+// ETC (e.g. ECIP-1120, which keeps the EIP-1559 mechanics and changes only
+// the base-fee disposition) would ship with its own activation key, checked
+// here ahead of the PoW default — everything downstream (base fee calc,
+// header validation, txpool, signer, RPC) already dispatches on this method.
func (c *ChainConfig) IsEIP1559(num *big.Int) bool {
- if c.IsClassic() {
- return false // ETC never has EIP-1559
+ if c.IsPow() {
+ return false // no perpetual PoW chain has activated a fee market so far
}
return c.IsLondon(num)
}
@@ -227,14 +239,13 @@ func (c *ChainConfig) IsECIP1099(num *big.Int) bool {
}
// isEIP160 returns true when EIP-160 (EXP gas cost increase) needs manual activation.
-// For ETC: Die Hard (ECIP-1010) activated EIP-160 at block 3M, but Atlantis (ECIP-1054)
-// activated EIP-161/170 at block 8.7M. Between these blocks, we need to patch the jump table.
-// For ETH: Spurious Dragon (EIP-607) activated all together, so this is always false.
+// The window only exists on configs that split Spurious Dragon: ETC's Die Hard
+// (ECIP-1010) activated EIP-155/160 at block 3M but delayed EIP-161/170 to Atlantis
+// (ECIP-1054, block 8.77M), so the jump table needs patching in between. Ethereum's
+// EIP-607 activated EIP-155 and EIP-158 at the same block, making the window empty
+// there by construction — no chain identity check is needed.
func (c *ChainConfig) isEIP160(num *big.Int) bool {
- if c.IsClassic() {
- return c.IsEIP155(num) && !c.IsEIP158(num)
- }
- return false
+ return c.IsEIP155(num) && !c.IsEIP158(num)
}
// checkCompatibleETC guards the ETC-specific fork blocks against incompatible changes.
@@ -247,8 +258,8 @@ func (c *ChainConfig) isEIP160(num *big.Int) bool {
// Enumerated on purpose: go-ethereum has always kept checkCompatible enumerated (only the
// fork ID was moved to reflection), so this mirrors upstream's style and stays rebase-
// friendly. TestETCForkCompatibilityCoverage enforces that every fork-ID *Block is guarded
-// here, giving us the fork-ID↔compatibility symmetry core-geth gets from its reflective
-// confp system — without importing reflection into production code.
+// here, giving us the fork-ID↔compatibility symmetry that a reflective config system would
+// provide — without importing reflection into production code.
//
// MESS (ECBP1100Transition / ECBP1100DeactivateTransition) is intentionally excluded, just
// like it is excluded from the fork ID: it is a fork-choice/reorg policy, not a block-
← Back to Version Comparison