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: integrate L1 mock with services #438

Merged
merged 22 commits into from
Oct 30, 2024
Merged

feat: integrate L1 mock with services #438

merged 22 commits into from
Oct 30, 2024

Conversation

mrekucci
Copy link
Collaborator

@mrekucci mrekucci commented Oct 16, 2024

Describe your changes

L1 mock integration with all services within the cluster

Fixes # (issue)

Checklist before requesting a review

  • I have added tests that prove my fix is effective or that my feature works
  • I have made corresponding changes to the documentation

@mrekucci mrekucci force-pushed the l1-mock-integration branch 7 times, most recently from ce9a891 to 58b4a6c Compare October 26, 2024 09:20
@mrekucci mrekucci marked this pull request as ready for review October 26, 2024 09:21
Copy link
Contributor

@shaspitz shaspitz left a comment

Choose a reason for hiding this comment

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

Nice!

bridge/README.md Outdated Show resolved Hide resolved
bridge/standard/pkg/node/node.go Show resolved Hide resolved
r.metrics.failedFinalizations.WithLabelValues("settlement").Inc()
continue
}
r.metrics.finalizedTransfers.WithLabelValues("settlement").Inc()
Copy link
Contributor

Choose a reason for hiding this comment

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

Am I interpreting this behavior correctly - if the finalizeTransfer transaction is not included in a block (or is reorged out), the relayer will simply skip that transfer and not retry?

Note transfers are enforced to be delivered FIFO in the bridge contracts. This means in the edge case of a tx not getting included in a block, the relayer needs to retry the relevant finalizeTransfer tx until that tx is included.

Further, the relayer needs to eventually confirm each finalizeTransfer tx is included in the finalized destination chain. In case of reorg this requires retries

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

return nil
}

func (s *Store) IsSettled(
Copy link
Contributor

Choose a reason for hiding this comment

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

Related to above comment, seems "settled" here corresponds to the finalizeTransfer tx being included in the latest block of the destination chain?

We may need to add another state to confirm each transfer is eventually "finalized", ie. the finalizeTransfer tx is in the finalized destination block

*l1gateway.L1gatewayFilterer
}

func (f *L1Filterer) WaitForTransferFinalized(ctx context.Context, startBlock uint64, index *big.Int) error {
Copy link
Contributor

Choose a reason for hiding this comment

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

I believe this function is not reorg resistant, since the event query by default uses "latest" block and not "finalized"

contracts/entrypoint.sh Show resolved Hide resolved
@mrekucci mrekucci force-pushed the l1-mock-integration branch from 138a57f to 31d4855 Compare October 29, 2024 14:38
@mrekucci mrekucci force-pushed the l1-mock-integration branch from 479482a to 1254ebe Compare October 30, 2024 08:34
@mrekucci mrekucci requested a review from shaspitz October 30, 2024 08:35
@mrekucci mrekucci merged commit 882eeeb into main Oct 30, 2024
7 checks passed
@mrekucci mrekucci deleted the l1-mock-integration branch October 30, 2024 12:53
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