Read randomize values at the checkpoint parent height during v1 HookValidator and HookVerifyMNs instead of the latest chain state. This fixes a sync-time race where historical checkpoint headers could be rejected with ErrInvalidCheckpointValidators and then accepted later after local state advanced.
The accompanying regression test now derives expected validators independently from HookValidator and the M2 generation path uses a local RNG source, removing CI-only nondeterminism during repeated verification.
Use pool pending nonce when creating the imported-block sign transaction.
Previously the code used state nonce, which could lag behind pool nonce when a pending tx with the same sender already existed. In that case, adding the new sign tx could hit replacement checks and fail with 'replacement transaction underpriced'.
This change switches nonce selection to PoolNonce to avoid nonce reuse in the local pool and prevent repeated sign insertion failures after block import.
* refactor(txpool): remove wrapper type #27841
Partial backport of ethereum/go-ethereum PR #27841, limited to txpool wrapper removal.
- Migrate txpool interfaces/call sites from `*txpool.Transaction` to `*types.Transaction`
- Update eth/miner/contracts paths and related tests accordingly
- No intended behavior change
Blob sidecar validation/handling changes from upstream are not included here.
* refactor(core/txpool): migrate tx subscription to SubscribeTransactions #28243
Replace the old SubscribeNewTxsEvent-style plumbing with the new
SubscribeTransactions(ch, reorgs) interface across txpool, eth protocol
manager, API backend, miner worker, and test helpers.
Key changes:
- Extend txpool/subpool tx subscription interface with a reorgs flag
- Route eth tx announcement path to reorgs=false (new tx announcements only)
- Route API/miner subscriptions to reorgs=true
- Move subscription-scope cleanup to TxPool.Close()
- Add Gas field to LazyTransaction in legacy pending view
Note:
LegacyPool currently cannot strictly separate newly seen and resurrected txs,
so the reorgs flag is accepted for API compatibility and future blob-subpool
integration.
* v2 Hook Reward, need test
* test reward
* fix RewardHook due to modifying params config directly (#56)
* more test
* finish test
Co-authored-by: Jerome <wjrjerome@gmail.com>
* add isEpochSwitch function and refactor utils
* fix broken first v2 epoch switch block
* use adaptor epoch switch function to determine v1 v2 epoch swtich block
* add test for the GetMasternodesByNumber and GetCurrentEpochSwitchBlock function
* add v2 test for isAuthroisedAddress
* Use GetCurrentEpochSwitchBlock in findNearestSignedBlock api