refactor: drop dependency of evo/specialtxman on validation.h - #7668
refactor: drop dependency of evo/specialtxman on validation.h#7668knst wants to merge 15 commits into
Conversation
It doesn't change logic but simplify further refactoring and reduces conflicts with other PRs in the future
… in CSpecialTxProcessor
…ecalculation twice GetBlockSubsidy is leightful helper and appears in perf as responsible for only 0.01% of calculation, so, commit is not threated as any noticeable performance improvement
CheckSpecialTxInner still evaluates the flag from m_chainman for now and the next step is moving that to its callers
|
🕓 Queued for automated review — 52nd in line, estimated start in ~48 h (commit 4a1b3b7)
|
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Repository UI Review profile: CHILL Plan: Advanced Run ID: 📒 Files selected for processing (21)
Included review availability: Your plan provides up to 4 included reviews per hour; 2 remain after this review. WalkthroughThe change removes several Priority: ➖ Normal — Schedule the special-transaction refactor because it changes consensus validation, masternode-list processing, deployment handling, and block-context plumbing across core paths. Estimated code review effort: 4 (Complex) | ~60 minutes Merge Risk: ⚪ Minimal · up to The explicit consensus-context refactor has no identified merge-blocking behavior regression. Sequence Diagram(s)sequenceDiagram
participant MemPoolAccept
participant CSpecialTxProcessor
participant ConsensusParams
participant Chainstate
MemPoolAccept->>ConsensusParams: Determine V24 activation
MemPoolAccept->>CSpecialTxProcessor: Check special transaction
CSpecialTxProcessor->>Chainstate: Validate against chain context
CSpecialTxProcessor-->>MemPoolAccept: Return validation result
🚥 Pre-merge checks | ✅ 4 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (4 passed)
✨ Finishing Touches🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
Potential PR merge conflictsThis is advisory only. It does not block CI, but it marks PRs that will likely need a rebase depending on merge order. If these PRs merge firstThis PR will likely need a rebase:
|
ProcessSpecialTxsInBlock called Chainstate::RecordBackgroundMNListHash, the last reason it needed the complete Chainstate type.
Make MNListUpdates the single non-optional result: ProcessBlock always fill it and consumers checks if there's actually diff non-empty by call of diff.HasChanges() instead of the checking optional. Copying an unchanged list is leightful operation due to using immer maps data-structure.
There's several new exception has been added to the list of existing circular dependencies: all of them had been pre-existing but now they are discovered by removing the shorter loop specialtxman <-> validation
4a1b3b7 to
f932324
Compare
Issue being fixed or feature implemented
One more circular dependency is trivial to avoid.
What was done?
It helps to break circular dependency over evo/specialtxman <-> validation and reveal other circular dependencies that has been hidden by this short cycle.
NOTE: once v24 is buried deployment, some code could be re-refactored and simplified because chainman is not needed for buried deployments.
How Has This Been Tested?
Run & updated test/lint/lint-circular-dependencies.py
Breaking Changes
N/A
Checklist: