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

Pullupstream/v0.5.0 #63

Merged
merged 46 commits into from
Feb 7, 2024
Merged
Show file tree
Hide file tree
Changes from 45 commits
Commits
Show all changes
46 commits
Select commit Hold shift + click to select a range
6e8ad9e
fix migration batch wip field. fix sequence when no wip batch (#3126)
agnusmor Jan 23, 2024
22b2651
fix Leaves smtproof (#3127)
ARR552 Jan 23, 2024
1962ca1
Add l2block log dump when storing error. Refactor ProcessBatchV2 logs…
agnusmor Jan 24, 2024
c3dddf7
fix panic etherman (#3133)
ARR552 Jan 24, 2024
8e1e5e9
Fix GetL2Hash function. Use tx L2 hash returned by the executor when …
agnusmor Jan 24, 2024
19d493e
remove l2 tx hash computation and use data stored in the state return…
tclemos Jan 25, 2024
8124e52
etrog: fix permissionless errors (#3140)
joanestebanr Jan 25, 2024
895c1e0
Fix missing batch bookmark (#3122)
ToniRamirezM Jan 25, 2024
6feb7b8
fix wipL2Block deltaTimestamp (#3142)
agnusmor Jan 25, 2024
646603e
ensure tx order in stream (#3144)
ToniRamirezM Jan 25, 2024
4ddba20
fix wipL2Block stateRoot (#3145)
agnusmor Jan 25, 2024
1825164
fix panic NewStackTrie (#3146)
ARR552 Jan 25, 2024
bc51813
fix sync initalization for etrog (#3147)
tclemos Jan 25, 2024
4dc6258
fix wipL2block imStateRoot (#3148)
agnusmor Jan 26, 2024
86fcb5b
fix tracer to work by block stateroot instead of by tx (#3150)
tclemos Jan 26, 2024
75a957f
update prover image (#3151)
ToniRamirezM Jan 26, 2024
f69f0f9
if a trusted batch is empty and WIP just create the entry in state.ba…
joanestebanr Jan 26, 2024
65a507e
fix trace for tx index greater than 0 (#3153)
tclemos Jan 26, 2024
8f79b21
add cardona.zip (#3154)
joanestebanr Jan 26, 2024
c100d40
Fix default value when creating transaction.used_sha256_hashes field …
agnusmor Jan 26, 2024
1a8dd7d
add cardona testnet (#2909) (#3155)
joanestebanr Jan 26, 2024
f3b86d4
new fields in stream (#3149)
ToniRamirezM Jan 26, 2024
b47986a
set stateManagerPurge to false in Cardona (#3158)
joanestebanr Jan 26, 2024
eea3833
synchronizer: fix case emtpy batch and unittest (#3159)
joanestebanr Jan 27, 2024
7497d07
update prover image to v4.0.1 (#3160)
agnusmor Jan 27, 2024
12022c2
update prover image to v4.0.2 (#3162)
agnusmor Jan 27, 2024
a296484
Add a note in deployment instruction to restart rpc after forkId 7 (#…
joanestebanr Jan 27, 2024
5dfe003
change position of point 10
agnusmor Jan 27, 2024
479ba46
add point 11
agnusmor Jan 27, 2024
9e2a95d
add lines
agnusmor Jan 27, 2024
b216df0
add breakline
agnusmor Jan 27, 2024
f5bc983
add lines
agnusmor Jan 27, 2024
87bb731
add line
agnusmor Jan 27, 2024
4e0d164
Pull changes from zkevm-node @ release/v0.5.0
rachit77 Jan 30, 2024
8251250
addressed comments
rachit77 Feb 4, 2024
61cb0ff
wip
rachit77 Feb 4, 2024
3c4a8aa
updated mocks
rachit77 Feb 4, 2024
5ba4e71
CDK DAC interfaces got renamed, apply those updates to the Makefile m…
Stefan-Ethernal Feb 5, 2024
6d82046
Linter errors fixes
Stefan-Ethernal Feb 5, 2024
51944b6
testnet files are needed for docker
rachit77 Feb 5, 2024
c265b1d
revert go-ethereum to 1.13.2
rachit77 Feb 5, 2024
5a35276
Bump only the version of the cdk-dac dependency to v0.0.4
Stefan-Ethernal Feb 5, 2024
96c9ffd
Merge branch 'develop' into pullupstream/v0.5.0
Stefan-Ethernal Feb 5, 2024
aae26e1
updated docs
rachit77 Feb 5, 2024
55adae7
Try removing testnet configuration
Stefan-Ethernal Feb 5, 2024
7c20694
docs update
rachit77 Feb 6, 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: 0 additions & 1 deletion Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,6 @@ RUN cd /src && make build
# CONTAINER FOR RUNNING BINARY
FROM alpine:3.18.4
COPY --from=build /src/dist/zkevm-node /app/zkevm-node
COPY --from=build /src/config/environments/testnet/node.config.toml /app/example.config.toml
RUN apk update && apk add postgresql15-client
EXPOSE 8123
CMD ["/bin/sh", "-c", "/app/zkevm-node run"]
30 changes: 19 additions & 11 deletions aggregator/aggregator.go
Original file line number Diff line number Diff line change
Expand Up @@ -1004,6 +1004,15 @@ func (a *Aggregator) buildInputProver(ctx context.Context, batchToVerify *state.
if err != nil {
return nil, err
}
leaves, err := a.State.GetLeafsByL1InfoRoot(ctx, *l1InfoRoot, nil)
if err != nil {
return nil, err
}

aLeaves := make([][32]byte, len(leaves))
for i, leaf := range leaves {
aLeaves[i] = l1infotree.HashLeafData(leaf.GlobalExitRoot.GlobalExitRoot, leaf.PreviousBlockHash, uint64(leaf.Timestamp.Unix()))
}

for _, l2blockRaw := range batchRawData.Blocks {
_, contained := l1InfoTreeData[l2blockRaw.IndexL1InfoTree]
Expand All @@ -1013,21 +1022,20 @@ func (a *Aggregator) buildInputProver(ctx context.Context, batchToVerify *state.
return nil, err
}

leaves, err := a.State.GetLeafsByL1InfoRoot(ctx, l1InfoTreeExitRootStorageEntry.L1InfoTreeRoot, nil)
if err != nil {
return nil, err
}

aLeaves := make([][32]byte, len(leaves))
for i, leaf := range leaves {
aLeaves[i] = l1infotree.HashLeafData(leaf.GlobalExitRoot.GlobalExitRoot, leaf.PreviousBlockHash, uint64(leaf.Timestamp.Unix()))
}

// Calculate smt proof
smtProof, _, err := tree.ComputeMerkleProof(l2blockRaw.IndexL1InfoTree, aLeaves)
smtProof, calculatedL1InfoRoot, err := tree.ComputeMerkleProof(l2blockRaw.IndexL1InfoTree, aLeaves)
if err != nil {
return nil, err
}
if l1InfoRoot != nil && *l1InfoRoot != calculatedL1InfoRoot {
for i, l := range aLeaves {
log.Info("AllLeaves[%d]: %s", i, common.Bytes2Hex(l[:]))
}
for i, s := range smtProof {
log.Info("smtProof[%d]: %s", i, common.Bytes2Hex(s[:]))
}
return nil, fmt.Errorf("error: l1InfoRoot mismatch. L1InfoRoot: %s, calculatedL1InfoRoot: %s. l1InfoTreeIndex: %d", l1InfoRoot.String(), calculatedL1InfoRoot.String(), l2blockRaw.IndexL1InfoTree)
}

protoProof := make([][]byte, len(smtProof))
for i, proof := range smtProof {
Expand Down
5 changes: 5 additions & 0 deletions aggregator/aggregator_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -799,6 +799,7 @@ func TestTryGenerateBatchProof(t *testing.T) {
TimestampBatchEtrog: &t,
}
m.stateMock.On("GetVirtualBatch", mock.Anything, lastVerifiedBatchNum+1, nil).Return(&vb, nil).Twice()
m.stateMock.On("GetLeafsByL1InfoRoot", mock.Anything, *vb.L1InfoRoot, nil).Return([]state.L1InfoTreeExitRootStorageEntry{}, nil).Twice()
expectedInputProver, err := a.buildInputProver(context.Background(), &batchToProve)
require.NoError(err)
m.proverMock.On("BatchProof", expectedInputProver).Return(nil, errBanana).Once()
Expand Down Expand Up @@ -840,6 +841,7 @@ func TestTryGenerateBatchProof(t *testing.T) {
TimestampBatchEtrog: &t,
}
m.stateMock.On("GetVirtualBatch", mock.Anything, lastVerifiedBatchNum+1, nil).Return(&vb, nil).Twice()
m.stateMock.On("GetLeafsByL1InfoRoot", mock.Anything, *vb.L1InfoRoot, nil).Return([]state.L1InfoTreeExitRootStorageEntry{}, nil).Twice()
expectedInputProver, err := a.buildInputProver(context.Background(), &batchToProve)
require.NoError(err)
m.proverMock.On("BatchProof", expectedInputProver).Return(&proofID, nil).Once()
Expand Down Expand Up @@ -882,6 +884,7 @@ func TestTryGenerateBatchProof(t *testing.T) {
TimestampBatchEtrog: &t,
}
m.stateMock.On("GetVirtualBatch", mock.Anything, lastVerifiedBatchNum+1, nil).Return(&vb, nil).Twice()
m.stateMock.On("GetLeafsByL1InfoRoot", mock.Anything, *vb.L1InfoRoot, nil).Return([]state.L1InfoTreeExitRootStorageEntry{}, nil).Twice()
expectedInputProver, err := a.buildInputProver(context.Background(), &batchToProve)
require.NoError(err)
m.proverMock.On("BatchProof", expectedInputProver).Return(&proofID, nil).Once()
Expand Down Expand Up @@ -924,6 +927,7 @@ func TestTryGenerateBatchProof(t *testing.T) {
TimestampBatchEtrog: &t,
}
m.stateMock.On("GetVirtualBatch", mock.Anything, lastVerifiedBatchNum+1, nil).Return(&vb, nil).Twice()
m.stateMock.On("GetLeafsByL1InfoRoot", mock.Anything, *vb.L1InfoRoot, nil).Return([]state.L1InfoTreeExitRootStorageEntry{}, nil).Twice()
expectedInputProver, err := a.buildInputProver(context.Background(), &batchToProve)
require.NoError(err)
m.proverMock.On("BatchProof", expectedInputProver).Return(&proofID, nil).Once()
Expand Down Expand Up @@ -980,6 +984,7 @@ func TestTryGenerateBatchProof(t *testing.T) {
TimestampBatchEtrog: &t,
}
m.stateMock.On("GetVirtualBatch", mock.Anything, lastVerifiedBatchNum+1, nil).Return(&vb, nil).Twice()
m.stateMock.On("GetLeafsByL1InfoRoot", mock.Anything, *vb.L1InfoRoot, nil).Return([]state.L1InfoTreeExitRootStorageEntry{}, nil).Twice()
expectedInputProver, err := a.buildInputProver(context.Background(), &batchToProve)
require.NoError(err)
m.proverMock.On("BatchProof", expectedInputProver).Return(&proofID, nil).Once()
Expand Down
2 changes: 1 addition & 1 deletion cmd/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ var (
networkFlag = cli.StringFlag{
Name: config.FlagNetwork,
Aliases: []string{"net"},
Usage: "Load default network configuration. Supported values: [`mainnet`, `testnet`, `custom`]",
Usage: "Load default network configuration. Supported values: [`custom`]",
Required: true,
}
customNetworkFlag = cli.StringFlag{
Expand Down
2 changes: 1 addition & 1 deletion cmd/run.go
Original file line number Diff line number Diff line change
Expand Up @@ -349,7 +349,7 @@ func newDataAvailability(c config.Config, st *state.State, etherman *etherman.Cl
c.Etherman.URL,
dacAddr,
pk,
&dataCommitteeClient.Factory{},
dataCommitteeClient.NewFactory(),
)
if err != nil {
return nil, err
Expand Down
2 changes: 1 addition & 1 deletion config/config.go
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ const (
FlagYes = "yes"
// FlagCfg is the flag for cfg.
FlagCfg = "cfg"
// FlagNetwork is the flag for the network name. Valid values: ["testnet", "mainnet", "custom"].
// FlagNetwork is the flag for the network name. Valid values: ["custom"].
FlagNetwork = "network"
// FlagCustomNetwork is the flag for the custom network file. This is required if --network=custom
FlagCustomNetwork = "custom-network-file"
Expand Down
9 changes: 0 additions & 9 deletions config/environments/mainnet/example.env

This file was deleted.

94 changes: 0 additions & 94 deletions config/environments/mainnet/node.config.toml

This file was deleted.

Loading
Loading