Skip to content

Commit

Permalink
Merge branch 'main' into prover/feat/libdecompressor-abuseeth
Browse files Browse the repository at this point in the history
  • Loading branch information
jpnovais authored Sep 27, 2024
2 parents db3a3e2 + dec6a29 commit 151aa62
Show file tree
Hide file tree
Showing 10 changed files with 30 additions and 5 deletions.
1 change: 1 addition & 0 deletions .github/workflows/coordinator-build-and-publish.yml
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,7 @@ jobs:
build-and-publish:
runs-on: ubuntu-22.04
name: Coordinator build
environment: docker-build-and-e2e
env:
COMMIT_TAG: ${{ inputs.commit_tag }}
DEVELOP_TAG: ${{ inputs.develop_tag }}
Expand Down
12 changes: 12 additions & 0 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -187,3 +187,15 @@ jobs:
untested_tag_suffix: ${{ needs.store-image-name-and-tags.outputs.untested_tag_suffix }}
image_names: '["consensys/linea-coordinator", "consensys/linea-postman", "consensys/linea-prover", "consensys/linea-traces-api-facade"]'
secrets: inherit

cleanup-deployments:
needs: [ run-e2e-tests, run-e2e-tests-geth-tracing ]
if: ${{ always() }}
runs-on: besu-arm64
steps:
- uses: strumwolf/delete-deployment-environment@v2
with:
token: ${{ secrets.GITHUB_TOKEN }}
environment: docker-build-and-e2e
ref: ${{ github.ref_name }}
onlyRemoveDeployments: true
1 change: 1 addition & 0 deletions .github/workflows/postman-build-and-publish.yml
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,7 @@ jobs:
build-and-publish:
runs-on: ubuntu-22.04
name: Postman build
environment: docker-build-and-e2e
env:
COMMIT_TAG: ${{ inputs.commit_tag }}
DEVELOP_TAG: ${{ inputs.develop_tag }}
Expand Down
1 change: 1 addition & 0 deletions .github/workflows/prover-build-and-publish.yml
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,7 @@ jobs:
build-and-publish:
runs-on: ubuntu-latest
name: Prover build
environment: docker-build-and-e2e
env:
COMMIT_TAG: ${{ inputs.commit_tag }}
DEVELOP_TAG: ${{ inputs.develop_tag }}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ on:
jobs:

build-linux:
runs-on: besu-arm64
runs-on: ubuntu-24.04
steps:
- name: Checkout code
uses: actions/checkout@v4
Expand Down
1 change: 1 addition & 0 deletions .github/workflows/reuse-run-e2e-tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -76,6 +76,7 @@ jobs:
outputs:
tests_outcome: ${{ steps.run_e2e_tests.outcome }}
runs-on: ubuntu-22.04
environment: docker-build-and-e2e
steps:
- name: Setup upterm session
if: ${{ inputs.e2e-tests-with-ssh }}
Expand Down
1 change: 1 addition & 0 deletions .github/workflows/traces-api-facade-build-and-publish.yml
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,7 @@ jobs:
build-and-publish:
runs-on: ubuntu-latest
name: Traces api facade build
environment: docker-build-and-e2e
env:
COMMIT_TAG: ${{ inputs.commit_tag }}
DEVELOP_TAG: ${{ inputs.develop_tag }}
Expand Down
2 changes: 1 addition & 1 deletion docker/compose-local-dev-traces-v2.overrides.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ services:
- ../config/common/traces-limits-besu-v2.toml:/var/lib/besu/traces-limits.toml:ro

linea-besu-sequencer-plugin-downloader:
command: [ "sh", "/file-downloader.sh", "https://github.com/Consensys/linea-sequencer/releases/download/v0.6.0-rc5.1/linea-sequencer-v0.6.0-rc5.1.jar", "/linea-besu-sequencer" ]
command: [ "sh", "/file-downloader.sh", "https://github.com/Consensys/linea-sequencer/releases/download/v0.6.0-rc6.1/linea-sequencer-v0.6.0-rc6.1.jar", "/linea-besu-sequencer" ]

traces-node:
command: ['echo', 'forced exit as replaced by traces-node-v2']
Expand Down
11 changes: 9 additions & 2 deletions prover/circuits/setup.go
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ import (
plonk_bls12377 "github.com/consensys/gnark/backend/plonk/bls12-377"
plonk_bn254 "github.com/consensys/gnark/backend/plonk/bn254"
plonk_bw6761 "github.com/consensys/gnark/backend/plonk/bw6-761"
"github.com/consensys/gnark/backend/solidity"
"github.com/sirupsen/logrus"

kzg377 "github.com/consensys/gnark-crypto/ecc/bls12-377/kzg"
Expand All @@ -31,6 +32,12 @@ import (
"github.com/consensys/linea-monorepo/prover/utils"
)

const (
// solidityPragmaVersion is the version of the Solidity compiler to target.
// it is used for generating the verifier contract from the PLONK verifying key.
solidityPragmaVersion = "0.8.26"
)

// Setup contains the proving and verifying keys of a circuit, as well as the constraint system.
// It's a common structure used to pass around the resources associated with a circuit.
type Setup struct {
Expand Down Expand Up @@ -76,7 +83,7 @@ func MakeSetup(
hasSolidity := setup.Circuit.Field().String() == ecc.BN254.ScalarField().String()
if hasSolidity {
h := sha256.New()
if err = vk.ExportSolidity(h); err != nil {
if err = vk.ExportSolidity(h, solidity.WithPragmaVersion(solidityPragmaVersion)); err != nil {
return Setup{}, fmt.Errorf("computing checksum for verifier contract: %w", err)
}
setup.Manifest.Checksums.VerifierContract = "0x" + hex.EncodeToString(h.Sum(nil))
Expand Down Expand Up @@ -131,7 +138,7 @@ func (s *Setup) WriteTo(rootDir string) error {
return fmt.Errorf("creating verifier contract file: %w", err)
}
defer f.Close()
if err = s.VerifyingKey.ExportSolidity(f); err != nil {
if err = s.VerifyingKey.ExportSolidity(f, solidity.WithPragmaVersion(solidityPragmaVersion)); err != nil {
return fmt.Errorf("exporting verifier contract to file: %w", err)
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ import (
"strings"

"github.com/consensys/gnark-crypto/ecc"
"github.com/consensys/gnark/backend/solidity"
"github.com/consensys/linea-monorepo/prover/backend/aggregation"
"github.com/consensys/linea-monorepo/prover/backend/blobsubmission"
"github.com/consensys/linea-monorepo/prover/backend/files"
Expand Down Expand Up @@ -367,7 +368,7 @@ func dumpVerifierContract(odir string, circID circuits.MockCircuitID) {
printlnAndExit("could not create public parameters: %v", err)
}

if err := pp.VerifyingKey.ExportSolidity(f); err != nil {
if err := pp.VerifyingKey.ExportSolidity(f, solidity.WithPragmaVersion("0.8.26")); err != nil {
printlnAndExit("could not export verifying key to solidity: %v", err)
}
}

0 comments on commit 151aa62

Please sign in to comment.