Skip to content

Remove event for Promote Pending Safe / Promote Local Safe / Promote Unsafe#16941

Merged
pcw109550 merged 13 commits intodevelopfrom
pcw109550/rm-event-system-PromotePendingSafeEvent-PromoteLocalSafeEvent
Aug 12, 2025
Merged

Remove event for Promote Pending Safe / Promote Local Safe / Promote Unsafe#16941
pcw109550 merged 13 commits intodevelopfrom
pcw109550/rm-event-system-PromotePendingSafeEvent-PromoteLocalSafeEvent

Conversation

@pcw109550
Copy link
Copy Markdown
Member

@pcw109550 pcw109550 commented Aug 1, 2025

Description

Removes PromoteUnsafeEvent, PromotePendingSafeEvent, PromoteLocalSafeEvent to a procedural call.

Key Changes

Now AttributeHandler embeds EngDeriver. AttributeHandler directly invokes methods of EngDeriver in this PR.

Notes

Inside onPayloadSuccess which is emitted by sequencer, we originally had four event emissions in the happy path. PromoteUnsafeEvent -> TryUpdatePendingSafe -> TryUpdateLocalSafe -> TryUpdateEngineEvent. I initially only picked two events TryUpdatePendingSafe and TryUpdateLocalSafe and took quite a time what was wrong. What happened was two events exec order were mixed with procedural calls, leading to test failure.

For further refactoring, we may be aware of this observations and make sure to convert the sequential events in a sequential procedural method call.

Tests

All existing tests are passing.

There are changes at TestSpanBatchAtomicity_Consolidation at sync_test.go. The point of the test is to check the safe head is bumped after we consolidated the whole span batch. This is done when PromoteSafeEvent is consumed and TryUpdateEngineEvent is emitted. Changed the condition since the test were failing, and did not find out exactly why the test was failing.

@pcw109550 pcw109550 requested review from nonsense and teddyknox August 1, 2025 12:33
@codecov
Copy link
Copy Markdown

codecov bot commented Aug 1, 2025

Codecov Report

❌ Patch coverage is 77.04918% with 14 lines in your changes missing coverage. Please review.
✅ Project coverage is 44.60%. Comparing base (453240e) to head (98583d1).
⚠️ Report is 6 commits behind head on develop.

Files with missing lines Patch % Lines
op-node/rollup/engine/payload_success.go 61.90% 5 Missing and 3 partials ⚠️
op-node/rollup/driver/driver.go 0.00% 6 Missing ⚠️
Additional details and impacted files
@@             Coverage Diff             @@
##           develop   #16941      +/-   ##
===========================================
- Coverage    45.50%   44.60%   -0.91%     
===========================================
  Files         1459     1405      -54     
  Lines       119013   114347    -4666     
===========================================
- Hits         54160    50999    -3161     
+ Misses       61050    59693    -1357     
+ Partials      3803     3655     -148     
Flag Coverage Δ
cannon-go-tests-64 ?
contracts-bedrock-tests 96.29% <ø> (ø)

Flags with carried forward coverage won't be shown. Click here to find out more.

Files with missing lines Coverage Δ
op-node/rollup/attributes/attributes.go 66.66% <100.00%> (-0.70%) ⬇️
op-node/rollup/engine/events.go 84.34% <100.00%> (+1.50%) ⬆️
op-service/testutils/mock_eng_deriver.go 100.00% <100.00%> (ø)
op-node/rollup/driver/driver.go 0.00% <0.00%> (ø)
op-node/rollup/engine/payload_success.go 84.61% <61.90%> (-15.39%) ⬇️

... and 62 files with indirect coverage changes

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@pcw109550 pcw109550 changed the title Remove event for Promote Pending Safe and Local Safe Remove event for Promote Pending Safe and Promote Local Safe Aug 1, 2025
@pcw109550 pcw109550 changed the title Remove event for Promote Pending Safe and Promote Local Safe Remove event for Promote Pending Safe / Promote Local Safe / Promote Unsafe Aug 1, 2025
@pcw109550 pcw109550 force-pushed the pcw109550/rm-event-system-PromotePendingSafeEvent-PromoteLocalSafeEvent branch from 077211d to b368a46 Compare August 11, 2025 11:23
@pcw109550 pcw109550 marked this pull request as ready for review August 11, 2025 11:23
@pcw109550 pcw109550 requested review from a team and sebastianst and removed request for sebastianst August 11, 2025 11:23
@pcw109550 pcw109550 force-pushed the pcw109550/rm-event-system-PromotePendingSafeEvent-PromoteLocalSafeEvent branch from b368a46 to d1c9f2a Compare August 11, 2025 11:29
Comment thread op-node/rollup/engine/payload_success.go Outdated
Comment thread op-node/rollup/attributes/attributes.go Outdated
@pcw109550 pcw109550 force-pushed the pcw109550/rm-event-system-PromotePendingSafeEvent-PromoteLocalSafeEvent branch from d1c9f2a to 98583d1 Compare August 12, 2025 09:45
@pcw109550 pcw109550 added this pull request to the merge queue Aug 12, 2025
Merged via the queue into develop with commit db4530f Aug 12, 2025
65 checks passed
@pcw109550 pcw109550 deleted the pcw109550/rm-event-system-PromotePendingSafeEvent-PromoteLocalSafeEvent branch August 12, 2025 11:24
theochap pushed a commit to theochap/optimism that referenced this pull request Aug 26, 2025
…Unsafe (ethereum-optimism#16941)

* Add mock engDeriver

* Embed engDeriver to attributesHandler

* Fix tests

* Fix test

* Explicit init of engDeriver for attributesHandler

* add comment

* Rm PromoteUnsafeEvent

* Make the payload success flow sequential

* rm unused

* temporal commit to make test pass

* wait try engine update event

* More explanatory comment

* Move interfaces nearby
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants