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: e2e test Pesimisstic L2 to L2 claim #239

Merged
merged 39 commits into from
Dec 20, 2024
Merged

Conversation

joanestebanr
Copy link
Contributor

@joanestebanr joanestebanr commented Dec 10, 2024

Description

The PR add e2e test for L2 to L2 bridge. To do this it require several improvements:

  • Check the settle certificate contents to see if a deposit is included. For that is used global_index. It needs, a RPC to get the submitted certificates and also a new tool to find the global_index

E2E

  • The new test is a new check because it need a specific version of kurtosis-cdk that is still on a branch
  • It have a new way of doing bridges / claims: bridgeAsset export the tx_hash and claim only claim the specific deposit

RPC for aggsender

In order to be able to retrieve all certificates for verify which one contain the desired importedBridgeExit have create a aggsender end-point.

  • Changed RPC behaviour. Now to start bridge service, instead of RPC component, you must use BRIDGE component
  • Aggsender provide RPC service can be disabled from config file: AggSender.EnableRPC
  • Available methods:
  • aggsender_getCertificateHeaderPerHeight: you can ask for highest certificate of an specific height.
    Example of usage for requesting the highest height:
curl -X POST http://localhost:5576/ -H "Con -application/json"   -d {"method":"aggsender_getCertificateHeaderPerHeight", "params":[], "id":1}'
  • aggsender_status

Tools

Add new folder tools:

  • New Makefile taget build-tools
  • currently there are only one: aggsender_find_imported_bridge: find out a importedBridgeExit in settled certificates of aggsender, it use RPC to retrieve certificates, also require to be able to unmarshal certificates
aggsender_find_imported_bridge <code_rpc> <global_index>

Configuration changes

  • DryRun: allow to prevent aggsender to submit certificates
  • EnableRPC: It create a end point
[AggSender]
DryRun = false
EnableRPC = true

@joanestebanr joanestebanr self-assigned this Dec 10, 2024
@joanestebanr joanestebanr changed the base branch from release/v0.5.0 to develop December 19, 2024 07:19
@joanestebanr joanestebanr changed the base branch from develop to release/v0.5.0 December 19, 2024 07:19
Stefan-Ethernal and others added 23 commits December 19, 2024 12:27
* Simplify HashMeddler

* fix: TestCertificateHeaderString UT
This set a limit on certificate size that can be set on config file (the size of certificate it's an estimation)
There are a special situation that is going to send a certificate bigger than maximium:
- [ initial_block, end_block ] -> size exceed
- [ initial_block, (end_block -1) ] -> no bridges, so we have to send previous one even that exceed the maximum size

MaxCertSize: max size in bytes of certificate. Default 8Mb. Currently the maximum on Agglayer is 10Mb
```
[AggSender]
MaxCertSize = 8388608
```
* fix: use hex instead of byte arrays

* feat: UT

* fix: change estimated certificate size

* fix: UT coverage

* fix: bridge exit metadata hash

* fix: last sent certificate block (#234)
…agglayer (#227)

* chore: update the versions.json

* Remove PPError interface and use the error instead

* Remove non-applicable test cases

* Rename

* test: increase UT coverage

* test: certificate status unmarshal json

* test: TestMerkleProofString

* test: TestGlobalIndexString

* test: move helper functions to a separate file

* test: TestL1InfoTreeLeafString

* test: TestClaimType

* test: parallel execution, renames
…t` hash (#237)

* fix: calculate correct root for LER merkle proof, and fix BridgeExit hash

* fix: UTs

* fix: comments
@joanestebanr joanestebanr changed the base branch from release/v0.5.0 to develop December 19, 2024 13:51
aggsender/rpc/aggsender_rpc.go Outdated Show resolved Hide resolved
aggsender/rpc/aggsender_rpc.go Show resolved Hide resolved
agglayer/types.go Outdated Show resolved Hide resolved
agglayer/types.go Show resolved Hide resolved
version_test.go Show resolved Hide resolved
test/bats/pp-multi/bridge-l2_to_l2-e2e.bats Outdated Show resolved Hide resolved
aggsender/rpcclient/client.go Show resolved Hide resolved
aggsender/rpcclient/client.go Show resolved Hide resolved
Copy link
Collaborator

@Stefan-Ethernal Stefan-Ethernal left a comment

Choose a reason for hiding this comment

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

Generally LGTM, leaving a couple of more comments to consider.

aggsender/aggsender.go Outdated Show resolved Hide resolved
test/helpers/common-multi_cdk-setup.bash Outdated Show resolved Hide resolved
test/helpers/common-multi_cdk-setup.bash Outdated Show resolved Hide resolved
test/helpers/common-multi_cdk-setup.bash Outdated Show resolved Hide resolved
aggsender/aggsender.go Outdated Show resolved Hide resolved
test/bats/pp-multi/bridge-l2_to_l2-e2e.bats Outdated Show resolved Hide resolved
test/bats/helpers/common-multi_cdk-setup.bash Outdated Show resolved Hide resolved
test/bats/helpers/lxly-bridge.bash Outdated Show resolved Hide resolved
test/bats/helpers/lxly-bridge.bash Outdated Show resolved Hide resolved
test/bats/helpers/lxly-bridge.bash Outdated Show resolved Hide resolved
Dockerfile Show resolved Hide resolved
agglayer/types.go Show resolved Hide resolved
agglayer/types.go Outdated Show resolved Hide resolved
agglayer/types.go Show resolved Hide resolved
agglayer/types_test.go Show resolved Hide resolved
aggsender/rpc/aggsender_rpc.go Show resolved Hide resolved
aggsender/rpc/aggsender_rpc.go Outdated Show resolved Hide resolved
aggsender/rpc/aggsender_rpc.go Show resolved Hide resolved
aggsender/aggsender.go Outdated Show resolved Hide resolved
aggsender/aggsender.go Outdated Show resolved Hide resolved
version.go Show resolved Hide resolved
Copy link
Contributor

@vcastellm vcastellm left a comment

Choose a reason for hiding this comment

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

LGTM

@joanestebanr joanestebanr merged commit 6e5bd04 into develop Dec 20, 2024
14 checks passed
@joanestebanr joanestebanr deleted the feature/e2e_l2_to_l2 branch December 20, 2024 15:33
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants