Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat(bridge-history): generate withdraw proofs by bundle #1415

Merged
merged 7 commits into from
Jul 10, 2024

Conversation

colinlyguo
Copy link
Member

@colinlyguo colinlyguo commented Jul 8, 2024

Purpose or design rationale of this PR

This PR adds generating withdraw proofs by bundle logic, and it's backward compatible.

Notes:
It keeps commit/revert batches to maintain block range of the batch, because in FinalizeBatch event, there isn't a block range.

Only updating batch's status as finalized when listening to the FinalizeBatch event (when "finalize by bundle", only each bundle's last batch will be updated as finalized), so that bridge-history-backend can track the block range to update regardless "finalize by batch" or "finalize by bundle".

This PR is compatible with both "finalize by batch" and "finalize by bundle" modes:

  • In "finalize by batch" mode, each batch emits a FinalizedBatch event.
  • In "finalize by bundle" mode, all batches in the bundle emit only one FinalizedBatch event, using the last batch's index and hash.

For withdraw proof generation:

  • finalize by batch: Generates proofs for each batch.
  • finalize by bundle: Generates proofs for the entire bundle at once.

For batch index updating:

  • finalize by batch: Updates the batch index for withdrawal messages in each processed batch.
  • finalize by bundle: Updates the batch index for all withdrawal messages in the bundle, using the index of the last batch in the bundle.

PR title

Your PR title must follow conventional commits (as we are doing squash merge for each PR), so it must start with one of the following types:

  • feat: A new feature

Deployment tag versioning

Has tag in common/version.go been updated or have you added bump-version label to this PR?

  • Yes

Breaking change label

Does this PR have the breaking-change label?

  • No, this PR is not a breaking change

@codecov-commenter
Copy link

codecov-commenter commented Jul 8, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 53.53%. Comparing base (86aed8e) to head (f913ac2).

Additional details and impacted files
@@           Coverage Diff            @@
##           develop    #1415   +/-   ##
========================================
  Coverage    53.53%   53.53%           
========================================
  Files          155      155           
  Lines        11655    11655           
========================================
  Hits          6239     6239           
  Misses        4930     4930           
  Partials       486      486           
Flag Coverage Δ
bridge-history-api 72.50% <ø> (ø)

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

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

zimpha
zimpha previously approved these changes Jul 9, 2024
georgehao
georgehao previously approved these changes Jul 9, 2024
@georgehao
Copy link
Member

change the target branch

@colinlyguo colinlyguo requested a review from amoylan2 July 9, 2024 04:49
@colinlyguo colinlyguo dismissed stale reviews from georgehao and zimpha via ea1d9df July 9, 2024 05:19
@colinlyguo colinlyguo requested review from zimpha and georgehao July 10, 2024 03:34
@colinlyguo colinlyguo merged commit 0737d5d into develop Jul 10, 2024
5 checks passed
@colinlyguo colinlyguo deleted the bridge-history-generate-withdraw-proof-by-bundle branch July 10, 2024 03:54
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.

4 participants