Skip to content

feat(bridge): log withdrawal assignment lifecycle#110

Open
storopoli wants to merge 2 commits into
mainfrom
ASM-logs
Open

feat(bridge): log withdrawal assignment lifecycle#110
storopoli wants to merge 2 commits into
mainfrom
ASM-logs

Conversation

@storopoli
Copy link
Copy Markdown
Member

Description

When ASM processes a checkpoint with withdrawal intents, it does not log anything about it. We only learn about the assignment when the bridge processes the ASM output, which is a bit later as bridge waits for finality. For debugging purposes, this PR adds ability to track the entire progress, so a log from the bridge subprotocol is requested.

The log includes the deposit index and the assignee.

Type of Change

  • Bug fix (non-breaking change which fixes an issue)
  • New feature/Enhancement (non-breaking change which adds functionality or enhances an existing one)
  • Breaking change (fix or feature that would cause existing functionality to not work as expected)
  • Documentation update
  • Refactor
  • New or updated tests
  • Dependency update
  • Security fix
  • Logs

Notes to Reviewers

Checklist

  • I have performed a self-review of my code.
  • I have commented my code where necessary.
  • I have updated the documentation if needed.
  • My changes do not introduce new warnings.
  • I have added tests that prove my changes are effective or that my feature works.
  • New and existing tests pass with my changes.

Related Issues

STR-3557

@codecov
Copy link
Copy Markdown

codecov Bot commented May 22, 2026

Codecov Report

❌ Patch coverage is 73.52941% with 9 lines in your changes missing coverage. Please review.

Files with missing lines Patch % Lines
...rotocols/bridge-v1/subprotocol/src/state/bridge.rs 64.00% 9 Missing ⚠️
Files with missing lines Coverage Δ
...rates/subprotocols/bridge-v1/types/src/operator.rs 95.98% <100.00%> (+0.13%) ⬆️
...rotocols/bridge-v1/subprotocol/src/state/bridge.rs 93.92% <64.00%> (-4.00%) ⬇️

... and 1 file with indirect coverage changes

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@github-actions
Copy link
Copy Markdown

github-actions Bot commented May 22, 2026

Commit: 2739c1f
SP1 Execution Results

program cycles gas
asm-stf 130,127,186 129,751,754
moho 5,191,380 5,499,715

Copy link
Copy Markdown
Collaborator

@prajwolrg prajwolrg left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for adding this. One small nit and this should be good to go.

Comment on lines +191 to +196
let selected_operator_raw = selected_operator.raw();
let selected_operator_mode = if selected_operator.as_specific().is_some() {
"specific"
} else {
"any"
};
Copy link
Copy Markdown
Collaborator

@prajwolrg prajwolrg May 22, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We should add a Display trait to OperatorSelection so that this can be handled properly.

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes, will do.

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ok added a commit before the logs that derives Display see 5482d7c

Copy link
Copy Markdown
Collaborator

@barakshani barakshani left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Super!

Comment on lines +289 to +294
info!(
deposit_idx,
assignee = assignment.current_assignee(),
fulfillment_deadline = assignment.fulfillment_deadline(),
l1_height = current_block.height(),
"Reassigned expired withdrawal assignment",
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

reassignment are actually logged already, but this one is even better.

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