Skip to content

fix: unstack aggsender unset claims#1569

Open
arnaubennassar wants to merge 5 commits intorelease/0.8from
fix/unstack-aggsender-unset-claims
Open

fix: unstack aggsender unset claims#1569
arnaubennassar wants to merge 5 commits intorelease/0.8from
fix/unstack-aggsender-unset-claims

Conversation

@arnaubennassar
Copy link
Copy Markdown
Collaborator

@arnaubennassar arnaubennassar commented Mar 31, 2026

🔄 Changes Summary

  • Fix aggsender recovery when invalid claims and their matching unclaims are both present in
    the same candidate certificate but the unclaims happen in a different order.
  • Add operator-facing diagnostics for blocking invalid claims, including the claim block,
    global index, token, and amount.
  • Warn when MaxCertSize or MaxL2BlockNumber would prevent the matching unclaim from
    fitting into the same certificate, and suggest the config change needed to unblock aggsender.

⚠️ Breaking Changes

None

📋 Config Updates

None

✅ Testing

  • 🤖 Automatic:
    • go test ./aggsender/flows
  • 🖱️ Manual:
    • Reproduced the network-12 failure pattern in tests using the real claim/unclaim block
      ordering.
    • Verified aggsender no longer cuts the certificate when all invalid claims are also unset
      within the same candidate certificate.
    • Verified new logs for:
      • missing matching unclaim
      • matching unclaim present, aggsender can proceed
      • limiter prevents the unclaim from fitting into the certificate

🐞 Issues

  • Closes #N/A

🔗 Related PRs

  • feat/fix-removeger-tool-docs: hardening in tools/remove_ger used to clean the invalid
    GER incident and confirm the network state before fixing aggsender recovery behavior.

📝 Notes

  • RCA: aggsender could remain stuck even after the network was cleaned because the previous
    logic required later invalid claims to be unclaimed no later than earlier ones. That was
    stricter than the final imported-bridge-exit construction, which only requires claim/unclaim
    pairs to cancel out within the same certificate.
  • This PR keeps the core safety requirement intact: an invalid claim is only considered
    recoverable when its matching unclaim is also inside the same candidate certificate.

@arnaubennassar arnaubennassar changed the title fix/unstack aggsender unset claims fix: unstack aggsender unset claims Mar 31, 2026
@sonarqubecloud
Copy link
Copy Markdown

@arnaubennassar arnaubennassar self-assigned this Mar 31, 2026
"%s, unclaim_block=%d, cert_range=%d-%d",
formatClaimForLogs(*assessment.culpritClaim), assessment.culpritUnclaim, certParams.FromBlock, certParams.ToBlock)
}
if assessment != nil && assessment.cutBlock != 0 {
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.

Reduce complexity adding an no action required if:

if assessment == nil {
  return certParams, nil
}

maxCertSize := f.cfg.MaxCertSize
for {
if maxCertSize == 0 || currentCert.EstimatedSize() <= maxCertSize {
if originalCert != nil && currentCert != nil && currentCert.ToBlock < originalCert.ToBlock {
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.

originalCert must be always != nil, same for currentCert

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.

2 participants