Skip to content

feat(arithmetization): use #[cost:<identifier>] annotation to compute cost of zkc instructions#3284

Open
lorenzogentile404 wants to merge 28 commits into
mainfrom
3283-rv-use-costidentifier-annotation-to-compute-cost-of-zkc-instructions
Open

feat(arithmetization): use #[cost:<identifier>] annotation to compute cost of zkc instructions#3284
lorenzogentile404 wants to merge 28 commits into
mainfrom
3283-rv-use-costidentifier-annotation-to-compute-cost-of-zkc-instructions

Conversation

@lorenzogentile404
Copy link
Copy Markdown
Contributor

@lorenzogentile404 lorenzogentile404 commented Jun 7, 2026

This PR implements issue(s) #3283

Fixes the failing sample-guest-programs-run GitHub Actions job by correcting the default zkc compiler reference used in CI.

Root Cause

The arithmetization-sample-guest-programs-run.yml workflow always defaulted GO_CORSET_REF_FOR_ZKC to 'main' when triggered by a pull request (no manual input). Because GO_CORSET_REF_FOR_ZKC is set as an environment variable, it overrides the Makefile's ?= default (9f911becf5b02cdd96db75d0fa482c9ececf04c9). The main branch of LFDT-Lineth/zkc does not yet support the #[cost:...] attribute syntax, causing unexpected token errors on every .zkc file that uses cost annotations.

Fix

Changed the workflow's fallback default from 'main' to '9f911becf5b02cdd96db75d0fa482c9ececf04c9' — the same pinned commit already used by the Makefile (tip of the 1841-feat-cost-annotation-proposal branch in LFDT-Lineth/zkc). Custom refs provided via workflow_dispatch or workflow_call continue to work as before.

Checklist

  • I wrote new tests for my new core changes.
  • I have successfully ran tests, style checker and build against my new changes locally.
  • If this change is deployed to any environment (including Devnet), E2E test coverage exists or is included in this PR.
  • I have informed the team of any breaking changes if there are any.

@lorenzogentile404 lorenzogentile404 changed the title [RV] use #[cost:<identifier>] annotation to compute cost of zkc instructions feat(arithmetization): use #[cost:<identifier>] annotation to compute cost of zkc instructions Jun 7, 2026
@CLAassistant
Copy link
Copy Markdown

CLAassistant commented Jun 7, 2026

CLA assistant check
Thank you for your submission! We really appreciate it. Like many open source projects, we ask that you all sign our Contributor License Agreement before we can accept your contribution.
7 out of 9 committers have signed the CLA.

✅ Tabaie
✅ thedarkjester
✅ ivokub
✅ eloi010
✅ fluentcrafter
✅ jonesho
✅ lorenzogentile404
❌ linea-release-bot[bot]
❌ Copilot
You have signed the CLA already but the status is still pending? Let us recheck it.

Copilot AI changed the title feat(arithmetization): use #[cost:<identifier>] annotation to compute cost of zkc instructions fix(ci): update sample-guest-programs-run workflow to use pinned zkc commit supporting cost annotations Jun 7, 2026
@lorenzogentile404 lorenzogentile404 changed the title fix(ci): update sample-guest-programs-run workflow to use pinned zkc commit supporting cost annotations feat(arithmetization): use #[cost:<identifier>] annotation to compute cost of zkc instructions Jun 7, 2026
@lorenzogentile404 lorenzogentile404 force-pushed the 3283-rv-use-costidentifier-annotation-to-compute-cost-of-zkc-instructions branch from 5e3d1f2 to 283431d Compare June 7, 2026 18:39
thedarkjester and others added 22 commits June 7, 2026 21:52
Signed-off-by: Lorenzo Gentile <lorenzo.gentile@consensys.net>
Signed-off-by: Lorenzo Gentile <lorenzo.gentile@consensys.net>
…3194)

* fix: incorporate isAllowedCircuitID into aggregation FPI

* style: comments

* fix(contracts): refresh aggregation test fixtures

* fix(contracts): align rollup verifier test inputs

* docs(contracts): document verifier circuit mask env var

---------

Signed-off-by: Arya Tabaie <arya.pourtabatabaie@gmail.com>
Co-authored-by: Leo Jeong <dreamerty@postech.ac.kr>
Signed-off-by: Lorenzo Gentile <lorenzo.gentile@consensys.net>
…omponent and milestone [skip ci]

Signed-off-by: Lorenzo Gentile <lorenzo.gentile@consensys.net>
#3266)

* feat(ci): add choice of sequencer-interfaces to maven-release workflow

* feat(ci): revise build.gradle of sequencer-interfaces

* fix(ci): add repositories in buildScript

* feat(ci): disable publish-images-after-run-tests-success-on-main

* feat(ci): remove latest docker image tag and retag on unchanged component docker images

* chore(ci): rename check_image_tags_exist to compute_commit_tags

* chore(ci): change artifactId to sequencer-interfaces

Signed-off-by: Lorenzo Gentile <lorenzo.gentile@consensys.net>
* chore(maru): remove unused test

* chore(maru): remove unused test

Signed-off-by: Lorenzo Gentile <lorenzo.gentile@consensys.net>
…omponent and milestone [skip ci]

Signed-off-by: Lorenzo Gentile <lorenzo.gentile@consensys.net>
…3270)

* feat: absorb commitments in transcript

* chore: regenerate test fixture

* fix: update to latest arithmetization elf-to-json script

* feat: no-coreutils reversing of zkc input

* chore: tamper also public_ext

* test: test trace commitment inputs length

Signed-off-by: Lorenzo Gentile <lorenzo.gentile@consensys.net>
* feat: add code generation of verifier-side System

* feat: add exponentiation with comptime exponent

* feat: add vanishing polynomial check

* test: add vanishing fixture generation

* chore: generate vanishing testdata

* ci: check that vanishing testdata is up-to-date

* test: add vanishing tests

* docs: add some documentation notes

* docs: add later integration notes

* fix: ensure cancellation points are in allowed ranges

Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
Signed-off-by: Ivo Kubjas <tsimmm@gmail.com>

* fix: check that no coins in round 0

Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
Signed-off-by: Ivo Kubjas <tsimmm@gmail.com>

* fix: explicit error on too large module

Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
Signed-off-by: Ivo Kubjas <tsimmm@gmail.com>

* Revert "fix: ensure cancellation points are in allowed ranges"

This reverts commit 5967d8f.

---------

Signed-off-by: Ivo Kubjas <tsimmm@gmail.com>
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
Signed-off-by: Lorenzo Gentile <lorenzo.gentile@consensys.net>
)

* chore(ci): migrate amd64 runners to gha-lfdt-lineth-ss scale sets

Signed-off-by: Eloi Manuel <eloi.manuel@consensys.net>

* fix(ci): install zkc from LFDT-Lineth/zkc with go-corset fallback

go-corset moved to github.com/LFDT-Lineth/zkc. Install the matching
module path per ref (new path first, old path fallback) so refs on
either side of the rename resolve.

Signed-off-by: Eloi Manuel <eloi.manuel@consensys.net>

* fix(prover): resolve repo root via .git, not hardcoded dir name

GetRepoRootPath matched the literal "linea-monorepo" in the working
dir path, breaking after the rename to lineth-monorepo. Walk up to the
.git marker instead, so it is independent of the checkout dir name.

Signed-off-by: Eloi Manuel <eloi.manuel@consensys.net>

---------

Signed-off-by: Eloi Manuel <eloi.manuel@consensys.net>
Signed-off-by: Lorenzo Gentile <lorenzo.gentile@consensys.net>
Signed-off-by: Lorenzo Gentile <lorenzo.gentile@consensys.net>
Signed-off-by: Lorenzo Gentile <lorenzo.gentile@consensys.net>
Signed-off-by: Lorenzo Gentile <lorenzo.gentile@consensys.net>
Signed-off-by: Lorenzo Gentile <lorenzo.gentile@consensys.net>
Signed-off-by: Lorenzo Gentile <lorenzo.gentile@consensys.net>
Signed-off-by: Lorenzo Gentile <lorenzo.gentile@consensys.net>
Signed-off-by: Lorenzo Gentile <lorenzo.gentile@consensys.net>
Signed-off-by: Lorenzo Gentile <lorenzo.gentile@consensys.net>
The sample-guest-programs-run workflow was defaulting to `main` for
GO_CORSET_REF_FOR_ZKC, which overrides the Makefile's pinned commit.
The `main` branch of zkc does not yet support `#[cost:...]` annotations,
causing 'unexpected token' errors when running zkc on the .zkc files
that use cost annotations introduced in this PR.

Fix: default to the same pinned commit used by the Makefile
(9f911becf5b02cdd96db75d0fa482c9ececf04c9, tip of 1841-feat-cost-annotation-proposal
branch in LFDT-Lineth/zkc) instead of 'main'.

Signed-off-by: Lorenzo Gentile <lorenzo.gentile@consensys.net>
Signed-off-by: Lorenzo Gentile <lorenzo.gentile@consensys.net>
Signed-off-by: Lorenzo Gentile <lorenzo.gentile@consensys.net>
Signed-off-by: Lorenzo Gentile <lorenzo.gentile@consensys.net>
lorenzogentile404 and others added 4 commits June 7, 2026 21:55
Signed-off-by: Lorenzo Gentile <lorenzo.gentile@consensys.net>
Signed-off-by: Lorenzo Gentile <lorenzo.gentile@consensys.net>
The sample-guest-programs-run workflow was defaulting to `main` for
GO_CORSET_REF_FOR_ZKC, which overrides the Makefile's pinned commit.
The `main` branch of zkc does not yet support `#[cost:...]` annotations,
causing 'unexpected token' errors when running zkc on the .zkc files
that use cost annotations introduced in this PR.

Fix: default to the same pinned commit used by the Makefile
(9f911becf5b02cdd96db75d0fa482c9ececf04c9, tip of 1841-feat-cost-annotation-proposal
branch in LFDT-Lineth/zkc) instead of 'main'.

Signed-off-by: Lorenzo Gentile <lorenzo.gentile@consensys.net>
Signed-off-by: Lorenzo Gentile <lorenzo.gentile@consensys.net>
@lorenzogentile404 lorenzogentile404 force-pushed the 3283-rv-use-costidentifier-annotation-to-compute-cost-of-zkc-instructions branch from cdd978f to 1be8069 Compare June 7, 2026 19:57
@codecov
Copy link
Copy Markdown

codecov Bot commented Jun 7, 2026

❌ 2 Tests Failed:

Tests completed Failed Passed Skipped
1151 2 1149 1
View the full list of 2 ❄️ flaky test(s)
maru.app.MaruConsensusSwitchTest::follower node correctly switches from QBFT to POS after peering with Sequencer validator()

Flake rate in main: 66.67% (Passed 4 times, Failed 8 times)

Stack Traces | 175s run time
java.lang.AssertionError: invalid block time: expected=1 actual=2 blocks timestamps=[1780863825, 1780863826, 1780863827, 1780863828, 1780863829, 1780863830, 1780863831, 1780863832, 1780863833, 1780863834, 1780863835, 1780863836, 1780863837, 1780863838, 1780863839, 1780863840, 1780863841, 1780863842, 1780863843, 1780863844, 1780863845, 1780863847, 1780863849, 1780863850, 1780863852, 1780863853, 1780863854, 1780863855, 1780863856, 1780863857, 1780863858, 1780863859, 1780863860, 1780863861, 1780863862, 1780863863, 1780863864, 1780863865, 1780863866, 1780863867, 1780863868, 1780863869, 1780863870, 1780863871, 1780863872, 1780863873, 1780863874, 1780863875, 1780863876, 1780863877, 1780863878, 1780863879, 1780863880, 1780863881, 1780863882, 1780863883, 1780863884, 1780863885, 1780863886, 1780863887, 1780863888, 1780863889, 1780863890, 1780863891, 1780863892, 1780863893, 1780863894, 1780863895]
	at testutils.Checks.verifyBlockTime(Checks.kt:129)
	at maru.app.MaruConsensusSwitchTest.verifyConsensusSwitch(MaruConsensusSwitchTest.kt:95)
	at maru.app.MaruConsensusSwitchTest.follower node correctly switches from QBFT to POS after peering with Sequencer validator(MaruConsensusSwitchTest.kt:187)
	at java.base/java.lang.reflect.Method.invoke(Method.java:565)
	at java.base/java.util.concurrent.ForkJoinTask.doExec(ForkJoinTask.java:511)
	at java.base/java.util.concurrent.ForkJoinPool$WorkQueue.topLevelExec(ForkJoinPool.java:1450)
	at java.base/java.util.concurrent.ForkJoinPool.runWorker(ForkJoinPool.java:2019)
	at java.base/java.util.concurrent.ForkJoinWorkerThread.run(ForkJoinWorkerThread.java:187)
maru.test.MaruClusterTest::should instantiate multiple nodes in the cluster with discovery()

Flake rate in main: 27.27% (Passed 8 times, Failed 3 times)

Stack Traces | 129s run time
java.lang.AssertionError: 
Expecting actual:
  0
to be greater than or equal to:
  2

	at maru.test.MaruClusterTest.should_instantiate_multiple_nodes_in_the_cluster_with_discovery$lambda$0(MaruClusterTest.kt:175)
	at org.awaitility.core.AssertionCondition.lambda$new$0(AssertionCondition.java:53)
	at org.awaitility.core.ConditionAwaiter$ConditionPoller.call(ConditionAwaiter.java:248)
	at org.awaitility.core.ConditionAwaiter$ConditionPoller.call(ConditionAwaiter.java:235)
	at java.base/java.util.concurrent.FutureTask.run(FutureTask.java:328)
	at java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1090)
	at java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:614)
	at java.base/java.lang.Thread.run(Thread.java:1474)

To view more test analytics, go to the Test Analytics Dashboard
📋 Got 3 mins? Take this short survey to help us improve Test Analytics.

Signed-off-by: Lorenzo Gentile <lorenzo.gentile@consensys.net>
Sign up for free to 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.

[RV] use #[cost:<identifier>] annotation to compute cost of zkc instructions

9 participants