Commit e2b4094
authored
execution/stagedsync: extract minIBS post-apply path into a dedicated method (#21212)
## Stack
**Depends on:** #21211 — first cut of
[#21138](#21138 heuristic
/ IBS-dependency removal sequence (dead-finalize cleanup). Must merge
first.
## Summary
Pure structural cleanup of `finalizeTxSimple`. Pulls the ~55 lines that
construct a minimal `IntraBlockState` to feed `postApplyMessageFunc`
(AuRa system calls / EIP-7708 burn-log emission via
`LogSelfDestructedAccounts`) into its own method,
`runPostApplyMessageOnMinIBS`.
**No semantic change.** Behavior identical: same engine post-apply hook,
same IBS construction, same control flow position.
## Why
This is preparation for the IBS-removal PR that follows in the
[#21138](#21138) sequence.
The end-state #21138 drives toward is *one `finalizeTx` function, no IBS
used in the parallel-exec code path outside workers*. Today the live IBS
dependency in `finalizeTxSimple` is entangled with surrounding
fee-credit logic that has nothing to do with IBS — pulling them apart
here, without changing behavior, makes the IBS-removal PR small enough
to review confidently.
The extracted method's godoc enumerates the three IBS dependencies it
carries today, so the swap point is clearly flagged:
1. `ibs.GetRemovedAccountsWithBalance()` lookup (consumed inside
`LogSelfDestructedAccounts`).
2. `ibs.AddLog` → `ibs.GetLogs` log-buffer round-trip (so EIP-7708 burn
logs reach the receipt).
3. `ibs.AddBalance` fee-credit bookkeeping (so the SD'd coinbase carries
`FeeTipped` at the time `LogSelfDestructedAccounts` inspects it).
`finalizeTxSimple` shrinks from 257 → 205 lines; the IBS-using block
becomes a single method call.
## Test plan
- [x] `make lint` clean
- [x] `make test-short` green under `EXEC3_PARALLEL=true` across:
`execution/stagedsync`, `execution/state`, `execution/tests`,
`execution/engineapi`, `execution/execmodule`, `rpc/jsonrpc`
- [x] `TestEIP7708BurnLogWhenCoinbaseSelfDestructs` green
- [x] `TestEngineApiBAL*` family green
- [x] `TestLegacyBlockchain/ValidBlocks/bcEIP3675` green
- [ ] CI: race-tests, kurtosis, hive matrix legs green on both serial
and parallel
## What's next in the sequence
- **PR 3** (next): drain all three IBS deps from
`runPostApplyMessageOnMinIBS`. Add explicit SD-with-balance computation
on `ExecutionResult`, change `LogSelfDestructedAccounts` to return
`[]*types.Log` instead of using `ibs.AddLog`, and remove the
`ibs.AddBalance` bookkeeping (which exists only to inform
`LogSelfDestructedAccounts`). `finalizeTxSimple` becomes IBS-free.
- Later PRs: replace `normalizeWriteSet` with
`filterWritesByVersionMap`; replace `calcState.ApplyWrites` with
`VersionedWrites.TouchUpdates`; move EIP-7002/7251 syscalls into the
worker pool (separate PR — requires interface change to
`Engine.Finalize` / `SysCallContract`).
## Related
- #21211 — #21138 PR 1 (dead-finalize cleanup, this PR's direct
dependency)
- #21138 — heuristic / IBS-dependency removal tracker (the parent)
- #21153 — parallel-exec correctness stack (merged 2026-05-15)1 parent 1522edd commit e2b4094
1 file changed
Lines changed: 100 additions & 55 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1700 | 1700 | | |
1701 | 1701 | | |
1702 | 1702 | | |
1703 | | - | |
1704 | | - | |
1705 | | - | |
1706 | | - | |
1707 | | - | |
1708 | | - | |
1709 | | - | |
1710 | | - | |
1711 | | - | |
1712 | | - | |
1713 | | - | |
1714 | | - | |
1715 | | - | |
1716 | | - | |
1717 | | - | |
1718 | | - | |
1719 | | - | |
1720 | | - | |
1721 | | - | |
1722 | | - | |
1723 | | - | |
1724 | | - | |
1725 | | - | |
1726 | | - | |
1727 | | - | |
1728 | | - | |
1729 | | - | |
1730 | | - | |
1731 | | - | |
1732 | | - | |
1733 | | - | |
1734 | | - | |
1735 | | - | |
1736 | | - | |
1737 | | - | |
1738 | | - | |
1739 | | - | |
1740 | | - | |
1741 | | - | |
1742 | | - | |
1743 | | - | |
1744 | | - | |
1745 | | - | |
1746 | | - | |
1747 | | - | |
1748 | | - | |
1749 | | - | |
1750 | | - | |
1751 | | - | |
1752 | | - | |
1753 | | - | |
1754 | | - | |
1755 | | - | |
1756 | | - | |
1757 | | - | |
| 1703 | + | |
| 1704 | + | |
| 1705 | + | |
1758 | 1706 | | |
1759 | 1707 | | |
1760 | 1708 | | |
| |||
1771 | 1719 | | |
1772 | 1720 | | |
1773 | 1721 | | |
| 1722 | + | |
| 1723 | + | |
| 1724 | + | |
| 1725 | + | |
| 1726 | + | |
| 1727 | + | |
| 1728 | + | |
| 1729 | + | |
| 1730 | + | |
| 1731 | + | |
| 1732 | + | |
| 1733 | + | |
| 1734 | + | |
| 1735 | + | |
| 1736 | + | |
| 1737 | + | |
| 1738 | + | |
| 1739 | + | |
| 1740 | + | |
| 1741 | + | |
| 1742 | + | |
| 1743 | + | |
| 1744 | + | |
| 1745 | + | |
| 1746 | + | |
| 1747 | + | |
| 1748 | + | |
| 1749 | + | |
| 1750 | + | |
| 1751 | + | |
| 1752 | + | |
| 1753 | + | |
| 1754 | + | |
| 1755 | + | |
| 1756 | + | |
| 1757 | + | |
| 1758 | + | |
| 1759 | + | |
| 1760 | + | |
| 1761 | + | |
| 1762 | + | |
| 1763 | + | |
| 1764 | + | |
| 1765 | + | |
| 1766 | + | |
| 1767 | + | |
| 1768 | + | |
| 1769 | + | |
| 1770 | + | |
| 1771 | + | |
| 1772 | + | |
| 1773 | + | |
| 1774 | + | |
| 1775 | + | |
| 1776 | + | |
| 1777 | + | |
| 1778 | + | |
| 1779 | + | |
| 1780 | + | |
| 1781 | + | |
| 1782 | + | |
| 1783 | + | |
| 1784 | + | |
| 1785 | + | |
| 1786 | + | |
| 1787 | + | |
| 1788 | + | |
| 1789 | + | |
| 1790 | + | |
| 1791 | + | |
| 1792 | + | |
| 1793 | + | |
| 1794 | + | |
| 1795 | + | |
| 1796 | + | |
| 1797 | + | |
| 1798 | + | |
| 1799 | + | |
| 1800 | + | |
| 1801 | + | |
| 1802 | + | |
| 1803 | + | |
| 1804 | + | |
| 1805 | + | |
| 1806 | + | |
| 1807 | + | |
| 1808 | + | |
| 1809 | + | |
| 1810 | + | |
| 1811 | + | |
| 1812 | + | |
| 1813 | + | |
| 1814 | + | |
| 1815 | + | |
| 1816 | + | |
| 1817 | + | |
| 1818 | + | |
1774 | 1819 | | |
1775 | 1820 | | |
1776 | 1821 | | |
| |||
0 commit comments