-
Notifications
You must be signed in to change notification settings - Fork 396
feat: circom example #2078
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
Merged
Merged
feat: circom example #2078
Changes from 18 commits
Commits
Show all changes
54 commits
Select commit
Hold shift + click to select a range
ca16af0
feat: enforce min max fee
MarcosNicolau 4354573
feat: enforce min bump in replacement messages
MarcosNicolau 6568098
fix: underproced proof error message
MarcosNicolau a029194
fix: min bump calculation
MarcosNicolau d4981dd
feat: move constants to config file
MarcosNicolau 6f32282
chore: address clippy warnings
MarcosNicolau 546aba9
perf: drop latest_block_gas_price lock early
MarcosNicolau f534b84
chore: address juli's comments
MarcosNicolau e2e396e
fix: config file new fields syntax
MarcosNicolau b2f26b0
chore: rename proofs_to_cover_min_max_fee for amount_of_proofs_for_mi…
MarcosNicolau 02e456b
chore: log min max fee in waiting for batch to finish
MarcosNicolau 45b8a23
feat: compute min max fee only once
MarcosNicolau 63ea290
chore: entry for entry_to_replace name in replacament message
MarcosNicolau 9fdcd5e
fix: logs
JuArce f3cb180
docs: add replacement rules
JuArce 999d9b0
Merge branch 'staging' into feat/min-max-fee-min-bump
MauroToscano a2045cf
Merge
MauroToscano 201c366
Merge
MauroToscano 718cd26
Merge branch 'staging' into feat/min-fee-merge
MauroToscano cb10892
Remove duplicated check
MauroToscano dacfb75
Remove extra newlines
MauroToscano 0e33365
Rename and standarize arguments of estimate functions
MauroToscano cec54d3
update batcher circom verifier to accept raw pub inputs
MarcosNicolau c22391e
update operator circom verifier to accept raw pub inputs
MarcosNicolau ddb130b
feat: sdk and cli parse input.json to the raw numbers
MarcosNicolau a6696d0
feat: circom example rust program
MarcosNicolau d1be60a
feat: circom example circuits
MarcosNicolau cf6ae41
feat: circom example contract
MarcosNicolau c700281
feat: circom example readme
MarcosNicolau 81efbd2
chore: update fork to org
MarcosNicolau ee4dfdf
feat: receive vk on deployment
MarcosNicolau 1ad320a
feat: compute vk commitment script
MarcosNicolau a97d885
chore: pass vk commitment in deploy
MarcosNicolau 1442040
feat: load config from env
MarcosNicolau a37d7ef
chore: makefile targets
MarcosNicolau c14a9c2
docs: how to run example
MarcosNicolau 2b7baa2
chore: update go mod to point to main branch commit
MarcosNicolau 6067e86
fix: avoid panic on invalid pub inputs length
MarcosNicolau adb4430
Merge branch 'fix/circom-public-inputs' into feat/circom-example
MarcosNicolau 435315b
docs: missing step
MarcosNicolau 0f46e92
Explain why the replacement in the go.mod
MauroToscano be11294
chore: no pub input proof
MarcosNicolau 31b79ff
fix: docker no pub input circom target
MarcosNicolau 70e398a
Merge branch 'fix/circom-public-inputs' into feat/circom-example
MarcosNicolau 933577a
chore: forge-std submodule
MarcosNicolau 45adcb9
Update examples/circom/.env.example
JuArce d56db1d
Merge branch 'fix/circom-public-inputs' of github.com:yetanotherco/al…
MauroToscano 397ec6d
chore: update docker sent proofs
MarcosNicolau 22f5049
chore: update docker sent proofs
MarcosNicolau d5505ee
Merge branch 'fix/circom-public-inputs' of github.com:yetanotherco/al…
MauroToscano 1ab0936
Merge branch 'fix/circom-public-inputs' into feat/circom-example
MauroToscano 37c0835
Merge
MauroToscano 8471ad3
Fmt
MauroToscano 074a491
Update README.md
MarcosNicolau File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,3 +1,4 @@ | ||
| pub mod constants; | ||
| pub mod errors; | ||
| pub mod types; | ||
| pub mod utils; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,32 @@ | ||
| use ethers::{abi::ethereum_types::FromDecStrErr, types::U256}; | ||
|
|
||
| /// Encodes Circom public inputs into a single byte vector. | ||
| /// | ||
| /// Circom normally outputs public inputs as a JSON array of strings, where each | ||
| /// entry is actually a big integer represented in decimal. For example: | ||
| /// | ||
| /// ```json | ||
| /// { "pubInputs": ["123", "456", "789"] } | ||
| /// ``` | ||
| /// | ||
| /// For on-chain usage (e.g. in Solidity), working with JSON is inefficient. | ||
| /// Instead, we prefer the **raw form**: each input is converted to a 32-byte | ||
| /// big-endian encoding of the integer, concatenated together. This makes it | ||
| /// simple to compute commitments and verify proofs on-chain, since the contract | ||
| /// receives a compact `bytes` array rather than parsing JSON. | ||
| /// | ||
| /// Each input must fit in 32 bytes (i.e. < 2^256). | ||
| pub fn encode_circom_pub_inputs(input: &[String]) -> Result<Vec<u8>, FromDecStrErr> { | ||
| let mut out = Vec::with_capacity(input.len() * 32); | ||
|
|
||
| for s in input { | ||
| // parse as decimal (base 10). Use from_str_radix(s, 16) if they're hex. | ||
| let n = U256::from_dec_str(s)?; | ||
| let mut bytes = [0u8; 32]; | ||
| n.to_big_endian(&mut bytes); | ||
|
|
||
| out.extend_from_slice(&bytes); | ||
| } | ||
|
|
||
| Ok(out) | ||
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,5 @@ | ||
| ETH_RPC_URL=http://localhost:8545 | ||
| PRIVATE_KEY=0xac0974bec39a17e36ba4a6b4d238ff944bacb478cbed5efcae784d7bf4f2ff80 | ||
| # Deploy the contract with make deploy_contract_devnet | ||
| FIBONACCI_CONTRACT_ADDRESS=<FIBONACCI_CONTRACT_ADDRESS> | ||
| NETWORK=devnet |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,6 @@ | ||
| ETH_RPC_URL=<RPC_URL> | ||
| # Make sure it has founds on Aligned | ||
| PRIVATE_KEY=<PRIVATE_KEY> | ||
| # Deploy the contract with make deploy_contract_devnet | ||
| FIBONACCI_CONTRACT_ADDRESS=<FIBONACCI_CONTRACT_ADDRESS> | ||
| NETWORK=<devnet|holesky|holeksy-stage|mainnet> | ||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1 @@ | ||
|
|
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.