Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: merge upstream form v0.4.0 beta10 #7

Open
wants to merge 34 commits into
base: dev
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
34 commits
Select commit Hold shift + click to select a range
cb437cd
Merge pull request #147 from 0xPolygon/release/0.3.1
vcastellm Oct 29, 2024
7a84588
feat: Add `metadata` field on the certificate (#151)
goran-ethernal Oct 31, 2024
8481a35
minor improvements on the config (#149)
arnaubennassar Oct 31, 2024
faa2a74
feat: update zkevm-ethtx-manager to v0.2.1 (#153)
ToniRamirezM Nov 1, 2024
34e2887
refactor: retrieve and parse versions at buildtime
vcastellm Nov 5, 2024
6d8dd74
feat: use sqlite on lastgersync (#150)
arnaubennassar Nov 5, 2024
0f3f691
feat: use sqlite on claimsponsor (#157)
arnaubennassar Nov 5, 2024
effc267
chore: update versions
vcastellm Nov 6, 2024
a5422d2
chore: bump cdk-erigon to v2.1.2
vcastellm Nov 6, 2024
910b23b
Revert "chore: bump cdk-erigon to v2.1.2"
vcastellm Nov 6, 2024
0202614
feat: update zkevm-ethtx-manager to v0.2.1 (#153)
ToniRamirezM Nov 1, 2024
36255b3
hotfix: bad merge
vcastellm Nov 6, 2024
820ded7
Merge branch 'hotfix/bump-ethtx-manager' into develop
vcastellm Nov 6, 2024
85c5735
apply feedback
vcastellm Nov 6, 2024
5bee873
Reapply "chore: bump cdk-erigon to v2.1.2" (#162)
vcastellm Nov 6, 2024
c0724a0
bump versions
vcastellm Nov 7, 2024
d00229d
Merge pull request #161 from 0xPolygon/CDK-547-grab-the-contents-for-…
vcastellm Nov 7, 2024
d7d9947
feat: Use ListOffChainData instead of GetOffChainData (#152)
rbpol Nov 7, 2024
d9aa92a
feat: sqlite reorgdetector (#160)
arnaubennassar Nov 7, 2024
61fe7f6
feat: align Develop with changes in Release/0.4.0 (#174)
ToniRamirezM Nov 8, 2024
d4cf2db
fix: Various pessimistic proofs fixes and adaption to `kurtosis-cdk` …
goran-ethernal Nov 8, 2024
c1d0f13
feat: add timestamps to certificate (#175)
goran-ethernal Nov 8, 2024
7d144a0
chore: bump kustoris (#168)
vcastellm Nov 8, 2024
242f2f3
fix: local configuration bumping kurtosis to 0.2.29 (#176)
joanestebanr Nov 8, 2024
67c37e4
feat: sync UpdateL1InfoTreeV2 (#145)
arnaubennassar Nov 8, 2024
b480dd4
feat: remove sanity check (#178)
ToniRamirezM Nov 12, 2024
0ed309e
feat: include aggsender to release 0.4.0 (#181)
joanestebanr Nov 12, 2024
7c2b7f3
fix: add new error
goran-ethernal Nov 13, 2024
141a1d8
fix: ut
goran-ethernal Nov 13, 2024
a583263
feat: improve aggsender logs (#186)
joanestebanr Nov 14, 2024
97c2d58
fix: aggregating proofs (#191)
ToniRamirezM Nov 15, 2024
530e462
Merge from upstream v0.4.0-beta10
zjg555543 Nov 18, 2024
06df29c
test: fix v0.4.0 beta10 fix ut (#6)
zjg555543 Nov 18, 2024
5178692
Delete build rust bin file
zjg555543 Nov 18, 2024
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
1 change: 1 addition & 0 deletions .github/workflows/codeql.yml
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,7 @@ jobs:
uses: github/codeql-action/autobuild@v2

- name: Perform CodeQL Analysis
if: false # Disable CodeQL analysis for X Layer
uses: github/codeql-action/analyze@v2
with:
category: "/language:${{ matrix.language }}"
4 changes: 2 additions & 2 deletions .github/workflows/test-e2e.yml
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ jobs:
run: |
echo "deb [trusted=yes] https://apt.fury.io/kurtosis-tech/ /" | sudo tee /etc/apt/sources.list.d/kurtosis.list
sudo apt update
sudo apt install kurtosis-cli=1.3.0
sudo apt install kurtosis-cli=1.4.1
kurtosis version
- name: Disable kurtosis analytics
Expand Down Expand Up @@ -70,7 +70,7 @@ jobs:
with:
repository: 0xPolygon/kurtosis-cdk
path: "kurtosis-cdk"
ref: "v0.2.15"
ref: "v0.2.19"

- name: Setup Bats and bats libs
uses: bats-core/[email protected]
Expand Down
26 changes: 12 additions & 14 deletions .github/workflows/test-resequence.yml
Original file line number Diff line number Diff line change
Expand Up @@ -86,22 +86,20 @@ jobs:
working-directory: ./cdk-erigon
run: .github/scripts/test_resequence.sh

- name: Prepare logs
if: always()
working-directory: ./kurtosis-cdk
- name: Dump enclave logs
if: failure()
run: kurtosis dump ./dump

- name: Generate archive name
if: failure()
run: |
mkdir -p ci_logs
cd ci_logs
kurtosis service logs cdk-v1 cdk-erigon-node-001 --all > cdk-erigon-node-001.log
kurtosis service logs cdk-v1 cdk-erigon-sequencer-001 --all > cdk-erigon-sequencer-001.log
kurtosis service logs cdk-v1 zkevm-agglayer-001 --all > zkevm-agglayer-001.log
kurtosis service logs cdk-v1 zkevm-prover-001 --all > zkevm-prover-001.log
kurtosis service logs cdk-v1 cdk-node-001 --all > cdk-node-001.log
kurtosis service logs cdk-v1 zkevm-bridge-service-001 --all > zkevm-bridge-service-001.log
archive_name="dump_run_with_args_${{matrix.e2e-group}}_${{ github.run_id }}"
echo "ARCHIVE_NAME=${archive_name}" >> "$GITHUB_ENV"
echo "Generated archive name: ${archive_name}"

- name: Upload logs
if: always()
if: failure()
uses: actions/upload-artifact@v4
with:
name: logs_${{ github.run_id }}
path: ./kurtosis-cdk/ci_logs
name: ${{ env.ARCHIVE_NAME }}
path: ./dump
1 change: 1 addition & 0 deletions .github/workflows/test-unit.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ jobs:
go-version: [1.22.4]
goarch: ["amd64"]
runs-on: ubuntu-latest
if: false # Disable SonarCloud analysis for X Layer
steps:
- name: Checkout code
uses: actions/checkout@v4
Expand Down
2 changes: 2 additions & 0 deletions .golangci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,8 @@ linters-settings:
gocritic:
enabled-checks:
- ruleguard
disabled-checks:
- ifElseChain
revive:
rules:
- name: exported
Expand Down
58 changes: 38 additions & 20 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

29 changes: 0 additions & 29 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -11,39 +11,10 @@ RUN go mod download
COPY . .
RUN make build-go

# BUILD RUST BIN
FROM --platform=${BUILDPLATFORM} rust:slim-bookworm AS chef
USER root
RUN apt-get update && apt-get install -y openssl pkg-config libssl-dev
RUN cargo install cargo-chef
WORKDIR /app

FROM chef AS planner

COPY --link crates crates
COPY --link Cargo.toml Cargo.toml
COPY --link Cargo.lock Cargo.lock

RUN cargo chef prepare --recipe-path recipe.json --bin cdk

FROM chef AS builder

COPY --from=planner /app/recipe.json recipe.json
# Notice that we are specifying the --target flag!
RUN cargo chef cook --release --recipe-path recipe.json

COPY --link crates crates
COPY --link Cargo.toml Cargo.toml
COPY --link Cargo.lock Cargo.lock

ENV BUILD_SCRIPT_DISABLED=1
RUN cargo build --release --bin cdk

# CONTAINER FOR RUNNING BINARY
FROM --platform=${BUILDPLATFORM} debian:bookworm-slim

RUN apt-get update && apt-get install -y ca-certificates postgresql-client libssl-dev && rm -rf /var/lib/apt/lists/*
COPY --from=builder /app/target/release/cdk /usr/local/bin/
COPY --from=build /go/src/github.com/0xPolygon/cdk/target/cdk-node /usr/local/bin/

CMD ["/bin/sh", "-c", "cdk"]
34 changes: 32 additions & 2 deletions agglayer/client.go
Original file line number Diff line number Diff line change
Expand Up @@ -15,14 +15,22 @@ import (

const errCodeAgglayerRateLimitExceeded int = -10007

var ErrAgglayerRateLimitExceeded = fmt.Errorf("agglayer rate limit exceeded")
var (
ErrAgglayerRateLimitExceeded = fmt.Errorf("agglayer rate limit exceeded")
jSONRPCCall = rpc.JSONRPCCall
)

type AggLayerClientGetEpochConfiguration interface {
GetEpochConfiguration() (*ClockConfiguration, error)
}

// AgglayerClientInterface is the interface that defines the methods that the AggLayerClient will implement
type AgglayerClientInterface interface {
SendTx(signedTx SignedTx) (common.Hash, error)
WaitTxToBeMined(hash common.Hash, ctx context.Context) error
SendCertificate(certificate *SignedCertificate) (common.Hash, error)
GetCertificateHeader(certificateHash common.Hash) (*CertificateHeader, error)
AggLayerClientGetEpochConfiguration
}

// AggLayerClient is the client that will be used to interact with the AggLayer
Expand Down Expand Up @@ -91,7 +99,9 @@ func (c *AggLayerClient) WaitTxToBeMined(hash common.Hash, ctx context.Context)

// SendCertificate sends a certificate to the AggLayer
func (c *AggLayerClient) SendCertificate(certificate *SignedCertificate) (common.Hash, error) {
response, err := rpc.JSONRPCCall(c.url, "interop_sendCertificate", certificate)
certificateToSend := certificate.CopyWithDefaulting()

response, err := rpc.JSONRPCCall(c.url, "interop_sendCertificate", certificateToSend)
if err != nil {
return common.Hash{}, err
}
Expand Down Expand Up @@ -128,3 +138,23 @@ func (c *AggLayerClient) GetCertificateHeader(certificateHash common.Hash) (*Cer

return result, nil
}

// GetEpochConfiguration returns the clock configuration of AggLayer
func (c *AggLayerClient) GetEpochConfiguration() (*ClockConfiguration, error) {
response, err := jSONRPCCall(c.url, "interop_getEpochConfiguration")
if err != nil {
return nil, err
}

if response.Error != nil {
return nil, fmt.Errorf("GetEpochConfiguration code=%d msg=%s", response.Error.Code, response.Error.Message)
}

var result *ClockConfiguration
err = json.Unmarshal(response.Result, &result)
if err != nil {
return nil, err
}

return result, nil
}
Loading
Loading