Txpool priority cache lets base fee swings reduce proposers tips
The transaction pool caches each transaction's priority gas price and cost the first time it becomes executable, and never refreshes them. When the base fee later rises, the cached priority stays high while the real tip drops, so the packer keeps preferring a transaction that now pays almost nothing, reducing proposer rewards and delaying honest users.
VeChain Hayabusa Upgrade
Originally disclosed on Immunefi
57136 bc low txpool priority cache lets base fee swings reduce proposers tips
- Submitted on: Oct 23rd 2025 at 19:27:07 UTC by @v_c0d35
- Competition: Attackathon | VeChain Hayabusa Upgrade
- Report ID: #57136
- Report Type: Blockchain/DLT
- Severity: Low
- Target: https://github.com/vechain/thor/compare/v2.3.2...release/hayabusa
- Impacts: Modification of transaction fees outside of design parameters
Summary
TxPool caches each transaction’s priorityGasPrice and prepaid cost the first time Executable(...) returns true (txpool/tx_object.go:128-144) and never refreshes them. When base fee later increases, the cached values stay high even though EffectivePriorityFeePerGas(...) instantly drops. As a result, the txpool ordering keeps the stale entry at the front of the queue and the packer hands it to the packer first, delivering much smaller actual tips to proposers than current demand requires. This can be triggered by timing a base-fee jump after admission and degrades mempool fairness and proposer rewards.
Vulnerability Details
- TxObject.Executable computes and caches
priorityGasPrice = EffectivePriorityFeePerGas(baseFee, …)the first time the tx becomes executable and writes it underif !o.executable(txpool/tx_object.go:128-144). - Subsequent runs—triggered during housekeeping/wash and before every pack—skip that block, so
priorityGasPriceremains fixed even thoughEffectivePriorityFeePerGas(...)is computed from the latest base fee. - TxPool.wash sorts executable objects using the cached
priorityGasPrice(txpool/tx_pool.go:499-545), promoting stale values. - The packer loop consumes that ordering directly (cmd/thor/node/packer_loop.go:119-140). At runtime base-fee coverage is re-validated so the tx remains valid, but it now delivers an almost-zero tip.
- Because
o.costis cached the same way,txObjectMap.UpdatePendingCostcan under-estimate the payer’s outstanding spend after a base-fee spike, allowing a payer to hold more txs than their real energy/fee balance supports.
Impact Details
- Priority-fee mismatch: An attacker (or an unfortunate legitimate user) can be kept at the front of the queue with an effectively near-zero tip after a base-fee spike, starving proposers of expected rewards and delaying honest users who increase tips to match the new base fee.
- Energy accounting mismatch: Pending cost remains pegged to the old base fee, requiring consensus to re-evaluate and drop transactions repeatedly, increasing churn and reducing mempool fairness.
References
- txpool/tx_object.go — initial caching of priority/cost and missing refresh
- txpool/tx_pool.go — wash ordering driven by cached
priorityGasPrice - cmd/thor/node/packer_loop.go — packer consumes stale ordering without recomputing tips
Proof of Concept (PoC)
The PoC is a Go test that reproduces the stale priority cache once Hayabusa/dPoS is active. It does the following:
{% stepper %} {% step %}
Phase 1 — Setup & attacker tx admission
- Boot a Solo chain fork with Hayabusa/dPoS active and two validators.
- Create and sign an attacker dynamic-fee transaction and resolve it to a
txpool.TxObject. - Call
Executable(...)with a low base fee to populate the cached priority and cached cost. - Verify the cached priority matches the expected priority at the low base fee. {% endstep %}
{% step %}
Phase 2 — Base-fee spike & cached value staleness
- Simulate a base-fee spike.
- Call
Executable(...)again (or check cached fields) for the attacker object. - Observe that the cached
priorityGasPricestill reflects the old (low-base-fee) effective priority whileEffectivePriorityFeePerGas(...)computed with the new base fee is near-zero. {% endstep %}
{% step %}
Phase 3 — Honest higher-tip tx arrives
- Create and resolve a second (honest) dynamic-fee transaction with a higher tip suitable for the new base fee.
- Call
Executable(...)for the honest tx and verify its cached priority equals its actual effective priority under the new base fee. - Observe the queue ordering: cached values keep the attacker ahead even though the honest tx pays a larger real tip. {% endstep %}
{% step %}
Phase 4 — Outcome
- The stale cached ordering causes the attacker tx to be preferred in packing even though it provides far less real tip revenue after the base-fee jump.
- The test prints logs demonstrating the divergence between cached ordering and real tip amounts. {% endstep %} {% endstepper %}
PoC test code
Create a folder poc and save the following file as priority_fee_dpos_test.go:
package poc
import (
"fmt"
"math/big"
"reflect"
"testing"
"unsafe"
"github.com/stretchr/testify/require"
"github.com/vechain/thor/v2/builtin"
stakerpkg "github.com/vechain/thor/v2/builtin/staker"
"github.com/vechain/thor/v2/genesis"
"github.com/vechain/thor/v2/state"
"github.com/vechain/thor/v2/test/testchain"
"github.com/vechain/thor/v2/thor"
"github.com/vechain/thor/v2/tx"
"github.com/vechain/thor/v2/txpool"
)
// TestPriorityFeeStalenessDPoS reproduces the stale priority cache once Hayabusa/dPoS is active.
func TestPriorityFeeStalenessDPoS(t *testing.T) {
chain, err := testchain.NewWithFork(&thor.SoloFork, 180)
require.NoError(t, err)
repo := chain.Repo()
stater := chain.Stater()
best := repo.BestBlockSummary()
require.NotNil(t, best)
fork := *chain.GetForkConfig()
fork.VIP191 = 0
fork.GALACTICA = 0
fork.HAYABUSA = 10
stakerState := stater.NewState(best.Root())
params := builtin.Params.Native(stakerState)
require.NoError(t, params.Set(thor.KeyMaxBlockProposers, big.NewInt(3)))
ts := newTestStaker(stakerState)
validator1 := thor.BytesToAddress([]byte("validator1"))
endorser1 := thor.BytesToAddress([]byte("endorser1"))
validator2 := thor.BytesToAddress([]byte("validator2"))
endorser2 := thor.BytesToAddress([]byte("endorser2"))
stakeAmount := stakerpkg.MinStakeVET
require.NoError(t, ts.AddValidation(validator1, endorser1, thor.MediumStakingPeriod(), stakeAmount))
require.NoError(t, ts.AddValidation(validator2, endorser2, thor.MediumStakingPeriod(), stakeAmount))
originalTP := thor.HayabusaTP()
defer thor.SetConfig(thor.Config{HayabusaTP: &originalTP})
hayabusaTP := uint32(10)
thor.SetConfig(thor.Config{HayabusaTP: &hayabusaTP})
status, err := ts.impl.SyncPOS(&fork, 180)
require.NoError(t, err)
require.True(t, status.Active, "dPoS should be active after Hayabusa")
t.Logf("[setup] Hayabusa/DPos active: %v", status.Active)
signer := genesis.DevAccounts()[0]
target := thor.BytesToAddress([]byte("sink"))
attackerTx := tx.NewBuilder(tx.TypeDynamicFee).
ChainTag(repo.ChainTag()).
Clause(tx.NewClause(&target)).
Gas(21000).
BlockRef(tx.NewBlockRef(best.Header.Number())).
Expiration(1000).
MaxFeePerGas(big.NewInt(1200)).
MaxPriorityFeePerGas(big.NewInt(100)).
Nonce(0).
Build()
attackerTx = tx.MustSign(attackerTx, signer.PrivateKey)
attackerObj, err := txpool.ResolveTx(attackerTx, true)
require.NoError(t, err)
baseFeeLow := big.NewInt(100)
baseFeeHigh := big.NewInt(1199)
chainView := repo.NewChain(best.Header.ID())
stateLow := stater.NewState(best.Root())
executable, err := attackerObj.Executable(chainView, stateLow, best.Header, &fork, baseFeeLow)
require.NoError(t, err)
require.True(t, executable)
cachedLow := cachedPriority(attackerObj)
require.NotNil(t, cachedLow)
require.Equal(t, int64(100), cachedLow.Int64())
t.Logf("[phase-1] attacker cached priority at baseFee=100: %s wei", cachedLow.String())
legacyBaseGasPrice, err := builtin.Params.Native(stateLow).Get(thor.KeyLegacyTxBaseGasPrice)
require.NoError(t, err)
expectedLow := attackerTx.EffectivePriorityFeePerGas(baseFeeLow, legacyBaseGasPrice, big.NewInt(0))
require.Equal(t, int64(100), expectedLow.Int64())
t.Logf("[phase-1] attacker effective priority (same baseFee): %s wei", expectedLow.String())
setExecutable(attackerObj, true)
stateHigh := stater.NewState(best.Root())
executable, err = attackerObj.Executable(chainView, stateHigh, best.Header, &fork, baseFeeHigh)
require.NoError(t, err)
require.True(t, executable)
cachedHigh := cachedPriority(attackerObj)
require.NotNil(t, cachedHigh)
require.Equal(t, int64(100), cachedHigh.Int64())
t.Logf("[phase-2] attacker cached priority after baseFee=1199: %s wei (stale)", cachedHigh.String())
expectedHigh := attackerTx.EffectivePriorityFeePerGas(baseFeeHigh, legacyBaseGasPrice, big.NewInt(0))
require.Equal(t, int64(1), expectedHigh.Int64())
t.Logf("[phase-2] attacker effective priority after baseFee jump: %s wei (actual tip)", expectedHigh.String())
honestTx := tx.NewBuilder(tx.TypeDynamicFee).
ChainTag(repo.ChainTag()).
Clause(tx.NewClause(&target)).
Gas(21000).
BlockRef(tx.NewBlockRef(best.Header.Number())).
Expiration(1000).
MaxFeePerGas(big.NewInt(2000)).
MaxPriorityFeePerGas(big.NewInt(20)).
Nonce(1).
Build()
honestTx = tx.MustSign(honestTx, signer.PrivateKey)
honestObj, err := txpool.ResolveTx(honestTx, true)
require.NoError(t, err)
stateHonest := stater.NewState(best.Root())
executable, err = honestObj.Executable(chainView, stateHonest, best.Header, &fork, baseFeeHigh)
require.NoError(t, err)
require.True(t, executable)
setExecutable(honestObj, true)
cachedHonest := cachedPriority(honestObj)
require.NotNil(t, cachedHonest)
require.Equal(t, int64(20), cachedHonest.Int64())
t.Logf("[phase-3] honest cached priority at baseFee=1199: %s wei", cachedHonest.String())
expectedHonest := honestTx.EffectivePriorityFeePerGas(baseFeeHigh, legacyBaseGasPrice, big.NewInt(0))
require.Equal(t, int64(20), expectedHonest.Int64())
t.Logf("[phase-3] honest effective priority at baseFee=1199: %s wei", expectedHonest.String())
require.True(t, cachedHigh.Cmp(cachedHonest) > 0, "stale cache keeps attacker ahead")
require.True(t, expectedHigh.Cmp(expectedHonest) < 0, "real tips show attacker pays less")
t.Logf("[result] cached ordering => attacker(%s) > honest(%s)", cachedHigh.String(), cachedHonest.String())
t.Logf("[result] real tips => attacker(%s) < honest(%s)", expectedHigh.String(), expectedHonest.String())
}
type testStaker struct {
addr thor.Address
state *state.State
impl *stakerpkg.Staker
}
func newTestStaker(state *state.State) *testStaker {
ts := &testStaker{
addr: builtin.Staker.Address,
state: state,
impl: builtin.Staker.Native(state),
}
state.SetStorage(ts.addr, thor.Bytes32{}, thor.Bytes32{})
return ts
}
func (ts *testStaker) addBalance(amount uint64) error {
wei := stakerpkg.ToWei(amount)
current, err := ts.state.GetStorage(ts.addr, thor.Bytes32{})
if err != nil {
return err
}
effective := new(big.Int).SetBytes(current.Bytes())
effective.Add(effective, wei)
ts.state.SetStorage(ts.addr, thor.Bytes32{}, thor.BytesToBytes32(effective.Bytes()))
balance, err := ts.state.GetBalance(ts.addr)
if err != nil {
return err
}
return ts.state.SetBalance(ts.addr, new(big.Int).Add(balance, wei))
}
func (ts *testStaker) subBalance(amount uint64) error {
wei := stakerpkg.ToWei(amount)
current, err := ts.state.GetStorage(ts.addr, thor.Bytes32{})
if err != nil {
return err
}
effective := new(big.Int).SetBytes(current.Bytes())
if effective.Cmp(wei) < 0 {
return fmt.Errorf("insufficient effective balance")
}
effective.Sub(effective, wei)
ts.state.SetStorage(ts.addr, thor.Bytes32{}, thor.BytesToBytes32(effective.Bytes()))
balance, err := ts.state.GetBalance(ts.addr)
if err != nil {
return err
}
if balance.Cmp(wei) < 0 {
return fmt.Errorf("insufficient balance")
}
return ts.state.SetBalance(ts.addr, new(big.Int).Sub(balance, wei))
}
func (ts *testStaker) AddValidation(validator, endorser thor.Address, period uint32, stake uint64) error {
if period != thor.LowStakingPeriod() && period != thor.MediumStakingPeriod() && period != thor.HighStakingPeriod() {
period = thor.MediumStakingPeriod()
}
if err := ts.addBalance(stake); err != nil {
return err
}
if err := ts.impl.AddValidation(validator, endorser, period, stake); err != nil {
_ = ts.subBalance(stake)
return err
}
return nil
}
func cachedPriority(obj *txpool.TxObject) *big.Int {
val := reflect.ValueOf(obj).Elem().FieldByName("priorityGasPrice")
if val.IsNil() {
return nil
}
ptr := (*big.Int)(unsafe.Pointer(val.UnsafePointer()))
return new(big.Int).Set(ptr)
}
func setExecutable(obj *txpool.TxObject, value bool) {
val := reflect.ValueOf(obj).Elem().FieldByName("executable")
reflect.NewAt(val.Type(), unsafe.Pointer(val.UnsafeAddr())).Elem().SetBool(value)
}
Run the test:
GOCACHE=$(pwd)/.cache-go go test -v ./poc -run TestPriorityFeeStalenessDPoS -count=1
Expected Output
<details> <summary>Verbose test output (click to expand)</summary>=== RUN TestPriorityFeeStalenessDPoS
priority_fee_dpos_test.go:49: [setup] Hayabusa/DPos active: true
priority_fee_dpos_test.go:68: [phase-1] attacker cached priority at baseFee=100: 100 wei
priority_fee_dpos_test.go:74: [phase-1] attacker effective priority (same baseFee): 100 wei
priority_fee_dpos_test.go:91: [phase-2] attacker cached priority after baseFee=1199: 100 wei (stale)
priority_fee_dpos_test.go:95: [phase-2] attacker effective priority after baseFee jump: 1 wei (actual tip)
priority_fee_dpos_test.go:114: [phase-3] honest cached priority at baseFee=1199: 20 wei
priority_fee_dpos_test.go:118: [phase-3] honest effective priority at baseFee=1199: 20 wei
priority_fee_dpos_test.go:125: [result] cached ordering => attacker(100) > honest(20)
priority_fee_dpos_test.go:126: [result] real tips => attacker(1) < honest(20)
--- PASS: TestPriorityFeeStalenessDPoS (0.31s)
PASS
Notes
- The PoC inspects and toggles internal fields via reflection to demonstrate the caching behavior; it is intended for testing in a development environment.
- The core issue is deterministic: caching
priorityGasPriceandcostonce and never refreshing them allows stale values to persist when the base fee changes, leading to incorrect ordering and accounting.
Context
VeChain's thor node keeps a transaction pool (txpool) that holds pending transactions and a packer that selects them for inclusion in blocks. The target of this report is the Hayabusa upgrade branch, compared against v2.3.2:
https://github.com/vechain/thor/compare/v2.3.2...release/hayabusa
The report type is Blockchain/DLT and the severity is Low, with the stated impact "Modification of transaction fees outside of design parameters".
Under a dynamic-fee model, a transaction carries a maximum fee per gas and a maximum priority fee per gas. The effective priority fee, the tip the proposer actually receives, depends on the current base fee. The txpool needs to order pending transactions by that tip so that the packer picks the most valuable ones first. The report shows that the pool caches the priority value once and never refreshes it, so a base-fee change leaves the ordering pointing at stale numbers.
Setup
The proof of concept is a Go test that runs against a Solo chain fork with Hayabusa/dPoS active and two validators. The test file is saved as priority_fee_dpos_test.go inside a folder named poc, in package poc. It imports the testchain, txpool, tx, genesis, state, builtin, staker and thor packages from github.com/vechain/thor/v2, plus testify/require.
The test configures the fork so that VIP191 and GALACTICA activate at block 0 and HAYABUSA at block 10, sets thor.KeyMaxBlockProposers to 3, and registers two validations with stakerpkg.MinStakeVET at thor.MediumStakingPeriod(). It then calls SyncPOS and asserts that dPoS is active after Hayabusa.
The report notes that the PoC inspects and toggles internal fields via reflection to demonstrate the caching behaviour, and that it is intended for testing in a development environment.
Finding it
The researcher traced how a transaction object in the pool computes its priority. TxObject.Executable computes and caches priorityGasPrice = EffectivePriorityFeePerGas(baseFee, ...) the first time the transaction becomes executable, writing it under if !o.executable at txpool/tx_object.go:128-144. On later runs, triggered during housekeeping/wash and before every pack, that block is skipped, so priorityGasPrice stays fixed even though EffectivePriorityFeePerGas(...) is computed from the latest base fee.
Two consumers then rely on the cached value:
TxPool.washsorts executable objects using the cachedpriorityGasPrice(txpool/tx_pool.go:499-545), promoting stale values.- The packer loop consumes that ordering directly (
cmd/thor/node/packer_loop.go:119-140). At runtime base-fee coverage is re-validated so the transaction remains valid, but it now delivers an almost-zero tip.
The same caching applies to o.cost, which means txObjectMap.UpdatePendingCost can under-estimate the payer's outstanding spend after a base-fee spike, allowing a payer to hold more transactions than their real energy/fee balance supports.
Exploitation
The PoC is a single Go test, TestPriorityFeeStalenessDPoS, that walks through four phases.
Step 1: boot the chain and admit the attacker transaction
The test creates a Solo fork chain, reads the best block summary, and sets up the fork and staker state as described above. It then builds and signs an attacker dynamic-fee transaction with MaxFeePerGas 1200 and MaxPriorityFeePerGas 100, resolves it to a txpool.TxObject, and calls Executable(...) with a low base fee of 100:
baseFeeLow := big.NewInt(100)
baseFeeHigh := big.NewInt(1199)
chainView := repo.NewChain(best.Header.ID())
stateLow := stater.NewState(best.Root())
executable, err := attackerObj.Executable(chainView, stateLow, best.Header, &fork, baseFeeLow)
require.NoError(t, err)
require.True(t, executable)
cachedLow := cachedPriority(attackerObj)
require.NotNil(t, cachedLow)
require.Equal(t, int64(100), cachedLow.Int64())
t.Logf("[phase-1] attacker cached priority at baseFee=100: %s wei", cachedLow.String())
The cached priority is read through reflection from the unexported priorityGasPrice field. The test asserts it equals 100 wei and that the effective priority computed with the same base fee also equals 100 wei:
legacyBaseGasPrice, err := builtin.Params.Native(stateLow).Get(thor.KeyLegacyTxBaseGasPrice)
require.NoError(t, err)
expectedLow := attackerTx.EffectivePriorityFeePerGas(baseFeeLow, legacyBaseGasPrice, big.NewInt(0))
require.Equal(t, int64(100), expectedLow.Int64())
t.Logf("[phase-1] attacker effective priority (same baseFee): %s wei", expectedLow.String())
setExecutable(attackerObj, true)
The setExecutable helper flips the unexported executable field to true via reflection, so the next Executable(...) call takes the path that skips the caching block.
Step 2: spike the base fee and observe the stale cache
The test calls Executable(...) again with a base fee of 1199 and reads the cached priority:
stateHigh := stater.NewState(best.Root())
executable, err = attackerObj.Executable(chainView, stateHigh, best.Header, &fork, baseFeeHigh)
require.NoError(t, err)
require.True(t, executable)
cachedHigh := cachedPriority(attackerObj)
require.NotNil(t, cachedHigh)
require.Equal(t, int64(100), cachedHigh.Int64())
t.Logf("[phase-2] attacker cached priority after baseFee=1199: %s wei (stale)", cachedHigh.String())
expectedHigh := attackerTx.EffectivePriorityFeePerGas(baseFeeHigh, legacyBaseGasPrice, big.NewInt(0))
require.Equal(t, int64(1), expectedHigh.Int64())
t.Logf("[phase-2] attacker effective priority after baseFee jump: %s wei (actual tip)", expectedHigh.String())
The cached value stays at 100 wei while the effective priority computed with the new base fee drops to 1 wei. The transaction is still executable, so it is not rejected, but its real tip is now almost nothing.
Step 3: add an honest transaction with a higher real tip
The test builds a second dynamic-fee transaction with MaxFeePerGas 2000 and MaxPriorityFeePerGas 20, resolves it, and calls Executable(...) with the high base fee:
honestTx := tx.NewBuilder(tx.TypeDynamicFee).
ChainTag(repo.ChainTag()).
Clause(tx.NewClause(&target)).
Gas(21000).
BlockRef(tx.NewBlockRef(best.Header.Number())).
Expiration(1000).
MaxFeePerGas(big.NewInt(2000)).
MaxPriorityFeePerGas(big.NewInt(20)).
Nonce(1).
Build()
honestTx = tx.MustSign(honestTx, signer.PrivateKey)
honestObj, err := txpool.ResolveTx(honestTx, true)
require.NoError(t, err)
stateHonest := stater.NewState(best.Root())
executable, err = honestObj.Executable(chainView, stateHonest, best.Header, &fork, baseFeeHigh)
require.NoError(t, err)
require.True(t, executable)
setExecutable(honestObj, true)
cachedHonest := cachedPriority(honestObj)
require.NotNil(t, cachedHonest)
require.Equal(t, int64(20), cachedHonest.Int64())
t.Logf("[phase-3] honest cached priority at baseFee=1199: %s wei", cachedHonest.String())
expectedHonest := honestTx.EffectivePriorityFeePerGas(baseFeeHigh, legacyBaseGasPrice, big.NewInt(0))
require.Equal(t, int64(20), expectedHonest.Int64())
t.Logf("[phase-3] honest effective priority at baseFee=1199: %s wei", expectedHonest.String())
For the honest transaction the cached priority and the effective priority agree at 20 wei, because it was admitted after the base-fee change.
Step 4: compare the ordering with the real tips
The final assertions show the divergence between the cached ordering and the actual tips:
require.True(t, cachedHigh.Cmp(cachedHonest) > 0, "stale cache keeps attacker ahead")
require.True(t, expectedHigh.Cmp(expectedHonest) < 0, "real tips show attacker pays less")
t.Logf("[result] cached ordering => attacker(%s) > honest(%s)", cachedHigh.String(), cachedHonest.String())
t.Logf("[result] real tips => attacker(%s) < honest(%s)", expectedHigh.String(), expectedHonest.String())
The cached ordering puts the attacker at 100 wei ahead of the honest transaction at 20 wei, while the real tips are 1 wei for the attacker against 20 wei for the honest user. The stale entry stays at the front of the queue and the packer picks it first, delivering a much smaller actual tip than current demand requires.
Running the test
GOCACHE=$(pwd)/.cache-go go test -v ./poc -run TestPriorityFeeStalenessDPoS -count=1
The expected output shows the phases in order:
=== RUN TestPriorityFeeStalenessDPoS
priority_fee_dpos_test.go:49: [setup] Hayabusa/DPos active: true
priority_fee_dpos_test.go:68: [phase-1] attacker cached priority at baseFee=100: 100 wei
priority_fee_dpos_test.go:74: [phase-1] attacker effective priority (same baseFee): 100 wei
priority_fee_dpos_test.go:91: [phase-2] attacker cached priority after baseFee=1199: 100 wei (stale)
priority_fee_dpos_test.go:95: [phase-2] attacker effective priority after baseFee jump: 1 wei (actual tip)
priority_fee_dpos_test.go:114: [phase-3] honest cached priority at baseFee=1199: 20 wei
priority_fee_dpos_test.go:118: [phase-3] honest effective priority at baseFee=1199: 20 wei
priority_fee_dpos_test.go:125: [result] cached ordering => attacker(100) > honest(20)
priority_fee_dpos_test.go:126: [result] real tips => attacker(1) < honest(20)
--- PASS: TestPriorityFeeStalenessDPoS (0.31s)
PASS
Root cause
The mistake is that TxObject.Executable caches priorityGasPrice and cost on the first successful execution and never refreshes them. The caching block is guarded by if !o.executable (txpool/tx_object.go:128-144), so once the flag is set, later calls skip recomputation even though EffectivePriorityFeePerGas(...) is a function of the current base fee. TxPool.wash then sorts on the cached value (txpool/tx_pool.go:499-545) and the packer loop consumes that ordering (cmd/thor/node/packer_loop.go:119-140).
Existing defences do not catch it because base-fee coverage is re-validated at runtime, which keeps the transaction valid, but validity is not the same as correct ordering. The transaction passes the coverage check with an almost-zero tip and keeps its stale position. The report notes that the core issue is deterministic: caching the values once and never refreshing them allows stale values to persist when the base fee changes, leading to incorrect ordering and accounting.
Impact
The report lists two impacts:
- Priority-fee mismatch. An attacker, or an unfortunate legitimate user, can be kept at the front of the queue with an effectively near-zero tip after a base-fee spike. This starves proposers of expected rewards and delays honest users who increase tips to match the new base fee.
- Energy accounting mismatch. Pending cost remains pegged to the old base fee, so consensus has to re-evaluate and drop transactions repeatedly, increasing churn and reducing mempool fairness.
The trigger condition is timing a base-fee jump after admission. The report does not claim theft of funds or consensus failure; the impact is on ordering fairness, proposer rewards and accounting accuracy.
Fix
The report does not describe a fix or a patch. The references point at the three places involved: txpool/tx_object.go for the initial caching of priority/cost and the missing refresh, txpool/tx_pool.go for wash ordering driven by the cached priorityGasPrice, and cmd/thor/node/packer_loop.go for the packer consuming stale ordering without recomputing tips. Any fix would need to address the cached values in those paths; the report itself does not state what was changed.
Variants to test
- Other cached fields on the transaction object. Look for fields computed from chain state (base fee, gas price parameters) that are written once behind an
if !o.executable-style guard. A positive result is a field whose value stays fixed while the corresponding recomputation function returns something different after a parameter change. - Other sort keys in the pool. Check whether
washor any other ordering routine reads a cached value rather than recomputing from current state. A positive result is an ordering that disagrees with the freshly computed value for the same transaction. - Packer-side recomputation. Check whether the packer recomputes tips before selection or trusts the pool ordering. A positive result is a packed transaction whose real tip is far below the tip of a transaction left behind.
- Cost accounting after parameter changes. Compare
UpdatePendingCostoutput against the real outstanding spend after a base-fee or gas-price parameter change. A positive result is a payer holding more pending transactions than their balance supports. - Legacy versus dynamic-fee transactions. The PoC uses dynamic-fee transactions and passes
thor.KeyLegacyTxBaseGasPriceintoEffectivePriorityFeePerGas. Try the same sequence with legacy transactions to see whether the caching path behaves the same way.
Hunting notes
This kind of bug hides in the boundary between admission and selection: a value is computed when a transaction enters the pool, then reused later when the environment has changed. During recon, look for caching flags such as executable, cached, initialised or once on pool objects, and for sort or selection routines that read stored fields instead of calling the recomputation function. The strongest signal is a recomputation function that takes a mutable parameter (here the base fee) while the stored value does not.
The researcher showed impact by building a deterministic test that prints both the cached ordering and the real tips side by side. That makes the effect reproducible without a live network and ties the stale cache directly to the ordering and reward outcome the program cares about.
What happened, in plain words
Imagine a busy restaurant with a waiting list. When you arrive, the host writes down how much you are willing to tip, and puts you in the queue based on that number. Later, the restaurant raises its prices, and the tip you promised is now worth almost nothing. But the host never updates the number on the list, so you keep your place near the front while other guests who are offering a much better tip wait behind you.
That is essentially the bug described in this report, but for a blockchain. VeChain is a blockchain network. Its software, called thor, keeps a waiting room of transactions that have been sent but not yet included in a block. This waiting room is called the transaction pool, or txpool. A separate part of the software, the packer, picks transactions out of the pool and puts them into the next block.
On a blockchain, every transaction pays a fee. Part of that fee goes to the people who produce blocks, called proposers (or validators). That part is called the tip, or priority fee. The txpool is supposed to order waiting transactions so that the ones paying the biggest tip go first. That way proposers earn what the market is willing to pay, and users who pay more get served sooner.
The report shows that the txpool writes down each transaction's tip once, when the transaction first arrives, and never updates it. If the network's base fee (a minimum fee that the protocol adjusts automatically) later goes up, the real tip a transaction pays can drop to almost nothing, but the pool still ranks it using the old, higher number. The result: a transaction that now pays almost nothing keeps its place ahead of honest users who are paying a much better tip.
The severity is Low, the report type is Blockchain/DLT, and the stated impact is "Modification of transaction fees outside of design parameters". The target is the Hayabusa upgrade branch of the thor code, compared against version v2.3.2:
https://github.com/vechain/thor/compare/v2.3.2...release/hayabusa
That link is a GitHub comparison page. GitHub is a website where software source code is stored and shared. A branch is a parallel copy of the code where a new feature is being built. "Hayabusa" is the name of an upgrade to VeChain, and this link shows every code change between the older v2.3.2 release and the Hayabusa branch.
Background you need first
Before the details make sense, a few ideas need explaining from zero.
Blockchain and blocks. A blockchain is a shared ledger that many computers keep copies of. It is organised into blocks: batches of transactions, each linked to the one before. Computers running the network software agree on which blocks are valid. VeChain is one such blockchain, and thor is the name of its node software, the program each participant runs.
Transactions and gas. A transaction is an instruction, for example "send some coins from A to B". Running it costs computing effort, measured in a unit called gas. Each unit of gas has a price, so the total fee is gas used multiplied by the gas price. The smallest unit of the network's currency is called wei.
Base fee and tip. Modern blockchains use a two-part fee model, often called dynamic fee or EIP-1559 style. A transaction states two numbers:
MaxFeePerGas: the absolute most the sender will pay per unit of gas.MaxPriorityFeePerGas: the most tip per unit of gas the sender is willing to add on top.
The network itself sets a base fee that changes over time depending on how busy the chain is. The base fee is burned (removed from circulation). Whatever is left of the sender's maximum, up to the priority cap, goes to the proposer as a tip. So the effective priority fee (the real tip) is calculated from the current base fee. If the base fee rises, the real tip shrinks, because more of the sender's maximum is consumed by the base fee.
The txpool and the packer. Not every transaction fits in the next block. The txpool holds the ones waiting. The packer chooses which to include. To choose sensibly, the pool sorts transactions by how much tip they will pay. This report is about that sorting going wrong.
Caching. Caching means storing a computed result so you do not have to compute it again. It is like writing an answer on a sticky note instead of redoing the sum. Caching is only safe if the inputs to the calculation do not change. Here, the input (the base fee) does change, but the sticky note is never rewritten.
Reflection (in Go). The proof of concept is written in Go, a programming language. Go normally hides certain internal fields of a data structure from outside code. Reflection is a Go feature that lets a program inspect and even modify those hidden fields at runtime. The test uses it to peek at the cached value and to flip a flag, purely for demonstration.
dPoS and Hayabusa. dPoS stands for delegated proof of stake, a way of choosing who produces blocks based on how much stake (deposited currency) participants have committed. Hayabusa is the VeChain upgrade that introduces dPoS. The test only runs once Hayabusa is active.
Setup
The proof of concept is a Go test. A test is a small program that checks whether other code behaves as expected. This one runs against a Solo chain fork: a private, single-machine copy of the VeChain chain, used for experiments without touching the real network. It has Hayabusa/dPoS active and two validators (block producers).
The test file is saved as priority_fee_dpos_test.go inside a folder named poc, in a Go package also named poc. A package is just a named group of code files. The test imports several parts of the thor codebase: testchain (for the private chain), txpool (the transaction pool), tx (transactions), genesis (the starting state of the chain), state (the chain's stored data), builtin (built-in system contracts), staker (the staking logic) and thor (core types), plus testify/require, a helper library whose require functions stop the test immediately if a check fails.
The test configures the fork so that two earlier upgrades, VIP191 and GALACTICA, activate at block 0, and HAYABUSA activates at block 10. It sets thor.KeyMaxBlockProposers to 3, meaning at most three block proposers. It registers two validations (stakes) using stakerpkg.MinStakeVET at thor.MediumStakingPeriod(), the minimum stake amount and a medium staking duration. It then calls SyncPOS and asserts that dPoS is active after Hayabusa.
The report notes that the PoC inspects and toggles internal fields via reflection to demonstrate the caching behaviour, and that it is intended for testing in a development environment. In other words, this is a laboratory demonstration, not an attack script for the live network.
Finding it
The researcher traced how a transaction object in the pool computes its priority. A transaction object is the pool's internal record of a waiting transaction, holding the transaction itself plus bookkeeping values.
TxObject.Executable is a function that decides whether a transaction can currently be executed (included in a block). The first time it returns true, it computes and caches priorityGasPrice = EffectivePriorityFeePerGas(baseFee, ...), writing it under a guard if !o.executable at txpool/tx_object.go:128-144. The notation txpool/tx_object.go:128-144 means "file tx_object.go in the txpool folder, lines 128 to 144". The guard if !o.executable means "only do this if the transaction is not yet marked executable".
On later runs, triggered during housekeeping/wash and before every pack, that block is skipped, so priorityGasPrice stays fixed even though EffectivePriorityFeePerGas(...) is computed from the latest base fee. Housekeeping (or wash) is the pool's periodic tidy-up, where it rechecks and reorders its contents. Pack means assembling a block.
Two consumers then rely on the cached value:
TxPool.washsorts executable objects using the cachedpriorityGasPrice(txpool/tx_pool.go:499-545), promoting stale values. Sorting means putting items in order; here, highest tip first. Stale means out of date.- The packer loop consumes that ordering directly (
cmd/thor/node/packer_loop.go:119-140). At runtime base-fee coverage is re-validated so the transaction remains valid, but it now delivers an almost-zero tip. Re-validated means checked again; the check confirms the transaction can still pay the base fee, but it does not check whether the tip is still competitive.
The same caching applies to o.cost, the transaction's prepaid cost. This means txObjectMap.UpdatePendingCost can under-estimate the payer's outstanding spend after a base-fee spike, allowing a payer to hold more transactions than their real energy/fee balance supports. In plain terms: the pool thinks the sender has more money committed than they really do, so it lets them queue more transactions than they could actually pay for.
Exploitation
The PoC is a single Go test, TestPriorityFeeStalenessDPoS, that walks through four phases. "Exploitation" here means demonstrating the effect, not stealing anything.
Step 1: boot the chain and admit the attacker transaction
The test creates a Solo fork chain, reads the best block summary (the latest block's details), and sets up the fork and staker state as described above. It then builds and signs an attacker dynamic-fee transaction with MaxFeePerGas 1200 and MaxPriorityFeePerGas 100, resolves it to a txpool.TxObject, and calls Executable(...) with a low base fee of 100:
baseFeeLow := big.NewInt(100)
baseFeeHigh := big.NewInt(1199)
chainView := repo.NewChain(best.Header.ID())
stateLow := stater.NewState(best.Root())
executable, err := attackerObj.Executable(chainView, stateLow, best.Header, &fork, baseFeeLow)
require.NoError(t, err)
require.True(t, executable)
cachedLow := cachedPriority(attackerObj)
require.NotNil(t, cachedLow)
require.Equal(t, int64(100), cachedLow.Int64())
t.Logf("[phase-1] attacker cached priority at baseFee=100: %s wei", cachedLow.String())
Line by line:
baseFeeLow := big.NewInt(100)stores the low base fee, 100 wei, in a big-integer variable.big.NewIntcreates a large integer, because fees can exceed ordinary number sizes.baseFeeHigh := big.NewInt(1199)stores the high base fee, 1199 wei, for later.chainView := repo.NewChain(best.Header.ID())creates a read-only view of the chain at the latest block, identified by its header ID.stateLow := stater.NewState(best.Root())creates a view of the chain's stored data at that block's root (a fingerprint of the state).executable, err := attackerObj.Executable(...)asks the pool whether the attacker transaction can execute, passing the chain view, the state, the block header, the fork configuration and the low base fee. It returns a true/false answer and an error.require.NoError(t, err)stops the test if there was an error.require.True(t, executable)stops the test if the answer was not true.cachedLow := cachedPriority(attackerObj)reads the cached priority value from the transaction object using reflection.require.NotNil(t, cachedLow)checks the value exists.require.Equal(t, int64(100), cachedLow.Int64())checks the cached value is exactly 100.t.Logf(...)prints a log line showing the cached priority, so the reader can follow along.
The cached priority is read through reflection from the unexported priorityGasPrice field. Unexported means the field is private to its package and not normally accessible from outside. The test asserts it equals 100 wei and that the effective priority computed with the same base fee also equals 100 wei:
legacyBaseGasPrice, err := builtin.Params.Native(stateLow).Get(thor.KeyLegacyTxBaseGasPrice)
require.NoError(t, err)
expectedLow := attackerTx.EffectivePriorityFeePerGas(baseFeeLow, legacyBaseGasPrice, big.NewInt(0))
require.Equal(t, int64(100), expectedLow.Int64())
t.Logf("[phase-1] attacker effective priority (same baseFee): %s wei", expectedLow.String())
setExecutable(attackerObj, true)
Line by line:
- The first line reads a network parameter called
thor.KeyLegacyTxBaseGasPricefrom the built-in parameters contract. This is the base gas price used by older-style (legacy) transactions. require.NoError(t, err)stops if reading it failed.expectedLow := attackerTx.EffectivePriorityFeePerGas(...)computes the real tip the transaction would pay at the low base fee, using the legacy base gas price and a third argument of zero.require.Equal(t, int64(100), expectedLow.Int64())checks the real tip is also 100 wei, matching the cached value.t.Logf(...)prints that real tip.setExecutable(attackerObj, true)flips the hiddenexecutableflag to true via reflection, so the nextExecutable(...)call takes the path that skips the caching block. This simulates the transaction having already been admitted.
Why this step matters: it establishes the baseline. At a low base fee, the cached number and the real tip agree, so the pool's ordering is correct. The bug only appears once the base fee changes.
Step 2: spike the base fee and observe the stale cache
The test calls Executable(...) again with a base fee of 1199 and reads the cached priority:
stateHigh := stater.NewState(best.Root())
executable, err = attackerObj.Executable(chainView, stateHigh, best.Header, &fork, baseFeeHigh)
require.NoError(t, err)
require.True(t, executable)
cachedHigh := cachedPriority(attackerObj)
require.NotNil(t, cachedHigh)
require.Equal(t, int64(100), cachedHigh.Int64())
t.Logf("[phase-2] attacker cached priority after baseFee=1199: %s wei (stale)", cachedHigh.String())
expectedHigh := attackerTx.EffectivePriorityFeePerGas(baseFeeHigh, legacyBaseGasPrice, big.NewInt(0))
require.Equal(t, int64(1), expectedHigh.Int64())
t.Logf("[phase-2] attacker effective priority after baseFee jump: %s wei (actual tip)", expectedHigh.String())
Line by line:
stateHigh := stater.NewState(best.Root())creates a fresh state view for this phase.- The
Executable(...)call runs again, now withbaseFeeHigh(1199). Because theexecutableflag was set to true in the previous step, the caching block is skipped. require.NoErrorandrequire.Truecheck the call succeeded and the transaction is still executable.cachedHigh := cachedPriority(attackerObj)reads the cached priority again.require.Equal(t, int64(100), cachedHigh.Int64())checks it is still 100, unchanged.- The log line labels it "(stale)".
expectedHigh := attackerTx.EffectivePriorityFeePerGas(...)recomputes the real tip at the high base fee.require.Equal(t, int64(1), expectedHigh.Int64())checks the real tip has dropped to 1 wei.- The log line labels it "(actual tip)".
The cached value stays at 100 wei while the effective priority computed with the new base fee drops to 1 wei. The transaction is still executable, so it is not rejected, but its real tip is now almost nothing. This is the heart of the bug: the pool's record says 100, reality says 1.
Step 3: add an honest transaction with a higher real tip
The test builds a second dynamic-fee transaction with MaxFeePerGas 2000 and MaxPriorityFeePerGas 20, resolves it, and calls Executable(...) with the high base fee:
honestTx := tx.NewBuilder(tx.TypeDynamicFee).
ChainTag(repo.ChainTag()).
Clause(tx.NewClause(&target)).
Gas(21000).
BlockRef(tx.NewBlockRef(best.Header.Number())).
Expiration(1000).
MaxFeePerGas(big.NewInt(2000)).
MaxPriorityFeePerGas(big.NewInt(20)).
Nonce(1).
Build()
honestTx = tx.MustSign(honestTx, signer.PrivateKey)
honestObj, err := txpool.ResolveTx(honestTx, true)
require.NoError(t, err)
stateHonest := stater.NewState(best.Root())
executable, err = honestObj.Executable(chainView, stateHonest, best.Header, &fork, baseFeeHigh)
require.NoError(t, err)
require.True(t, executable)
setExecutable(honestObj, true)
cachedHonest := cachedPriority(honestObj)
require.NotNil(t, cachedHonest)
require.Equal(t, int64(20), cachedHonest.Int64())
t.Logf("[phase-3] honest cached priority at baseFee=1199: %s wei", cachedHonest.String())
expectedHonest := honestTx.EffectivePriorityFeePerGas(baseFeeHigh, legacyBaseGasPrice, big.NewInt(0))
require.Equal(t, int64(20), expectedHonest.Int64())
t.Logf("[phase-3] honest effective priority at baseFee=1199: %s wei", expectedHonest.String())
Line by line:
tx.NewBuilder(tx.TypeDynamicFee)starts building a dynamic-fee transaction. The chained calls set its properties:ChainTag(repo.ChainTag())marks which chain it belongs to, so it cannot be replayed on another chain.Clause(tx.NewClause(&target))sets what the transaction does: it targets an address calledtarget.Gas(21000)sets the gas limit to 21000, the standard cost of a simple transfer.BlockRef(tx.NewBlockRef(best.Header.Number()))ties the transaction to a recent block, so it expires if it waits too long.Expiration(1000)sets how many blocks it stays valid.MaxFeePerGas(big.NewInt(2000))sets the maximum total fee per gas to 2000 wei.MaxPriorityFeePerGas(big.NewInt(20))sets the maximum tip per gas to 20 wei.Nonce(1)sets a sequence number, different from the attacker's 0, so the two transactions are distinct.Build()finishes construction.
tx.MustSign(honestTx, signer.PrivateKey)signs the transaction with the signer's private key. A private key is a secret number proving ownership; a signature proves the transaction came from that owner.txpool.ResolveTx(honestTx, true)turns the raw transaction into a pool transaction object.require.NoErrorchecks that worked.stateHonest := stater.NewState(best.Root())creates a state view.honestObj.Executable(...)checks executability at the high base fee.setExecutable(honestObj, true)flips the flag, as before.cachedHonest := cachedPriority(honestObj)reads the cached priority.require.Equal(t, int64(20), cachedHonest.Int64())checks it is 20.expectedHonest := honestTx.EffectivePriorityFeePerGas(...)computes the real tip.require.Equal(t, int64(20), expectedHonest.Int64())checks it is also 20.
For the honest transaction the cached priority and the effective priority agree at 20 wei, because it was admitted after the base-fee change. Its sticky note was written with the new price already in effect, so it is correct.
Step 4: compare the ordering with the real tips
The final assertions show the divergence between the cached ordering and the actual tips:
require.True(t, cachedHigh.Cmp(cachedHonest) > 0, "stale cache keeps attacker ahead")
require.True(t, expectedHigh.Cmp(expectedHonest) < 0, "real tips show attacker pays less")
t.Logf("[result] cached ordering => attacker(%s) > honest(%s)", cachedHigh.String(), cachedHonest.String())
t.Logf("[result] real tips => attacker(%s) < honest(%s)", expectedHigh.String(), expectedHonest.String())
Line by line:
cachedHigh.Cmp(cachedHonest) > 0compares the two cached values.Cmpreturns a positive number if the first is larger. The check asserts the attacker's cached 100 is greater than the honest user's cached 20, with the message "stale cache keeps attacker ahead".expectedHigh.Cmp(expectedHonest) < 0compares the two real tips. The check asserts the attacker's real 1 wei is less than the honest user's 20 wei, with the message "real tips show attacker pays less".- The two
t.Logflines print both comparisons side by side, so the contradiction is visible in the output.
The cached ordering puts the attacker at 100 wei ahead of the honest transaction at 20 wei, while the real tips are 1 wei for the attacker against 20 wei for the honest user. The stale entry stays at the front of the queue and the packer picks it first, delivering a much smaller actual tip than current demand requires.
Running the test
GOCACHE=$(pwd)/.cache-go go test -v ./poc -run TestPriorityFeeStalenessDPoS -count=1
Line by line:
GOCACHE=$(pwd)/.cache-gosets an environment variable,GOCACHE, telling Go where to store its build cache.$(pwd)inserts the current directory, so the cache goes into a.cache-gofolder next to you. This keeps the build self-contained.go testis Go's command for running tests.-vmeans verbose: print every log line, not just pass or fail../pocis the folder containing the test.-run TestPriorityFeeStalenessDPoSruns only the test with that name.-count=1disables Go's habit of reusing cached test results, forcing a fresh run.
The expected output shows the phases in order:
=== RUN TestPriorityFeeStalenessDPoS
priority_fee_dpos_test.go:49: [setup] Hayabusa/DPos active: true
priority_fee_dpos_test.go:68: [phase-1] attacker cached priority at baseFee=100: 100 wei
priority_fee_dpos_test.go:74: [phase-1] attacker effective priority (same baseFee): 100 wei
priority_fee_dpos_test.go:91: [phase-2] attacker cached priority after baseFee=1199: 100 wei (stale)
priority_fee_dpos_test.go:95: [phase-2] attacker effective priority after baseFee jump: 1 wei (actual tip)
priority_fee_dpos_test.go:114: [phase-3] honest cached priority at baseFee=1199: 20 wei
priority_fee_dpos_test.go:118: [phase-3] honest effective priority at baseFee=1199: 20 wei
priority_fee_dpos_test.go:125: [result] cached ordering => attacker(100) > honest(20)
priority_fee_dpos_test.go:126: [result] real tips => attacker(1) < honest(20)
--- PASS: TestPriorityFeeStalenessDPoS (0.31s)
PASS
Each line is prefixed with the file and line number that printed it. The [setup] line confirms dPoS is active. The [phase-1] lines show cached and real tips both at 100. The [phase-2] lines show the cached value stuck at 100 while the real tip falls to 1. The [phase-3] lines show the honest transaction at 20 for both. The [result] lines show the contradiction: cached ordering says attacker (100) beats honest (20), real tips say attacker (1) loses to honest (20). PASS means the test's assertions all held, which is exactly the point: the bug is real and reproducible.
Root cause
The mistake is that TxObject.Executable caches priorityGasPrice and cost on the first successful execution and never refreshes them. The caching block is guarded by if !o.executable (txpool/tx_object.go:128-144), so once the flag is set, later calls skip recomputation even though EffectivePriorityFeePerGas(...) is a function of the current base fee. TxPool.wash then sorts on the cached value (txpool/tx_pool.go:499-545) and the packer loop consumes that ordering (cmd/thor/node/packer_loop.go:119-140).
Existing defences do not catch it because base-fee coverage is re-validated at runtime, which keeps the transaction valid, but validity is not the same as correct ordering. The transaction passes the coverage check with an almost-zero tip and keeps its stale position. The report notes that the core issue is deterministic: caching the values once and never refreshing them allows stale values to persist when the base fee changes, leading to incorrect ordering and accounting. Deterministic means it happens every time under the same conditions, not by chance.
Impact
The report lists two impacts:
- Priority-fee mismatch. An attacker, or an unfortunate legitimate user, can be kept at the front of the queue with an effectively near-zero tip after a base-fee spike. This starves proposers of expected rewards and delays honest users who increase tips to match the new base fee.
- Energy accounting mismatch. Pending cost remains pegged to the old base fee, so consensus has to re-evaluate and drop transactions repeatedly, increasing churn and reducing mempool fairness. Consensus is the process by which network participants agree on the state of the chain. Churn means repeated, wasteful change.
The trigger condition is timing a base-fee jump after admission. The report does not claim theft of funds or consensus failure; the impact is on ordering fairness, proposer rewards and accounting accuracy.
Fix
The report does not describe a fix or a patch. The references point at the three places involved: txpool/tx_object.go for the initial caching of priority/cost and the missing refresh, txpool/tx_pool.go for wash ordering driven by the cached priorityGasPrice, and cmd/thor/node/packer_loop.go for the packer consuming stale ordering without recomputing tips. Any fix would need to address the cached values in those paths; the report itself does not state what was changed.
Variants to test
If you wanted to look for similar bugs elsewhere, these are some directions to try.
- Other cached fields on the transaction object. Look for fields computed from chain state (base fee, gas price parameters) that are written once behind an
if !o.executable-style guard. A positive result is a field whose value stays fixed while the corresponding recomputation function returns something different after a parameter change. - Other sort keys in the pool. Check whether
washor any other ordering routine reads a cached value rather than recomputing from current state. A positive result is an ordering that disagrees with the freshly computed value for the same transaction. - Packer-side recomputation. Check whether the packer recomputes tips before selection or trusts the pool ordering. A positive result is a packed transaction whose real tip is far below the tip of a transaction left behind.
- Cost accounting after parameter changes. Compare
UpdatePendingCostoutput against the real outstanding spend after a base-fee or gas-price parameter change. A positive result is a payer holding more pending transactions than their balance supports. - Legacy versus dynamic-fee transactions. The PoC uses dynamic-fee transactions and passes
thor.KeyLegacyTxBaseGasPriceintoEffectivePriorityFeePerGas. Try the same sequence with legacy transactions to see whether the caching path behaves the same way. Legacy transactions are the older fee format, where a single gas price is set instead of a base fee plus tip.
Hunting notes
This kind of bug hides in the boundary between admission and selection: a value is computed when a transaction enters the pool, then reused later when the environment has changed. During recon, look for caching flags such as executable, cached, initialised or once on pool objects, and for sort or selection routines that read stored fields instead of calling the recomputation function. Recon means the initial exploration of a codebase to find interesting areas. The strongest signal is a recomputation function that takes a mutable parameter (here the base fee) while the stored value does not.
The researcher showed impact by building a deterministic test that prints both the cached ordering and the real tips side by side. That makes the effect reproducible without a live network and ties the stale cache directly to the ordering and reward outcome the program cares about.
Glossary
- Base fee: a minimum fee per unit of gas set automatically by the network, which changes with demand and is burned rather than paid to anyone.
- Block: a batch of transactions linked to the previous block in a blockchain.
- Blockchain: a shared ledger kept in sync by many computers, organised as a chain of blocks.
- Branch: a parallel copy of a codebase where changes are developed separately.
- Caching: storing a computed result so it can be reused instead of recomputed.
- Churn: repeated, wasteful change, such as transactions being added and dropped over and over.
- Consensus: the process by which network participants agree on the state of the chain.
- dPoS (delegated proof of stake): a method of choosing block producers based on committed stake.
- Deterministic: happening the same way every time under the same conditions.
- Dynamic fee: a fee model with a network-set base fee plus a sender-chosen tip, as opposed to a single gas price.
- Effective priority fee: the real tip a transaction pays, calculated from the current base fee and the sender's maximums.
- Gas: a unit measuring the computing effort a transaction requires.
- Go: a programming language, used for the
thornode and the proof of concept. - Hayabusa: the name of a VeChain upgrade that introduces dPoS.
- Housekeeping / wash: the pool's periodic tidy-up, where it rechecks and reorders its contents.
- Legacy transaction: an older transaction format with a single gas price instead of a base fee plus tip.
- MaxFeePerGas: the absolute maximum a sender will pay per unit of gas.
- MaxPriorityFeePerGas: the maximum tip per unit of gas a sender will add on top of the base fee.
- Package: a named group of code files in Go.
- Pack / packer: assembling a block from waiting transactions; the packer is the component that does it.
- Private key: a secret number proving ownership of an account, used to sign transactions.
- Proposer / validator: a participant that produces blocks and earns tips.
- Recon: initial exploration of a codebase to find interesting areas.
- Reflection: a Go feature that lets a program inspect and modify hidden fields at runtime.
- Re-validated: checked again; here, confirming a transaction can still pay the base fee.
- Signature: cryptographic proof that a transaction came from the holder of a private key.
- Solo chain fork: a private, single-machine copy of a blockchain used for experiments.
- Stake: currency committed by a participant to take part in block production.
- Stale: out of date.
- Test: a small program that checks whether other code behaves as expected.
- thor: the name of VeChain's node software.
- Tip / priority fee: the part of a transaction fee that goes to the block proposer.
- Transaction: an instruction recorded on the blockchain, such as a transfer.
- Transaction object: the pool's internal record of a waiting transaction.
- Txpool (transaction pool): the waiting room of transactions not yet included in a block.
- Unexported: a field that is private to its code package and not normally accessible from outside.
- wei: the smallest unit of the network's currency.