Skip to content
Merged
Show file tree
Hide file tree
Changes from 45 commits
Commits
Show all changes
48 commits
Select commit Hold shift + click to select a range
72524bd
compile
jialinli98 Dec 3, 2025
a1d4b83
more fixes
jialinli98 Dec 5, 2025
fd3714d
fixes
jialinli98 Dec 6, 2025
f44e3eb
more fixes
jialinli98 Dec 7, 2025
03d330d
fixes
jialinli98 Dec 8, 2025
4b19222
fixes
jialinli98 Dec 8, 2025
14972f0
ci
jialinli98 Dec 8, 2025
213aa66
fix
jialinli98 Dec 8, 2025
cfbfd2d
remove circuit tests
jialinli98 Dec 8, 2025
f2aaf16
fix
jialinli98 Dec 8, 2025
79c2ecf
fix
jialinli98 Dec 9, 2025
f40317a
fixes
jialinli98 Dec 9, 2025
8130404
fixes
jialinli98 Dec 9, 2025
61a624f
fixes
jialinli98 Dec 9, 2025
2a9a863
fixes
jialinli98 Dec 9, 2025
add371c
fixes
jialinli98 Dec 9, 2025
5d46de0
fix
jialinli98 Dec 9, 2025
63dee8e
fixes
jialinli98 Dec 10, 2025
8063023
fixes
jialinli98 Dec 10, 2025
fb2f020
fixes
jialinli98 Dec 10, 2025
bef2bf6
fix
jialinli98 Dec 10, 2025
3d281e7
fix
jialinli98 Dec 10, 2025
c2698c0
fix
jialinli98 Dec 10, 2025
e32ff64
Merge branch 'main' of https://github.com/noir-lang/eth-proofs into j…
jialinli98 Dec 10, 2025
6945d30
resolve warnings
jialinli98 Dec 11, 2025
b0c1b95
resolve warnings
jialinli98 Dec 11, 2025
8a2b626
resolve warnings
jialinli98 Dec 11, 2025
aae5836
resolve warnings
jialinli98 Dec 11, 2025
3e2adea
fix typescript compile errors
jialinli98 Dec 11, 2025
a2df451
fix
jialinli98 Dec 11, 2025
5569b3e
vlayer utils
jialinli98 Dec 12, 2025
4609e92
add test to yml
jialinli98 Dec 12, 2025
63a76e7
fixes
jialinli98 Dec 12, 2025
6563c9b
fix
jialinli98 Dec 13, 2025
395a691
fix
jialinli98 Dec 13, 2025
4097cf4
fix
jialinli98 Dec 14, 2025
dc81905
disable some CI build that fails
jialinli98 Dec 14, 2025
85f1d59
replace u256
jialinli98 Dec 15, 2025
78060fb
Revert "replace u256"
jialinli98 Dec 15, 2025
d681289
Revert "Revert "replace u256""
jialinli98 Dec 15, 2025
112f08f
fix
jialinli98 Dec 15, 2025
652767f
set min version to 1.0.0-beta.17
jialinli98 Dec 15, 2025
a720f8c
test fix
jialinli98 Dec 15, 2025
340ff96
readme
jialinli98 Dec 15, 2025
72e9613
16 bytes for u128
jialinli98 Dec 18, 2025
365e219
fix
jialinli98 Dec 19, 2025
0502176
Merge branch 'main' of https://github.com/noir-lang/eth-proofs into j…
jialinli98 Dec 19, 2025
2c1079c
merge
jialinli98 Dec 19, 2025
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions .github/workflows/circuits_e2e.yaml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
name: Circuits E2E Tests

on: [push, merge_group]

on:
workflow_dispatch:
jobs:
test:
name: Circuits E2E Tests
Expand All @@ -18,7 +18,7 @@ jobs:
- name: Use Node.js 20.x
uses: actions/setup-node@v3
with:
node-version: '20.x'
node-version: "20.x"

- name: Enable Corepack and Install Yarn 4
run: |
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/circuits_profile.yaml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
name: circuit profiling

on: [push, merge_group]
on:

jobs:
test:
Expand Down
3 changes: 2 additions & 1 deletion .github/workflows/contract_test.yml
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
name: ethereum contract tests

on: [push, merge_group]
on:
workflow_dispatch:

env:
FOUNDRY_PROFILE: ci
Expand Down
5 changes: 3 additions & 2 deletions .github/workflows/e2e_test.yaml
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
name: E2E Tests

on: [push, merge_group]
on:
workflow_dispatch:

jobs:
test:
Expand All @@ -18,7 +19,7 @@ jobs:
- name: Use Node.js 20.x
uses: actions/setup-node@v3
with:
node-version: '20.x'
node-version: "20.x"

- name: Enable Corepack and Install Yarn 4
run: |
Expand Down
39 changes: 39 additions & 0 deletions .github/workflows/nightly-canary.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
name: Noir Nightly Canary

on:
schedule:
# Run a check at 9 AM UTC
- cron: "0 9 * * *"

env:
CARGO_TERM_COLOR: always

permissions:
issues: write

jobs:
test:
name: Test on Nargo Nightly
runs-on: ubuntu-latest
steps:
- name: Checkout sources
uses: actions/checkout@v4

- name: Install Nargo
uses: noir-lang/[email protected]
with:
toolchain: nightly

- name: Run Noir tests
run: nargo test

- name: Alert on dead links
uses: JasonEtco/create-an-issue@v2
if: ${{ failure() }}
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
WORKFLOW_NAME: ${{ github.workflow }}
WORKFLOW_URL: ${{ github.server_url }}/${{ github.repository }}/actions/runs/${{ github.run_id }}
with:
update_existing: true
filename: .github/NIGHTLY_CANARY_DIED.md
29 changes: 29 additions & 0 deletions .github/workflows/pull-request-title.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
name: Pull Request

on:
merge_group:
pull_request_target:
types:
- opened
- reopened
- edited
- synchronize

permissions:
pull-requests: read

jobs:
conventional-title:
name: Validate PR title is Conventional Commit
runs-on: ubuntu-latest
steps:
- name: Check title
if: github.event_name == 'pull_request_target'
uses: amannn/action-semantic-pull-request@v5
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
types: |
fix
feat
chore
46 changes: 13 additions & 33 deletions .github/workflows/release.yaml
Original file line number Diff line number Diff line change
@@ -1,40 +1,20 @@
name: Release changesets
name: Release

# This workflow will be triggered on push to the main branch
# on:
# push:
# branches:
# - main
# temporarly manual triggers only
on:
workflow_dispatch:

concurrency: ${{ github.workflow }}-${{ github.ref }}
push:
branches:
- main

jobs:
release:
name: Release
release-please:
name: Create Release
outputs:
release-pr: ${{ steps.release.outputs.pr }}
tag-name: ${{ steps.release.outputs.tag_name }}
runs-on: ubuntu-latest
steps:
- name: Checkout Repo
uses: actions/checkout@v3

- name: Setup Node.js 20
uses: actions/setup-node@v3
with:
node-version: 20

- name: Enable Corepack and Install Yarn 4
run: |
corepack enable
yarn set version latest

- name: Install Dependencies
run: yarn install

- name: Create Release Pull Request
uses: changesets/action@v1
- name: Run release-please
id: release
uses: googleapis/release-please-action@v4
with:
version: yarn changeset version
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
token: ${{ secrets.NOIR_RELEASES_TOKEN }}
6 changes: 3 additions & 3 deletions .github/workflows/static_checks.yaml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
name: Static checks

on: [push, merge_group]

on:
workflow_dispatch:
jobs:
test:
name: Static checks
Expand All @@ -16,7 +16,7 @@ jobs:
- name: Use Node.js 20.x
uses: actions/setup-node@v3
with:
node-version: '20.x'
node-version: "20.x"

- name: Enable Corepack and Install Yarn 4
run: |
Expand Down
6 changes: 3 additions & 3 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ on:

env:
CARGO_TERM_COLOR: always
MINIMUM_NOIR_VERSION: 1.0.0-beta.16
MINIMUM_NOIR_VERSION: 1.0.0-beta.17

jobs:
noir-version-list:
Expand Down Expand Up @@ -47,8 +47,8 @@ jobs:
with:
toolchain: ${{ matrix.toolchain }}

- name: Run Noir tests
run: nargo test
- name: Run Ethereum Noir tests
run: nargo test --workspace

rust-equivalence-tests:
name: Test for equivalence against Rust impl
Expand Down
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -11,3 +11,4 @@ contract
dist
coverage
.DS_Store
.vscode/
2 changes: 1 addition & 1 deletion ethereum/circuits/get_account/src/main.nr
Original file line number Diff line number Diff line change
Expand Up @@ -2,5 +2,5 @@ use dep::ethereum::account::{AccountWithinBlock, get_account};
use dep::ethereum::misc::types::Address;

fn main(chain_id: pub Field, block_no: pub u64, address: pub Address) -> pub AccountWithinBlock {
get_account(chain_id, block_no, address)
get_account(chain_id as u32, block_no, address)
}
2 changes: 1 addition & 1 deletion ethereum/circuits/get_header/src/main.nr
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
use dep::ethereum::header::{BlockHeaderPartial, get_header};

fn main(chain_id: pub Field, block_no: pub u64) -> pub BlockHeaderPartial {
fn main(chain_id: pub u32, block_no: pub u64) -> pub BlockHeaderPartial {
get_header(chain_id, block_no)
}
4 changes: 2 additions & 2 deletions ethereum/circuits/get_log/src/main.nr
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
use dep::ethereum::log::{get_log, LogWithinBlock};

global MAX_LOG_DATA_LEN: u32 = 32;
global MAX_LOGS_COUNT = 1;
global MAX_LOGS_COUNT: u32 = 1;

fn main(
chain_id: pub Field,
block_number: pub u64,
tx_idx: pub Field,
log_idx: pub u32,
) -> pub LogWithinBlock<MAX_LOG_DATA_LEN> {
get_log::<MAX_LOG_DATA_LEN, MAX_LOGS_COUNT>(chain_id, block_number, tx_idx, log_idx)
get_log::<MAX_LOG_DATA_LEN, MAX_LOGS_COUNT>(chain_id as u32, block_number, tx_idx, log_idx)
}
2 changes: 1 addition & 1 deletion ethereum/circuits/get_receipt/src/main.nr
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
use dep::ethereum::receipt::{get_receipt, TxReceiptWithinBlock};

fn main(chain_id: pub Field, block_number: pub u64, tx_idx: pub Field) -> pub TxReceiptWithinBlock {
get_receipt(chain_id, block_number, tx_idx)
get_receipt(chain_id as u32, block_number, tx_idx)
}
2 changes: 1 addition & 1 deletion ethereum/circuits/get_storage/src/main.nr
Original file line number Diff line number Diff line change
Expand Up @@ -9,5 +9,5 @@ fn main(
address: pub Address,
storage_key: pub Bytes32,
) -> pub StorageWithinBlock<1> {
get_account_with_storage(chain_id, block_number, address, storage_key)
get_account_with_storage(chain_id as u32, block_number, address, storage_key)
}
3 changes: 1 addition & 2 deletions ethereum/circuits/get_storage_recursive/src/main.nr
Original file line number Diff line number Diff line change
Expand Up @@ -3,12 +3,11 @@ use dep::ethereum::{
misc::types::{Address, Bytes32},
};

#[recursive]
fn main(
chain_id: pub Field,
block_number: pub u64,
address: pub Address,
storage_key: pub Bytes32,
) -> pub StorageWithinBlock<1> {
get_account_with_storage(chain_id, block_number, address, storage_key)
get_account_with_storage(chain_id as u32, block_number, address, storage_key)
}
4 changes: 2 additions & 2 deletions ethereum/circuits/get_transaction/src/main.nr
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
use dep::ethereum::transaction::{get_transaction, TransactionWithinBlock};

global MAX_DATA_LEN_M = 1000;
global MAX_DATA_LEN_M: u32 = 1000;

fn main(
chain_id: pub Field,
block_number: pub u64,
tx_idx: pub Field,
) -> pub TransactionWithinBlock<MAX_DATA_LEN_M> {
let transaction_within_block: TransactionWithinBlock<MAX_DATA_LEN_M> =
get_transaction(chain_id, block_number, tx_idx);
get_transaction(chain_id as u32, block_number, tx_idx);
transaction_within_block
}
3 changes: 2 additions & 1 deletion ethereum/circuits/lib/Nargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -5,4 +5,5 @@ authors = ["Arkadiusz Konior, Marek Kirejczyk"]
compiler_version = ">=0.30.0"

[dependencies]
u2b = { tag = "v0.3.4", git = "https://github.com/vlayer-xyz/noir-u2b" }
keccak256 = {tag = "v0.1.1", git = "https://github.com/noir-lang/keccak256" }
bignum = {tag = "v0.8.3", git = "https://github.com/noir-lang/noir-bignum" }
27 changes: 19 additions & 8 deletions ethereum/circuits/lib/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -237,22 +237,33 @@ U256 is a structure to use as a type for big numbers.
It is used when dealing with numbers up to 2<sup>256</sup>. They can exceed Field maximum value.
In particular it is a word size in ETH and therefore it is a basic type used in both storage and slot values calculations.

[There](.src/uint256.nr) is an unoptimized implementation of this type using two U128 structures. Optimized version will appear in Noir.
This library uses `U256` from the [noir-bignum](https://github.com/noir-lang/noir-bignum) library. The [`uint256.nr`](./src/uint256.nr) module provides conversion utilities between `U256` and `Bytes32`/`Field` types.

Traits implemented for U256:
Traits implemented for U256 (from bignum library):

- Add
- Eq
- Serde
- Serde (via this library's implementation)

```rust
global u128_number = 0x10000000000000000000000000000000;
use dep::bignum::bignum::BigNum;
use dep::bignum::U256;
use crate::uint256::{from, from_field};

let big_number = U256::new(u128_number, u128_number);
// Create U256 values
let zero = U256::zero();
let one = U256::from(1);
let big_number = U256::modulus().udiv(U256::from(16));

let sum = big_number + U256::one();
assert_eq(sum, U256 { high: u128_number, low: u128_number + U128::one()});
// Convert from Bytes32
let bytes: Bytes32 = [0x10; 32];
let u256_from_bytes = from(bytes);

let serialized: [Field; 4] = big_number.serialize();
// Convert from Field
let field_value: Field = 100;
let u256_from_field = from_field(field_value);

// Serialization (uses 3 limbs)
let serialized: [Field; 3] = big_number.serialize();
assert_eq(U256::deserialize(serialized), big_number);
```
Loading