Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
36 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
9788615
disable a few CI build that fails
jialinli98 Dec 14, 2025
11daffc
set minimum version to 1.0.0-beta.17
jialinli98 Dec 15, 2025
14d529d
Merge branch 'main' into jl/new_compile
jialinli98 Dec 15, 2025
fff04e5
fix
jialinli98 Dec 15, 2025
3bbda03
Merge branch 'jl/new_compile' of https://github.com/noir-lang/eth-pro…
jialinli98 Dec 15, 2025
9fde674
u128 can fit in 16 bytes
jialinli98 Dec 18, 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
5 changes: 3 additions & 2 deletions .github/workflows/circuits_e2e.yaml
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
name: Circuits 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
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
6 changes: 3 additions & 3 deletions .github/workflows/e2e_test.yaml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
name: E2E Tests

on: [push, merge_group]

on:
workflow_dispatch:
jobs:
test:
name: 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
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 }}
Comment on lines +10 to +20

Check warning

Code scanning / CodeQL

Workflow does not contain permissions Medium

Actions job or workflow does not limit the permissions of the GITHUB_TOKEN. Consider setting an explicit permissions block, using the following as a minimal starting point: {}

Copilot Autofix

AI about 2 months ago

The fix involves adding a permissions block to the job (or, at the workflow root, if more jobs are present). It should specify only the minimal permissions required for the release-please job and the action it runs. The googleapis/release-please-action typically needs to create PRs (pull-requests: write) and push tags/releases (contents: write); other permissions (such as actions: read or checks: read) are not required. The recommended fix is to add a block just below release-please: (line 9) as a sibling to runs-on, indicating:

permissions:
  contents: write
  pull-requests: write

This restricts the workflow token to only these scopes for this job. No external libraries or imports are needed—just YAML modifications in this region.


Suggested changeset 1
.github/workflows/release.yaml

Autofix patch

Autofix patch
Run the following command in your local git repository to apply this patch
cat << 'EOF' | git apply
diff --git a/.github/workflows/release.yaml b/.github/workflows/release.yaml
--- a/.github/workflows/release.yaml
+++ b/.github/workflows/release.yaml
@@ -8,6 +8,9 @@
 jobs:
   release-please:
     name: Create Release
+    permissions:
+      contents: write
+      pull-requests: write
     outputs:
       release-pr: ${{ steps.release.outputs.pr }}
       tag-name: ${{ steps.release.outputs.tag_name }}
EOF
@@ -8,6 +8,9 @@
jobs:
release-please:
name: Create Release
permissions:
contents: write
pull-requests: write
outputs:
release-pr: ${{ steps.release.outputs.pr }}
tag-name: ${{ steps.release.outputs.tag_name }}
Copilot is powered by AI and may make mistakes. Always verify output.
5 changes: 3 additions & 2 deletions .github/workflows/static_checks.yaml
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
name: Static checks

on: [push, merge_group]
on:
workflow_dispatch:

jobs:
test:
Expand All @@ -16,7 +17,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/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
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)
}
2 changes: 1 addition & 1 deletion ethereum/circuits/get_storage_recursive/src/main.nr
Original file line number Diff line number Diff line change
Expand Up @@ -10,5 +10,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)
}
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
}
2 changes: 1 addition & 1 deletion ethereum/circuits/lib/Nargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -5,4 +5,4 @@ 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" }
28 changes: 15 additions & 13 deletions ethereum/circuits/lib/src/account.nr
Original file line number Diff line number Diff line change
@@ -1,20 +1,20 @@
use crate::account_with_storage::Account;
pub use crate::account_with_storage::Account;
use crate::header::get_header;
use crate::merkle_patricia_proofs::proof::ProofInput;
use crate::misc::types::{Address, Bytes32, BYTES32_LENGTH};
use crate::misc::types::{Address, Bytes32};
use crate::serde::Serde;
use crate::verifiers::account::verify_account;

global MAX_KEY_LEN: u32 = 32;
global MAX_PREFIXED_KEY_NIBBLE_LEN: u32 = 66; // (MAX_KEY_LEN + 1) * 2
global MAX_ACCOUNT_DEPTH_NO_LEAF_M: u32 = 10; // Emperically correct values to be determined after we scan ethereum state trie.
pub(crate) global MAX_PREFIXED_KEY_NIBBLE_LEN: u32 = (MAX_KEY_LEN + 1) * 2; // (MAX_KEY_LEN + 1) * 2
pub global MAX_ACCOUNT_DEPTH_NO_LEAF_M: u32 = 10; // Emperically correct values to be determined after we scan ethereum state trie.

global MAX_ACCOUNT_STATE_LEN: u32 = 110; // Values taken from accountProofConfig in account.ts.
global MAX_ACCOUNT_LEAF_LEN: u32 = 148;
pub(crate) global MAX_ACCOUNT_STATE_LEN: u32 = 110; // Values taken from accountProofConfig in account.ts.
pub(crate) global MAX_ACCOUNT_LEAF_LEN: u32 = 148;

struct AccountWithinBlock {
account: Account,
block_hash: Bytes32,
pub struct AccountWithinBlock {
pub(crate) account: Account,
pub(crate) block_hash: Bytes32,
}

impl Eq for AccountWithinBlock {
Expand All @@ -27,22 +27,24 @@ type AccountWithStateProofM = (Account, ProofInput<MAX_PREFIXED_KEY_NIBBLE_LEN,

type ProofInputSerialized<let LEN: u32> = [Field; LEN];

pub fn get_account(chain_id: Field, block_no: u64, address: Address) -> AccountWithinBlock {
let (account, state_proof) = get_account_unconstrained_M(chain_id, block_no, address);
pub fn get_account(chain_id: u32, block_no: u64, address: Address) -> AccountWithinBlock {
// Safety: verification done separately
let (account, state_proof) =
unsafe { get_account_unconstrained_M(chain_id, block_no, address) };
let header = get_header(chain_id, block_no);
verify_account(address, account, state_proof, header.state_root);
AccountWithinBlock { account, block_hash: header.hash }
}

#[oracle(get_account)]
unconstrained fn get_account_oracle<let PROOF_INPUT_LEN: u32>(
_chain_id: Field,
_chain_id: u32,
_block_no: u64,
_address: [u8; 20],
) -> (Account, ProofInputSerialized<PROOF_INPUT_LEN>) {}

unconstrained fn get_account_unconstrained_M(
chain_id: Field,
chain_id: u32,
block_no: u64,
address: Address,
) -> AccountWithStateProofM {
Expand Down
25 changes: 16 additions & 9 deletions ethereum/circuits/lib/src/account_int_test.nr
Original file line number Diff line number Diff line change
Expand Up @@ -5,21 +5,24 @@ use crate::fixtures::mainnet::{
account::{
account as account_from_different_header, address as address_from_different_header,
},
header::state_root as state_root_from_different_header,
state_proof::proof_input_serialized as state_proof_input_from_different_header_serialized,
},
paris::usdc_circle::{
account::{account, address},
header::{block_header_partial, block_header_rlp, number, state_root},
header::{block_header_partial, block_header_rlp, number},
state_proof::proof_input_serialized as state_proof_input_serialized,
},
};
use dep::std::test::OracleMock;

#[test]
fn test_get_account_success() {
let _ = OracleMock::mock("get_header").returns((block_header_partial, block_header_rlp));
let _ = OracleMock::mock("get_account").returns((account, state_proof_input_serialized));
// Safety: test
let _ =
unsafe { OracleMock::mock("get_header").returns((block_header_partial, block_header_rlp)) };
// Safety: test
let _ =
unsafe { OracleMock::mock("get_account").returns((account, state_proof_input_serialized)) };

let account_within_block = get_account(ETHEREUM_MAINNET_ID, number, address);

Expand All @@ -33,10 +36,14 @@ fn test_get_account_success() {

#[test(should_fail)]
fn test_get_account_wrong_state_root() {
let _ = OracleMock::mock("get_header").returns((block_header_partial, block_header_rlp));
let _ = OracleMock::mock("get_account").returns((
account_from_different_header, state_proof_input_from_different_header_serialized,
));

// Safety: test
let _ =
unsafe { OracleMock::mock("get_header").returns((block_header_partial, block_header_rlp)) };
// Safety: test
let _ = unsafe {
OracleMock::mock("get_account").returns((
account_from_different_header, state_proof_input_from_different_header_serialized,
))
};
let _ = get_account(ETHEREUM_MAINNET_ID, number, address_from_different_header);
}
Loading