Skip to content

fix(batcher): Update Lambdaworks Merkle Trees + Update merkle leaves length check in batcher - #1067

Merged
entropidelic merged 15 commits into
stagingfrom
970-update-empty-batch-condition
Oct 7, 2024
Merged

fix(batcher): Update Lambdaworks Merkle Trees + Update merkle leaves length check in batcher#1067
entropidelic merged 15 commits into
stagingfrom
970-update-empty-batch-condition

Conversation

@PatStiles

@PatStilesPatStiles commented Sep 24, 2024

Copy link
Copy Markdown
Contributor

closes#970

  • Updates the lambdaworks merkle tree dependencies in aligned layer from v0.7.0 -> v0.10.0.
  • Updates the length check in the batcher to allow batches of size 1

Testing:

Test local testnet as expected and confirm no errors are emitted.

make deps
make install_aligned_compiling
make anvil_start_with_block_time
make aggregator_start
make operator_register_and_start
make batcher_start_local
make batcher_send_burst_groth16

Note:

I removed the padding of the merkle root leaves as specified in #979 . However, this caused the Tx to revert in the BatcherPaymentService contract with InvalidMerkleRoot error (after removing the leaves power of two check). Since the merkle tree verification was sourced from eigen https://github.com/code-423n4/2023-04-eigenlayer/blob/main/src/contracts/libraries/Merkle.sol#L129 my intuition is its failing due an invariant the leaves are a power of 2 therefore we need to preserve padding the leaves to a power of two. Removing the padding will be done in a separate pr.

Comment threadbatcher/aligned-batcher/src/lib.rs Outdated
Comment threadbatcher/aligned-batcher/src/lib.rs
@PatStiles
PatStilesforce-pushed the 970-update-empty-batch-condition branch from 85dff0e to 56fcbd4CompareSeptember 25, 2024 12:41
Comment threadoperator/merkle_tree/lib/src/lib.rs
Comment threadoperator/merkle_tree/lib/src/lib.rs Outdated
Comment threadbatcher/aligned-batcher/src/lib.rs Outdated
Comment threadoperator/merkle_tree/lib/src/lib.rs
Comment threadbatcher/aligned-batcher/src/lib.rs Outdated

@entropidelicentropidelic left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

When submitting a batch with only one proof, I am getting

Transaction reverted "0x9f13b65cfc222438ea0a6d0738343dfbd7ebd0aaf7a0cbfe1ef69f905eb2bbb6b3dfc6035c58ee0f5eb4cd6f6d30536add1a16cddd8fef8f334968b221c8d45eaf604219"

Which corresponds to the InvalidMerkleRoot error of the BatcherPaymentSercvice.sol contract

@uri-99uri-99 left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Blocking PR until lambdaworks is fixed to allow merkle trees of size 1

@uri-99

uri-99 commented Sep 30, 2024

Copy link
Copy Markdown
Contributor

Seems to be working fine when pointed to latest commit of LambdaWorks. Waiting to see if a release will be done or if we should point to the latest commit efd46f0b0aea3aa95d94bba7de86cb96611b40d3
(probably the former)

@MarcosNicolauMarcosNicolau left a comment

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.

Code looks good, everything worked fine on my machine!

@uri-99uri-99 left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

still works

@Oppen

Oppen commented Oct 7, 2024

Copy link
Copy Markdown
Contributor

Seems to be working fine when pointed to latest commit of LambdaWorks. Waiting to see if a release will be done or if we should point to the latest commit efd46f0b0aea3aa95d94bba7de86cb96611b40d3 (probably the former)

I can make a release if we need one. I'll talk with @diegokingston and @MauroToscano.

@entropidelic
entropidelic merged commit dca81e0 into stagingOct 7, 2024
@entropidelic
entropidelic deleted the 970-update-empty-batch-condition branch October 7, 2024 16:00
@OppenOppen mentioned this pull request Oct 10, 2024
Sign up for freeto 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.

5 participants

@PatStiles@uri-99@Oppen@entropidelic@MarcosNicolau