Skip to content

feat(sdk): Add Max Fee Estimate. Update zkQuiz to better represent how the SDK should be used - #1131

Merged
MauroToscano merged 12 commits into
stagingfrom
feat/max_fee_estimate_sdk
Oct 2, 2024
Merged

feat(sdk): Add Max Fee Estimate. Update zkQuiz to better represent how the SDK should be used#1131
MauroToscano merged 12 commits into
stagingfrom
feat/max_fee_estimate_sdk

Conversation

@PatStiles

@PatStilesPatStiles commented Oct 1, 2024

Copy link
Copy Markdown
Contributor

Reopens #1045 due to merge issues.

To Test

  • Run test in batcher cd batcher && cargo t

To test zkQuiz example in Devnet

  • Start anvil, aggregator, operator and batcher as usual
  • Go to the zkquiz examples folder
cd examples/zkquiz
  • Change the .env file located in examples/zkquiz/contracts:
RPC_URL=http://localhost:8545
PRIVATE_KEY=0xac0974bec39a17e36ba4a6b4d238ff944bacb478cbed5efcae784d7bf4f2ff80
ALIGNED_SERVICE_MANAGER_ADDRESS=0x1613beB3B2C4f22Ee086B2b38C1476A3cE7f78E8
BATCHER_PAYMENT_SERVICE_ADDRESS=0x7969c5eD335650692Bc04293B07F5BF2e7A673C0
  • Deploy the verifier contract. Run it in the zkquiz folder. Note that this will output the deployed contract address. Make sure to save it
make deploy_verifier
  • Change the Makefile environment variables to the following:
CONTRACT_ADDRESS=<YOUR_DEPLOYED_CONTRACT_ADDRESS>
RPC_URL=http://localhost:8545
KEYSTORE_PATH=../../../../config-files/devnet/keys/operator-3.ecdsa.key.json
  • Now change some code in examples/zkquiz/quiz/script/src/main.rs:

Line 21:

constBATCHER_URL:&str = "ws://localhost:8080";

Line 24:

constNETWORK:Network = Network::Devnet;

Line 34:

 default_value = "http://localhost:8545"

Line 53:

.with_chain_id(31337u64);
  • Now send proofs so that when the zkquiz proof is submitted, it is included in a batch and posted
make batcher_send_burst_groth16
  • Finally, run zkquiz
make answer_quiz

HELP: Answers are C C A

@PatStiles
PatStiles requested review from IAvecilla, MauroToscano and uri-99 and removed request for IAvecilla, MauroToscano and uri-99October 1, 2024 16:38
@github-actions

github-actionsBot commented Oct 1, 2024

Copy link
Copy Markdown

Changes to gas cost

Generated at commit: 3e232f777672df86a5bf4057044d719c526a4a2a, compared to commit: decd1c7b418efccc5ca5216a6516ef74b660ad47

🧾 Summary (10% most significant diffs)

ContractMethodAvg (+/-)%
AlignedLayerServiceManagercreateNewTask-99 ✅-0.13%

Full diff report 👇
ContractDeployment Cost (+/-)MethodMin (+/-)%Avg (+/-)%Median (+/-)%Max (+/-)%# Calls (+/-)
AlignedLayerServiceManager4,681,797 (0)createNewTask
receive
53,835 (-132)
21,169 (0)
-0.24%
0.00%
73,812 (-99)
44,783 (-94)
-0.13%
-0.21%
73,969 (-18)
45,064 (0)
-0.02%
0.00%
74,746 (+12)
45,064 (0)
+0.02%
0.00%
256 (0)
256 (0)
RegistryCoordinatorHarness5,828,753 (-17,263)

Comment threadbatcher/aligned-sdk/src/core/constants.rs Outdated
Comment threaddocs/3_guides/1.2_SDK_api_reference.md
@MauroToscanoMauroToscano changed the title feat(sdk): Add Max Fee Estimate functions to sdkfeat(sdk): Add Max Fee Estimate. Update zkQuiz to better represent how the SDK should be usedOct 1, 2024

@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.

Tested on my machine, everything went fine!

@MauroToscano
MauroToscano merged commit 32a0e66 into stagingOct 2, 2024
@MauroToscano
MauroToscano deleted the feat/max_fee_estimate_sdk branch October 2, 2024 17:49
PatStiles added a commit that referenced this pull request Oct 3, 2024
…w the SDK should be used (#1131)
Co-authored-by: MauroFab <maurotoscano2@gmail.com>
Co-authored-by: Mariano Nicolini <mariano.nicolini.91@gmail.com>
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@MarcosNicolau@MauroToscano@entropidelic