Skip to content

Commit

Permalink
docker contracts update (#1903)
Browse files Browse the repository at this point in the history
* genesis + image

* smc v1.0.0-fork.3

* etherman + tests

* update genblocknumber

* linter

* latest prover version

* fix test
  • Loading branch information
ARR552 committed Mar 22, 2023
1 parent d102361 commit f71efab
Show file tree
Hide file tree
Showing 20 changed files with 628 additions and 77 deletions.
28 changes: 14 additions & 14 deletions config/environments/local/local.genesis.config.json

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion config/environments/local/local.node.config.toml
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ DefaultSenderAddress = "0x1111111111111111111111111111111111111111"
[Synchronizer]
SyncInterval = "1s"
SyncChunkSize = 100
GenBlockNumber = 67
GenBlockNumber = 79

[Sequencer]
WaitPeriodPoolIsEmpty = "1s"
Expand Down
2 changes: 1 addition & 1 deletion docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -104,7 +104,7 @@ services:
zkevm-prover:
container_name: zkevm-prover
restart: unless-stopped
image: hermeznetwork/zkevm-prover:5ad1821
image: hermeznetwork/zkevm-prover:221bafe
depends_on:
zkevm-state-db:
condition: service_healthy
Expand Down
84 changes: 60 additions & 24 deletions etherman/etherman.go
Original file line number Diff line number Diff line change
Expand Up @@ -35,21 +35,30 @@ import (
)

var (
updateGlobalExitRootSignatureHash = crypto.Keccak256Hash([]byte("UpdateGlobalExitRoot(bytes32,bytes32)"))
forcedBatchSignatureHash = crypto.Keccak256Hash([]byte("ForceBatch(uint64,bytes32,address,bytes)"))
sequencedBatchesEventSignatureHash = crypto.Keccak256Hash([]byte("SequenceBatches(uint64)"))
forceSequencedBatchesSignatureHash = crypto.Keccak256Hash([]byte("SequenceForceBatches(uint64)"))
verifyBatchesSignatureHash = crypto.Keccak256Hash([]byte("VerifyBatches(uint64,bytes32,address)"))
verifyBatchesTrustedAggregatorSignatureHash = crypto.Keccak256Hash([]byte("VerifyBatchesTrustedAggregator(uint64,bytes32,address)"))
setTrustedSequencerURLSignatureHash = crypto.Keccak256Hash([]byte("SetTrustedSequencerURL(string)"))
setForceBatchAllowedSignatureHash = crypto.Keccak256Hash([]byte("SetForceBatchAllowed(bool)"))
setTrustedSequencerSignatureHash = crypto.Keccak256Hash([]byte("SetTrustedSequencer(address)"))
transferOwnershipSignatureHash = crypto.Keccak256Hash([]byte("OwnershipTransferred(address,address)"))
setSecurityCouncilSignatureHash = crypto.Keccak256Hash([]byte("SetSecurityCouncil(address)"))
proofDifferentStateSignatureHash = crypto.Keccak256Hash([]byte("ProofDifferentState(bytes32,bytes32)"))
emergencyStateActivatedSignatureHash = crypto.Keccak256Hash([]byte("EmergencyStateActivated()"))
emergencyStateDeactivatedSignatureHash = crypto.Keccak256Hash([]byte("EmergencyStateDeactivated()"))
updateZkEVMVersionSignatureHash = crypto.Keccak256Hash([]byte("UpdateZkEVMVersion(uint64,uint64,string)"))
updateGlobalExitRootSignatureHash = crypto.Keccak256Hash([]byte("UpdateGlobalExitRoot(bytes32,bytes32)"))
forcedBatchSignatureHash = crypto.Keccak256Hash([]byte("ForceBatch(uint64,bytes32,address,bytes)"))
sequencedBatchesEventSignatureHash = crypto.Keccak256Hash([]byte("SequenceBatches(uint64)"))
forceSequencedBatchesSignatureHash = crypto.Keccak256Hash([]byte("SequenceForceBatches(uint64)"))
verifyBatchesSignatureHash = crypto.Keccak256Hash([]byte("VerifyBatches(uint64,bytes32,address)"))
verifyBatchesTrustedAggregatorSignatureHash = crypto.Keccak256Hash([]byte("VerifyBatchesTrustedAggregator(uint64,bytes32,address)"))
setTrustedSequencerURLSignatureHash = crypto.Keccak256Hash([]byte("SetTrustedSequencerURL(string)"))
setTrustedSequencerSignatureHash = crypto.Keccak256Hash([]byte("SetTrustedSequencer(address)"))
transferOwnershipSignatureHash = crypto.Keccak256Hash([]byte("OwnershipTransferred(address,address)"))
emergencyStateActivatedSignatureHash = crypto.Keccak256Hash([]byte("EmergencyStateActivated()"))
emergencyStateDeactivatedSignatureHash = crypto.Keccak256Hash([]byte("EmergencyStateDeactivated()"))
updateZkEVMVersionSignatureHash = crypto.Keccak256Hash([]byte("UpdateZkEVMVersion(uint64,uint64,string)"))
consolidatePendingStateSignatureHash = crypto.Keccak256Hash([]byte("ConsolidatePendingState(uint64,bytes32,uint64)"))
setTrustedAggregatorTimeoutSignatureHash = crypto.Keccak256Hash([]byte("SetTrustedAggregatorTimeout(uint64)"))
setTrustedAggregatorSignatureHash = crypto.Keccak256Hash([]byte("SetTrustedAggregator(address)"))
setPendingStateTimeoutSignatureHash = crypto.Keccak256Hash([]byte("SetPendingStateTimeout(uint64)"))
setMultiplierBatchFeeSignatureHash = crypto.Keccak256Hash([]byte("SetMultiplierBatchFee(uint16)"))
setVerifyBatchTimeTargetSignatureHash = crypto.Keccak256Hash([]byte("SetVerifyBatchTimeTarget(uint64)"))
setForceBatchTimeoutSignatureHash = crypto.Keccak256Hash([]byte("SetForceBatchTimeout(uint64)"))
activateForceBatchesSignatureHash = crypto.Keccak256Hash([]byte("ActivateForceBatches()"))
transferAdminRoleSignatureHash = crypto.Keccak256Hash([]byte("TransferAdminRole(address)"))
acceptAdminRoleSignatureHash = crypto.Keccak256Hash([]byte("AcceptAdminRole(address)"))
proveNonDeterministicPendingStateSignatureHash = crypto.Keccak256Hash([]byte("ProveNonDeterministicPendingState(bytes32,bytes32)"))
overridePendingStateSignatureHash = crypto.Keccak256Hash([]byte("OverridePendingState(uint64,bytes32,address)"))

// Proxy events
initializedSignatureHash = crypto.Keccak256Hash([]byte("Initialized(uint8)"))
Expand Down Expand Up @@ -301,9 +310,6 @@ func (etherMan *Client) processEvent(ctx context.Context, vLog types.Log, blocks
case setTrustedSequencerURLSignatureHash:
log.Debug("SetTrustedSequencerURL event detected")
return nil
case setForceBatchAllowedSignatureHash:
log.Debug("SetForceBatchAllowed event detected")
return nil
case setTrustedSequencerSignatureHash:
log.Debug("SetTrustedSequencer event detected")
return nil
Expand All @@ -322,12 +328,6 @@ func (etherMan *Client) processEvent(ctx context.Context, vLog types.Log, blocks
case transferOwnershipSignatureHash:
log.Debug("TransferOwnership event detected")
return nil
case setSecurityCouncilSignatureHash:
log.Debug("SetSecurityCouncil event detected")
return nil
case proofDifferentStateSignatureHash:
log.Debug("ProofDifferentState event detected")
return nil
case emergencyStateActivatedSignatureHash:
log.Debug("EmergencyStateActivated event detected")
return nil
Expand All @@ -336,6 +336,42 @@ func (etherMan *Client) processEvent(ctx context.Context, vLog types.Log, blocks
return nil
case updateZkEVMVersionSignatureHash:
return etherMan.updateZkevmVersion(ctx, vLog, blocks, blocksOrder)
case consolidatePendingStateSignatureHash:
log.Debug("ConsolidatePendingState event detected")
return nil
case setTrustedAggregatorTimeoutSignatureHash:
log.Debug("SetTrustedAggregatorTimeout event detected")
return nil
case setTrustedAggregatorSignatureHash:
log.Debug("setTrustedAggregator event detected")
return nil
case setPendingStateTimeoutSignatureHash:
log.Debug("SetPendingStateTimeout event detected")
return nil
case setMultiplierBatchFeeSignatureHash:
log.Debug("SetMultiplierBatchFee event detected")
return nil
case setVerifyBatchTimeTargetSignatureHash:
log.Debug("SetVerifyBatchTimeTarget event detected")
return nil
case setForceBatchTimeoutSignatureHash:
log.Debug("SetForceBatchTimeout event detected")
return nil
case activateForceBatchesSignatureHash:
log.Debug("ActivateForceBatches event detected")
return nil
case transferAdminRoleSignatureHash:
log.Debug("TransferAdminRole event detected")
return nil
case acceptAdminRoleSignatureHash:
log.Debug("AcceptAdminRole event detected")
return nil
case proveNonDeterministicPendingStateSignatureHash:
log.Debug("ProveNonDeterministicPendingState event detected")
return nil
case overridePendingStateSignatureHash:
log.Debug("OverridePendingState event detected")
return nil
}
log.Warn("Event not registered: ", vLog)
return nil
Expand Down
4 changes: 4 additions & 0 deletions etherman/simulated.go
Original file line number Diff line number Diff line change
Expand Up @@ -103,6 +103,10 @@ func NewSimulatedEtherman(cfg Config, auth *bind.TransactOpts) (etherman *Client
if err != nil {
return nil, nil, common.Address{}, nil, err
}
_, err = poe.ActivateForceBatches(auth)
if err != nil {
return nil, nil, common.Address{}, nil, err
}

client.Commit()
c := &Client{
Expand Down
104 changes: 104 additions & 0 deletions etherman/smartcontracts/abi/polygonzkevm.abi
Original file line number Diff line number Diff line change
Expand Up @@ -65,11 +65,21 @@
"name": "FinalPendingStateNumInvalid",
"type": "error"
},
{
"inputs": [],
"name": "ForceBatchNotAllowed",
"type": "error"
},
{
"inputs": [],
"name": "ForceBatchTimeoutNotExpired",
"type": "error"
},
{
"inputs": [],
"name": "ForceBatchesAlreadyActive",
"type": "error"
},
{
"inputs": [],
"name": "ForceBatchesOverflow",
Expand Down Expand Up @@ -110,6 +120,11 @@
"name": "InvalidRangeBatchTimeTarget",
"type": "error"
},
{
"inputs": [],
"name": "InvalidRangeForceBatchTimeout",
"type": "error"
},
{
"inputs": [],
"name": "InvalidRangeMultiplierBatchFee",
Expand All @@ -125,6 +140,11 @@
"name": "NewPendingStateTimeoutMustBeLower",
"type": "error"
},
{
"inputs": [],
"name": "NewStateRootNotInsidePrime",
"type": "error"
},
{
"inputs": [],
"name": "NewTrustedAggregatorTimeoutMustBeLower",
Expand Down Expand Up @@ -243,6 +263,12 @@
"name": "AcceptAdminRole",
"type": "event"
},
{
"anonymous": false,
"inputs": [],
"name": "ActivateForceBatches",
"type": "event"
},
{
"anonymous": false,
"inputs": [
Expand Down Expand Up @@ -413,6 +439,19 @@
"name": "SequenceForceBatches",
"type": "event"
},
{
"anonymous": false,
"inputs": [
{
"indexed": false,
"internalType": "uint64",
"name": "newforceBatchTimeout",
"type": "uint64"
}
],
"name": "SetForceBatchTimeout",
"type": "event"
},
{
"anonymous": false,
"inputs": [
Expand Down Expand Up @@ -612,6 +651,13 @@
"stateMutability": "nonpayable",
"type": "function"
},
{
"inputs": [],
"name": "activateForceBatches",
"outputs": [],
"stateMutability": "nonpayable",
"type": "function"
},
{
"inputs": [],
"name": "admin",
Expand Down Expand Up @@ -696,6 +742,25 @@
"stateMutability": "view",
"type": "function"
},
{
"inputs": [
{
"internalType": "uint256",
"name": "newStateRoot",
"type": "uint256"
}
],
"name": "checkStateRootInsidePrime",
"outputs": [
{
"internalType": "bool",
"name": "",
"type": "bool"
}
],
"stateMutability": "pure",
"type": "function"
},
{
"inputs": [
{
Expand Down Expand Up @@ -734,6 +799,19 @@
"stateMutability": "nonpayable",
"type": "function"
},
{
"inputs": [],
"name": "forceBatchTimeout",
"outputs": [
{
"internalType": "uint64",
"name": "",
"type": "uint64"
}
],
"stateMutability": "view",
"type": "function"
},
{
"inputs": [
{
Expand Down Expand Up @@ -917,6 +995,19 @@
"stateMutability": "view",
"type": "function"
},
{
"inputs": [],
"name": "isForcedBatchDisallowed",
"outputs": [
{
"internalType": "bool",
"name": "",
"type": "bool"
}
],
"stateMutability": "view",
"type": "function"
},
{
"inputs": [
{
Expand Down Expand Up @@ -1344,6 +1435,19 @@
"stateMutability": "view",
"type": "function"
},
{
"inputs": [
{
"internalType": "uint64",
"name": "newforceBatchTimeout",
"type": "uint64"
}
],
"name": "setForceBatchTimeout",
"outputs": [],
"stateMutability": "nonpayable",
"type": "function"
},
{
"inputs": [
{
Expand Down
2 changes: 1 addition & 1 deletion etherman/smartcontracts/bin/polygonzkevm.bin

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion etherman/smartcontracts/bin/polygonzkevmbridge.bin

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion etherman/smartcontracts/bin/polygonzkevmglobalexitroot.bin
Original file line number Diff line number Diff line change
@@ -1 +1 @@
60c060405234801561001057600080fd5b506040516103f83803806103f883398101604081905261002f91610062565b6001600160a01b0391821660a05216608052610095565b80516001600160a01b038116811461005d57600080fd5b919050565b6000806040838503121561007557600080fd5b61007e83610046565b915061008c60208401610046565b90509250929050565b60805160a0516103316100c76000396000818160e901526101bd015260008181610135015261017401526103316000f3fe608060405234801561001057600080fd5b506004361061007d5760003560e01c806333d6247d1161005b57806333d6247d146100c75780633ed691ef146100dc5780635ec6a8df146100e4578063a3c573eb1461013057600080fd5b806301fd904414610082578063257b36321461009e578063319cf735146100be575b600080fd5b61008b60005481565b6040519081526020015b60405180910390f35b61008b6100ac3660046102e2565b60026020526000908152604090205481565b61008b60015481565b6100da6100d53660046102e2565b610157565b005b61008b6102a6565b61010b7f000000000000000000000000000000000000000000000000000000000000000081565b60405173ffffffffffffffffffffffffffffffffffffffff9091168152602001610095565b61010b7f000000000000000000000000000000000000000000000000000000000000000081565b60005460015473ffffffffffffffffffffffffffffffffffffffff7f00000000000000000000000000000000000000000000000000000000000000001633036101a65750600182905581610222565b73ffffffffffffffffffffffffffffffffffffffff7f00000000000000000000000000000000000000000000000000000000000000001633036101f0576000839055829150610222565b6040517fb49365dd00000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b60408051602080820184905281830185905282518083038401815260609092019092528051910120600090600081815260026020526040812054919250036102a05760008181526002602052604080822042905551849184917f61014378f82a0d809aefaf87a8ac9505b89c321808287a6e7810f29304c1fce39190a35b50505050565b60006102dd600154600054604080516020808201949094528082019290925280518083038201815260609092019052805191012090565b905090565b6000602082840312156102f457600080fd5b503591905056fea2646970667358221220e7dee8a420da2e0e8a9c8794bd77473a90d0da4f68ae0f3c0ca6c0994fea144d64736f6c63430008110033
60c060405234801561001057600080fd5b506040516103f83803806103f883398101604081905261002f91610062565b6001600160a01b0391821660a05216608052610095565b80516001600160a01b038116811461005d57600080fd5b919050565b6000806040838503121561007557600080fd5b61007e83610046565b915061008c60208401610046565b90509250929050565b60805160a0516103316100c76000396000818160e901526101bd015260008181610135015261017401526103316000f3fe608060405234801561001057600080fd5b506004361061007d5760003560e01c806333d6247d1161005b57806333d6247d146100c75780633ed691ef146100dc5780635ec6a8df146100e4578063a3c573eb1461013057600080fd5b806301fd904414610082578063257b36321461009e578063319cf735146100be575b600080fd5b61008b60005481565b6040519081526020015b60405180910390f35b61008b6100ac3660046102e2565b60026020526000908152604090205481565b61008b60015481565b6100da6100d53660046102e2565b610157565b005b61008b6102a6565b61010b7f000000000000000000000000000000000000000000000000000000000000000081565b60405173ffffffffffffffffffffffffffffffffffffffff9091168152602001610095565b61010b7f000000000000000000000000000000000000000000000000000000000000000081565b60005460015473ffffffffffffffffffffffffffffffffffffffff7f00000000000000000000000000000000000000000000000000000000000000001633036101a65750600182905581610222565b73ffffffffffffffffffffffffffffffffffffffff7f00000000000000000000000000000000000000000000000000000000000000001633036101f0576000839055829150610222565b6040517fb49365dd00000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b60408051602080820184905281830185905282518083038401815260609092019092528051910120600090600081815260026020526040812054919250036102a05760008181526002602052604080822042905551849184917f61014378f82a0d809aefaf87a8ac9505b89c321808287a6e7810f29304c1fce39190a35b50505050565b60006102dd600154600054604080516020808201949094528082019290925280518083038201815260609092019052805191012090565b905090565b6000602082840312156102f457600080fd5b503591905056fea26469706673582212209f4342d0e9635341e8c77469d3bc7ae71f0dddc6e79aebfb62c8bb1ad4fe68d664736f6c63430008110033
5 changes: 3 additions & 2 deletions etherman/smartcontracts/matic/matic.go

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

5 changes: 3 additions & 2 deletions etherman/smartcontracts/mockverifier/mockverifier.go

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

411 changes: 407 additions & 4 deletions etherman/smartcontracts/polygonzkevm/polygonzkevm.go

Large diffs are not rendered by default.

Loading

0 comments on commit f71efab

Please sign in to comment.