Skip to content

V1.0.6 txpool#4

Closed
cffls wants to merge 2 commits into
masterfrom
v1.0.6-txpool
Closed

V1.0.6 txpool#4
cffls wants to merge 2 commits into
masterfrom
v1.0.6-txpool

Conversation

@cffls
Copy link
Copy Markdown
Owner

@cffls cffls commented Oct 30, 2023

Description

Please provide a detailed description of what was done in this PR

Changes

  • Bugfix (non-breaking change that solves an issue)
  • Hotfix (change that solves an urgent issue, and requires immediate attention)
  • New feature (non-breaking change that adds functionality)
  • Breaking change (change that is not backwards-compatible and/or changes current functionality)
  • Changes only for a subset of nodes

Breaking changes

Please complete this section if any breaking changes have been made, otherwise delete it

Nodes audience

In case this PR includes changes that must be applied only to a subset of nodes, please specify how you handled it (e.g. by adding a flag with a default value...)

Checklist

  • I have added at least 2 reviewer or the whole pos-v1 team
  • I have added sufficient documentation in code
  • I will be resolving comments - if any - by pushing each fix in a separate commit and linking the commit hash in the comment reply
  • Created a task in Jira and informed the team for implementation in Erigon client (if applicable)
  • Includes RPC methods changes, and the Notion documentation has been updated

Cross repository changes

  • This PR requires changes to heimdall
    • In case link the PR here:
  • This PR requires changes to matic-cli
    • In case link the PR here:

Testing

  • I have added unit tests
  • I have added tests to CI
  • I have tested this code manually on local environment
  • I have tested this code manually on remote devnet using express-cli
  • I have tested this code manually on mumbai
  • I have created new e2e tests into express-cli

Manual tests

Please complete this section with the steps you performed if you ran manual tests for this functionality, otherwise delete it

Additional comments

Please post additional comments in this section if you have them, otherwise delete it

@codecov-commenter
Copy link
Copy Markdown

codecov-commenter commented Oct 30, 2023

Codecov Report

Attention: 179 lines in your changes are missing coverage. Please review.

Comparison is base (6de2a49) 56.78% compared to head (0fecaa5) 57.30%.
Report is 1616 commits behind head on master.

❗ Your organization needs to install the Codecov GitHub app to enable full functionality.

Additional details and impacted files
@@            Coverage Diff             @@
##           master       #4      +/-   ##
==========================================
+ Coverage   56.78%   57.30%   +0.51%     
==========================================
  Files         611      650      +39     
  Lines       71390   117803   +46413     
==========================================
+ Hits        40536    67502   +26966     
- Misses      27391    46405   +19014     
- Partials     3463     3896     +433     
Files Coverage Δ
accounts/abi/bind/util.go 80.55% <100.00%> (+0.55%) ⬆️
accounts/abi/error.go 61.90% <100.00%> (-2.39%) ⬇️
accounts/abi/error_handling.go 81.81% <ø> (ø)
accounts/abi/event.go 100.00% <100.00%> (ø)
accounts/abi/method.go 93.44% <100.00%> (-2.12%) ⬇️
accounts/abi/pack.go 77.27% <ø> (-0.51%) ⬇️
accounts/abi/reflect.go 89.93% <100.00%> (+0.65%) ⬆️
accounts/abi/selector_parser.go 62.80% <100.00%> (+3.35%) ⬆️
accounts/abi/topics.go 95.83% <100.00%> (+0.65%) ⬆️
accounts/abi/utils.go 100.00% <100.00%> (ø)
... and 26 more

... and 648 files with indirect coverage changes

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@github-actions
Copy link
Copy Markdown

This PR is stale because it has been open 21 days with no activity. Remove stale label or comment or this will be closed in 14 days.

@github-actions github-actions Bot added the Stale label Nov 21, 2023
@github-actions
Copy link
Copy Markdown

github-actions Bot commented Dec 6, 2023

This PR was closed because it has been stalled for 35 days with no activity.

@github-actions github-actions Bot closed this Dec 6, 2023
cffls added a commit that referenced this pull request May 1, 2026
…rnal review

An external reviewer found six issues in V2's correctness/operability
surface. Fixes for each, plus targeted regression tests.

#1 (CRITICAL) — V2 swallowed ApplyMessage errors. applyMessage at
core/parallel_state_processor.go:735 ignored execErr when result==nil,
so a tx with a consensus-level error (bad nonce, intrinsic gas under-
flow, insufficient upfront gas, blob fork-gating violation, etc.)
settled as a zero-gas successful no-op. Serial returns the error and
aborts the block (state_processor.go:222). V2 now records execErr on
the PDB, the settle path skips the tx, and Process surfaces the error
to BlockChain so it can fall back to serial — same behaviour as the
panicked-PDB path. Test: TestV2StateProcessor_ApplyMessageErrorFailsBlock.

#2 (CRITICAL) — SelfDestruct not published to MVStore. FlushToMVStore
wrote nonces, storage, code, created, balance deltas, but never the
destructed set. Cross-tx readers saw destroyed accounts as still alive
with stale code/storage/nonce. Pre-EIP-6780 chains: tx B reading a
just-destroyed account got base-state values; SetStorageDirectWithOrigins
at settle time would resurrect the account. Fix: publish destructions
under SuicidePath (the same flag V1 already uses on its MVHashMap), and
gate Exist/GetCode/GetCodeHash/GetState/GetCommittedState/GetNonce on
priorDestructed so cross-tx reads return defaults. priorDestructed is
cached per-tx so the four getters share one MVStore lookup per address.
Test: TestPDB_CrossTxSelfDestructVisibility.

#3 (HIGH) — V2 receipts had zero BlockHash. buildV2Receipt didn't set
BlockHash and passed common.Hash{} to GetLogs. Receipt-trie consensus
was unaffected (BlockHash is not in the consensus encoding) but RPC
consumers got 0x000…0 for blockHash on V2-processed blocks. Thread
block.Hash() through ExecuteV2BlockSTM → newV2SettleFn → buildV2Receipt
and into GetLogs. Test: TestV2StateProcessor_ReceiptHasBlockHash.

#4 (HIGH) — V2 executor ignored cancellation. core/blockstm/v2_executor.go
had no context plumbing, so when serial won the parallel-vs-serial
race and BlockChain called cancel(), V2 ran to completion (~50–200ms)
before the import could continue; if V2 hung, the import couldn't
return. Add ctx.Context to ExecuteV2BlockSTM, plumb it through to the
dispatcher and validation loop, check at task-boundary and validation
boundaries. Updated the misleading "<1ms" comment in blockchain.go.
Test: TestExecuteV2BlockSTM_HonoursCancellation.

#5 (MEDIUM) — numWorkers <= 0 deadlocked the executor. The dispatcher
window collapsed to 0 and the very first task waited forever on an
execDone channel no worker would close (v2_executor.go:355). Clamp
to runtime.NumCPU() in NewV2StateProcessor with a comment explaining
the failure mode. Test: TestNewV2StateProcessor_ClampsNumWorkers.

0xPolygon#6 (LOW, comment-only) — Biased pathdb cache lock removal. The Has →
Set race exists but is benign because reader.Node hash-checks every
cache hit (Verkle-only noHashCheck doesn't apply to Bor). The previous
comment claimed "self-corrects on the next disk read" — actually it
self-corrects via the hash check in reader.go:72. Tightened the
comment.

Verified: ./core/, ./core/state/, ./core/blockstm/ tests pass; the V2
backbone TestV2BlockSTMAllBlocks passes (165s).

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants