Documentation
¶
Index ¶
- Variables
- func ApplyDAOHardFork(statedb *state.StateDB)
- func ApplyIncidentRecoveryHardFork(statedb *state.StateDB, deleteEmptyObjects bool)
- func VerifyDAOHeaderExtraData(config *params.ChainConfig, header *types.Header) error
- func VerifyForkHashes(config *params.ChainConfig, header *types.Header, uncle bool) error
Constants ¶
This section is empty.
Variables ¶
var ( // ErrBadProDAOExtra is returned if a header doens't support the DAO fork on a // pro-fork client. ErrBadProDAOExtra = errors.New("bad DAO pro-fork extra-data") // ErrBadNoDAOExtra is returned if a header does support the DAO fork on a no- // fork client. ErrBadNoDAOExtra = errors.New("bad DAO no-fork extra-data") )
Functions ¶
func ApplyDAOHardFork ¶
ApplyDAOHardFork modifies the state database according to the DAO hard-fork rules, transferring all balances of a set of DAO accounts to a single refund contract.
func ApplyIncidentRecoveryHardFork ¶ added in v0.2.8
ApplyIncidentRecoveryHardFork destroys the unbacked ELA that the CrossChain exploit minted, reducing ESC's native supply so it re-pegs to the mainchain reserve.
This is a BURN, not a transfer. EVM native supply is implicit -- it is the sum of all account balances -- so the only way to reduce it is to deduct and credit nobody. Moving the balance to a sink address (including the zero address, which is an ordinary account in EVM state and is credited like any other) is supply-NEUTRAL and would leave the peg exactly as broken as before. This fork deliberately has no destination.
It is deliberately NOT modelled on ApplyDAOHardFork. The DAO fork was a REASSIGNMENT -- funds moved to a WithdrawDAO contract so holders could claim them back, and preserving supply was the point. The goal here is the opposite.
The amount burned per account is the EXACT over-issuance recorded in params.IncidentRecoveryBurnList, not the account's balance. The freeze only bars the incident accounts from SENDING, so anyone may still send TO them between the freeze height and this fork; a balance sweep would destroy those funds. Burning min(balance, over-issuance) is deterministic across validators and leaves anything else untouched.
deleteEmptyObjects must be the chain's IsEIP158 value for the fork block, and the trailing Finalise is load-bearing -- see the note below.
func VerifyDAOHeaderExtraData ¶
func VerifyDAOHeaderExtraData(config *params.ChainConfig, header *types.Header) error
VerifyDAOHeaderExtraData validates the extra-data field of a block header to ensure it conforms to DAO hard-fork rules.
DAO hard-fork extension to the header validity:
a) if the node is no-fork, do not accept blocks in the [fork, fork+10) range with the fork specific extra-data set b) if the node is pro-fork, require blocks in the specific range to have the unique extra-data set.
func VerifyForkHashes ¶
VerifyForkHashes verifies that blocks conforming to network hard-forks do have the correct hashes, to avoid clients going off on different chains. This is an optional feature.
Types ¶
This section is empty.