Skip to content
Open
Show file tree
Hide file tree
Changes from 3 commits
Commits
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
13 changes: 13 additions & 0 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -44,12 +44,25 @@ jobs:
*.md
!PULL_REQUEST_TEMPLATE.md

- name: Verify generated Falcon NTT sources
run: |
python3 scripts/falcon_512/generate_ntt.py --write
git diff --exit-code -- packages/account/src/falcon_512/ntt

- name: Cairo lint
run: scarb fmt --check --workspace

- name: Run tests
run: snforge test --workspace --features fuzzing --fuzzer-runs 200

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.

Severity 2 — Low: CI runs the expensive Falcon suite redundantly.

The 65 dev-profile Falcon tests run twice (here and in the coverage run at line 67), several above 1e9 L2 gas, serial in one job — and the coverage run doesn't enable falcon_presets_tests, so the Falcon presets (SRC9 routing, upgrade's assert_only_self) report as entirely untested in Codecov anyway. Two further cost sinks: test_fast_ntt_matches_generic_reference_for_every_basis_vector alone costs 7.65B gas (~76M steps) and is single-handedly why the 100M step cap is needed (the boundary/pseudorandom test already covers the interesting cases — sample every 16th basis vector or feature-gate it); and the #[cfg(test)] felt wrapper re-inlines the 31k-statement NTT body, making ~26.7% of the test program duplicate code and a 44 MB test artifact (have it call ntt_falcon512_fast_u16_unchecked and convert instead).


- name: Run Falcon release-profile tests
run: |
snforge test -p openzeppelin_account --release --features falcon_fast_tests falcon_512 --max-n-steps 100000000
snforge test -p openzeppelin_presets --release --features falcon_presets_tests falcon_512 --max-n-steps 100000000

- name: Build release-profile presets

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.

Severity 3 — Medium: CI never compiles the presets to CASM, and the default profile silently produces an undeclarable class.

With casm = false in packages/presets/Scarb.toml, this step only ever produces Sierra — nothing verifies the class lowers to CASM or fits the 81,920-felt bytecode cap. Verified on this branch:

  • release profile: Falcon512ShakeAccountUpgradeable = 57,120 CASM felts (69.7% of the cap), direct = 57,048; 2.16 MB Sierra vs the ~4.09 MB class-size cap.
  • dev profile: plain scarb build -p openzeppelin_presets emits a 32.6 MB contract_class.json (8× over the declare limit, debug info balloons), and with casm = true it hard-fails with OffsetOverflowinlining-strategy = "avoid" still honors #[inline(always)] on the 9,480-line NTT body.

A future regression lands with green CI, and headroom is ~24.8k felts.

Suggested fix: enable CASM for the release target and assert bytecode size < 81,920 in CI; document that these presets are release-profile-only; consider recording them in scripts/benchmarking.

run: scarb --release build -p openzeppelin_presets

- name: Run tests and generate coverage report
run: snforge test --workspace --coverage

Expand Down
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,10 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0

### Added

- `Falcon512AccountComponent`, SHAKE-256 hint and direct verifier strategies,

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.

Severity 3 — Medium: CHANGELOG omits most of the new public API.

Missing, though all newly public: Falcon512SignatureVerifier, Falcon512ShakeVerifier, Falcon512ShakeDirectVerifier, IFeltArrayDeployable, IFeltArrayPublicKey, IFeltArrayPublicKeyCamel, FeltArrayAccountABI, Falcon512AccountUpgradeableABI + dispatchers, and the new openzeppelin_corelib_imports package (precedent for package entries exists earlier in this file).

`Falcon512ShakeAccountUpgradeable` and `Falcon512ShakeDirectAccountUpgradeable` presets with SRC9
and class upgrades, and felt-array deployment and public-key interfaces for Falcon-512 accounts
(#1730)
- `SafeERC20DispatcherTrait` in `openzeppelin_token::erc20::utils` with `assert_transfer`, `assert_transfer_from`, `assert_increase_allowance`, and `assert_decrease_allowance` (#1683)

### Changed (Breaking)
Expand Down
5 changes: 5 additions & 0 deletions Scarb.lock
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,7 @@ dependencies = [
name = "openzeppelin_account"
version = "4.0.0-alpha.1"
dependencies = [
"openzeppelin_corelib_imports",
"openzeppelin_interfaces",
"openzeppelin_introspection",
"openzeppelin_test_common",
Expand All @@ -47,6 +48,10 @@ dependencies = [
"snforge_std",
]

[[package]]
name = "openzeppelin_corelib_imports"
version = "4.0.0-alpha.1"

[[package]]
name = "openzeppelin_finance"
version = "4.0.0-alpha.1"
Expand Down
1 change: 1 addition & 0 deletions Scarb.toml
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
members = [
"packages/access",
"packages/account",
"packages/corelib_imports",
"packages/finance",
"packages/interfaces",
"packages/governance",
Expand Down
Loading
Loading