Skip to content

feat: integrate batcher with payment system#519

Merged
MauroToscano merged 71 commits intomainfrom
batcher-interact-with-payment-service
Jun 28, 2024
Merged

feat: integrate batcher with payment system#519
MauroToscano merged 71 commits intomainfrom
batcher-interact-with-payment-service

Conversation

@entropidelic
Copy link
Copy Markdown
Contributor

@entropidelic entropidelic commented Jun 28, 2024

Integrates batcher with the new batcher payment service.
When a user sends a proof, the message is signed and the batcher verifies the signature and recovers the user address. Then, it checks that the address has funds in the batcher payment service.

Testing:

For fine grained testing:

  • Start anvil with block time, aggregator and operator
  • Start batcher with
cargo +nightly-2024-04-17 run --manifest-path ./batcher/aligned-batcher/Cargo.toml --release -- --config ./config-files/config-batcher.yaml --env-file ./batcher/aligned-batcher/.env

This will start the batcher without sending funds.

  • Send some proofs with
aligned submit --proving_system GnarkPlonkBls12_381 \
--proof batcher/aligned/test_files/plonk_bls12_381/plonk.proof \
--public_input batcher/aligned/test_files/plonk_bls12_381/plonk_pub_input.pub \
--vk batcher/aligned/test_files/plonk_bls12_381/plonk.vk --repetitions 2 --keystore_path config-files/anvil.ecdsa.key.json

An error will be logged meaning that the user has no funds in the batcher payment system.

  • Send some funds with
cast send 0x7969c5eD335650692Bc04293B07F5BF2e7A673C0 --value 1ether --rpc-url http://localhost:8545 --private-key 0xac0974bec39a17e36ba4a6b4d238ff944bacb478cbed5efcae784d7bf4f2ff80
  • Send proofs again, everything should work as usual.

Happy path:

  • Start anvil again so that the previous state is reseted, and do the usual flow. Everything should work as usual. The only difference now is that when make batcher_start is called, a transaction is made from the user to the payment system to add funds in devnet.

entropidelic and others added 30 commits June 19, 2024 16:13
Copy link
Copy Markdown
Contributor

@uri-99 uri-99 left a comment

Choose a reason for hiding this comment

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

my review is still wip

Comment thread Makefile Outdated
@entropidelic entropidelic marked this pull request as ready for review June 28, 2024 17:09
Comment thread batcher/aligned-batcher-lib/Cargo.toml Outdated
Comment thread batcher/aligned-batcher/src/lib.rs
Comment thread batcher/aligned-batcher/src/lib.rs
Comment thread batcher/aligned-batcher/src/lib.rs Outdated
@uri-99 uri-99 assigned uri-99 and entropidelic and unassigned uri-99 Jun 28, 2024
@NicolasRampoldi NicolasRampoldi mentioned this pull request Jun 28, 2024
@uri-99
Copy link
Copy Markdown
Contributor

uri-99 commented Jun 28, 2024

is this error supposed to happen? I think only the first one should appear:

image

Co-authored-by: Tatu <65305492+srosati@users.noreply.github.com>
@MauroToscano MauroToscano merged commit faa299b into main Jun 28, 2024
@MauroToscano MauroToscano deleted the batcher-interact-with-payment-service branch June 28, 2024 19:40
@taturosati taturosati restored the batcher-interact-with-payment-service branch June 28, 2024 19:50
@taturosati taturosati deleted the batcher-interact-with-payment-service branch June 28, 2024 19:50
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.

5 participants