Skip to content

Commit

Permalink
Merge pull request #301 from 0xPolygon/jhilliard/agglayer-rate-limit
Browse files Browse the repository at this point in the history
Latest fork 12 changes
  • Loading branch information
praetoriansentry authored Oct 7, 2024
2 parents 4a126c4 + 23ea5d4 commit 4ec09f4
Show file tree
Hide file tree
Showing 10 changed files with 45 additions and 39 deletions.
12 changes: 12 additions & 0 deletions .github/scripts/monitor-verified-batches.sh
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,7 @@ echo
# Calculate the end time based on the current time and the specified timeout.
start_time=$(date +%s)
end_time=$((start_time + timeout))
gas_price_factor=1

# Main loop to monitor batch verification.
while true; do
Expand Down Expand Up @@ -85,13 +86,24 @@ while true; do
exit 1
fi

gas_price=$(cast gas-price --rpc-url "$rpc_url")
gas_price=$(bc -l <<< "$gas_price * $gas_price_factor" | sed 's/\..*//')

echo "Sending a transaction to increase the batch number..."
cast send \
--legacy \
--timeout 30 \
--gas-price "$gas_price" \
--rpc-url "$rpc_url" \
--private-key "0x12d7de8621a77640c9241b2595ba78ce443d05e94090365ab3bb5e19df82c625" \
--gas-limit 100000 \
--create 0x6001617000526160006110005ff05b6109c45a111560245761600061100080833c600e565b50
ret_code=$?
if [[ $ret_code -eq 0 ]]; then
gas_price_factor=1
else
gas_price_factor=$(bc -l <<< "$gas_price_factor * 1.5")
fi

echo "Waiting a few seconds before the next iteration..."
echo
Expand Down
7 changes: 1 addition & 6 deletions .github/tests/combinations.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,24 +5,19 @@ combinations:
- rollup
components:
- legacy-zkevm-stack
# new-zkevm-stack # not implemented yet in kurtosis-cdk
- new-cdk-stack

- fork: 11
da-modes:
- cdk-validium
- rollup
components:
#- legacy-zkevm-stack # zkevm-node doesn't support fork11 yet.
# new-zkevm-stack # not implemented yet in kurtosis-cdk
- new-cdk-stack

- fork: 12
da-modes:
- cdk-validium
- rollup
components:
#- legacy-zkevm-stack # zkevm-node doesn't support fork12 yet.
# new-zkevm-stack # not implemented yet in kurtosis-cdk.
- new-cdk-stack
- new-cdk-stack

2 changes: 1 addition & 1 deletion .github/tests/forks/fork11.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ args:
zkevm_prover_image: hermeznetwork/zkevm-prover:v7.0.2-fork.11

# https://hub.docker.com/r/hermeznetwork/cdk-erigon/tags
cdk_erigon_node_image: hermeznetwork/cdk-erigon:0948e33
cdk_erigon_node_image: hermeznetwork/cdk-erigon:acceptance-2.0.0-beta26-0f01107
# https://hub.docker.com/r/hermeznetwork/zkevm-node/tags?name=fork11
zkevm_node_image: hermeznetwork/zkevm-node:v0.7.0-fork11-RC1

Expand Down
23 changes: 14 additions & 9 deletions agglayer-attach-cdk-params.yml
Original file line number Diff line number Diff line change
Expand Up @@ -56,25 +56,30 @@ args:
# - tx_spammer
additional_services: []

# Docker images and repositories used to spin up services.
# This is a transitional image that includes a fix on top of version v8.0.0-rc.2-fork.12.
# https://github.com/0xPolygonHermez/zkevm-contracts/pull/323
zkevm_contracts_image: leovct/zkevm-contracts:v8.0.0-rc.3-fork.12
#zkevm_contracts_image: leovct/zkevm-contracts:v8.0.0-rc.2-fork.12
# FORK 12 IMAGES
# yq .args .github/tests/forks/fork12.yml
zkevm_contracts_image: leovct/zkevm-contracts:v8.0.0-rc.4-fork.12
zkevm_prover_image: hermeznetwork/zkevm-prover:v8.0.0-RC12-fork.12
cdk_erigon_node_image: hermeznetwork/cdk-erigon:0948e33

# FORK 11 IMAGES
# yq .args .github/tests/forks/fork11.yml
# zkevm_contracts_image: leovct/zkevm-contracts:v7.0.0-rc.2-fork.11
# zkevm_prover_image: hermeznetwork/zkevm-prover:v7.0.2-fork.11
# cdk_erigon_node_image: hermeznetwork/cdk-erigon:acceptance-2.0.0-beta26-0f01107

zkevm_node_image: hermeznetwork/zkevm-node:v0.7.3-RC1
cdk_validium_node_image: 0xpolygon/cdk-validium-node:0.7.0-cdk

cdk_node_image: ghcr.io/0xpolygon/cdk:0.1.2
cdk_node_image: ghcr.io/0xpolygon/cdk:0.2.1
zkevm_da_image: 0xpolygon/cdk-data-availability:0.0.10
# agglayer_image: nulyjkdhthz/agglayer-rs:pr-318
agglayer_image: ghcr.io/agglayer/agglayer-rs:pr-96
zkevm_bridge_service_image: hermeznetwork/zkevm-bridge-service:v0.5.0
zkevm_bridge_service_image: hermeznetwork/zkevm-bridge-service:v0.6.0-RC1
zkevm_bridge_ui_image: leovct/zkevm-bridge-ui:multi-network
zkevm_bridge_proxy_image: haproxy:3.0-bookworm
zkevm_sequence_sender_image: hermeznetwork/zkevm-sequence-sender:v0.2.0-RC12
cdk_erigon_node_image: jerrycgh/cdk-erigon:c69caf5bf62b2ad9c907184ad257ed2aef5c4bfc
zkevm_pool_manager_image: hermeznetwork/zkevm-pool-manager:v0.1.0
zkevm_pool_manager_image: hermeznetwork/zkevm-pool-manager:v0.1.1

# Port configuration.
zkevm_hash_db_port: 50061
Expand Down
1 change: 1 addition & 0 deletions ethereum.star
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ def run(plan, args):
{
"el_type": "geth",
"cl_type": "lighthouse",
"el_extra_params": ["--gcmode archive"],
}
],
"network_params": {
Expand Down
4 changes: 2 additions & 2 deletions input_parser.star
Original file line number Diff line number Diff line change
Expand Up @@ -10,15 +10,15 @@ DEFAULT_ARGS = {
"zkevm_prover_image": "hermeznetwork/zkevm-prover:v8.0.0-RC12-fork.12",
"zkevm_node_image": "hermeznetwork/zkevm-node:v0.7.3-RC1",
"cdk_validium_node_image": "0xpolygon/cdk-validium-node:0.7.0-cdk",
"cdk_node_image": "ghcr.io/0xpolygon/cdk:0.1.2",
"cdk_node_image": "ghcr.io/0xpolygon/cdk:0.2.1",
"zkevm_da_image": "0xpolygon/cdk-data-availability:0.0.10",
"agglayer_image": "ghcr.io/agglayer/agglayer-rs:pr-96",
"zkevm_bridge_service_image": "hermeznetwork/zkevm-bridge-service:v0.6.0-RC1",
"zkevm_bridge_ui_image": "leovct/zkevm-bridge-ui:multi-network",
"zkevm_bridge_proxy_image": "haproxy:3.0-bookworm",
"zkevm_sequence_sender_image": "hermeznetwork/zkevm-sequence-sender:v0.2.0-RC12",
"cdk_erigon_node_image": "hermeznetwork/cdk-erigon:0948e33",
"zkevm_pool_manager_image": "hermeznetwork/zkevm-pool-manager:v0.1.1-RC2",
"zkevm_pool_manager_image": "hermeznetwork/zkevm-pool-manager:v0.1.1",
"zkevm_hash_db_port": 50061,
"zkevm_executor_port": 50071,
"zkevm_aggregator_port": 50081,
Expand Down
7 changes: 4 additions & 3 deletions params.yml
Original file line number Diff line number Diff line change
Expand Up @@ -66,19 +66,20 @@ args:
# yq .args .github/tests/forks/fork11.yml
# zkevm_contracts_image: leovct/zkevm-contracts:v7.0.0-rc.2-fork.11
# zkevm_prover_image: hermeznetwork/zkevm-prover:v7.0.2-fork.11
# cdk_erigon_node_image: hermeznetwork/cdk-erigon:0948e33
# cdk_erigon_node_image: hermeznetwork/cdk-erigon:acceptance-2.0.0-beta26-0f01107

zkevm_node_image: hermeznetwork/zkevm-node:v0.7.3-RC1
cdk_validium_node_image: 0xpolygon/cdk-validium-node:0.7.0-cdk

cdk_node_image: ghcr.io/0xpolygon/cdk:0.1.2
cdk_node_image: ghcr.io/0xpolygon/cdk:0.2.1
zkevm_da_image: 0xpolygon/cdk-data-availability:0.0.10
# agglayer_image: nulyjkdhthz/agglayer-rs:pr-318
agglayer_image: ghcr.io/agglayer/agglayer-rs:pr-96
zkevm_bridge_service_image: hermeznetwork/zkevm-bridge-service:v0.6.0-RC1
zkevm_bridge_ui_image: leovct/zkevm-bridge-ui:multi-network
zkevm_bridge_proxy_image: haproxy:3.0-bookworm
zkevm_sequence_sender_image: hermeznetwork/zkevm-sequence-sender:v0.2.0-RC12
zkevm_pool_manager_image: hermeznetwork/zkevm-pool-manager:v0.1.1-RC2
zkevm_pool_manager_image: hermeznetwork/zkevm-pool-manager:v0.1.1

# Port configuration.
zkevm_hash_db_port: 50061
Expand Down
12 changes: 6 additions & 6 deletions templates/cdk-erigon/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -126,12 +126,12 @@ zkevm.effective-gas-price-contract-deployment: 1
# Specify the maximum gas price allowed for transactions.
# A value of 0 indicates that there is no upper limit on gas prices.
# Default: 0
zkevm.default-gas-price: 0
zkevm.default-gas-price: 10000000

# Apply a factor to convert L1 gas prices into L2 gas prices.
# A value of 1 means no adjustment; values greater than 1 increase L2 costs proportionally.
# Default: 1
zkevm.gas-price-factor: 1
zkevm.gas-price-factor: 0.015

## Synchronization and Execution
# Limits the number of blocks that can be synchronized.
Expand Down Expand Up @@ -290,17 +290,17 @@ zkevm.sequencer-halt-on-batch-number: 0
# Enhances system consistency but may increase processing overhead.
# Recommended for maintaining network synchronization.
# Default: false
zkevm.sequencer-resequence: false
# zkevm.sequencer-resequence: false

# If enabled, ensures that any rolled-back batches are resequenced exactly as they were originally.
# Provides stronger consistency guarantees but may reduce flexibility in certain scenarios.
# Default: true
zkevm.sequencer-resequence-strict: true
# zkevm.sequencer-resequence-strict: true

# When enabled, reuses the Layer 1 information index during the resequencing process.
# Can improve efficiency in resequencing but may not be suitable for all network configurations.
# Default: true
zkevm.sequencer-resequence-reuse-l1-info-index: true
# zkevm.sequencer-resequence-reuse-l1-info-index: true

# If set to true, permits the processing of transactions with no gas price (free transactions).
# Can be beneficial for certain applications but may increase the risk of network spam.
Expand Down Expand Up @@ -460,7 +460,7 @@ zkevm.l1-first-block: {{.zkevm_rollup_manager_block_number}}
# If non-zero, requires a specific L1 block to be finalized before the sequencer continues to sync.
# Enhances security but may introduce delays in processing.
# Default: 0
zkevm.l1-finalized-block-requirement: 0
# zkevm.l1-finalized-block-requirement: 0

# When enabled, verify that contract addresses on L1 match expected values.
# Helps prevent interactions with incorrect or malicious contracts.
Expand Down
14 changes: 3 additions & 11 deletions templates/trusted-node/cdk-node-config.toml
Original file line number Diff line number Diff line change
Expand Up @@ -31,13 +31,9 @@ MaxPendingTx = 1
{{if eq .zkevm_rollup_fork_id "12"}}
MaxBatchesForL1 = 300
BlockFinality="FinalizedBlock"
{{end}}
RPCURL = "http://{{.l2_rpc_name}}{{.deployment_suffix}}:{{.zkevm_rpc_http_port}}"
GetBatchWaitInterval = "10s"
{{end}}
# FIXME - this shouldn't depend on a direct connection to the sequencer, but it seems to be failing if there are disconnects between the DS and RPC
SanityCheckRPCURL = "http://{{.sequencer_name}}{{.deployment_suffix}}:{{.zkevm_rpc_http_port}}"
[SequenceSender.StreamClient]
Server = "{{.sequencer_name}}{{.deployment_suffix}}:{{.zkevm_data_streamer_port}}"
[SequenceSender.EthTxManager]
FrequencyToMonitorTxs = "1s"
WaitTxToBeMined = "2m"
Expand All @@ -56,14 +52,13 @@ SanityCheckRPCURL = "http://{{.sequencer_name}}{{.deployment_suffix}}:{{.zkevm_r
ForcedGas = 0
GasPriceMarginFactor = 1
MaxGasPriceLimit = 0
PersistenceFilename = "/data/ethtxmanager.json"
StoragePath = "/data/ethtxmanager.db"
[SequenceSender.EthTxManager.Etherman]
URL = "{{.l1_rpc_url}}"
L1ChainID = {{.l1_chain_id}}
HTTPHeaders = []

[Aggregator]
FinalProofSanityCheckEnabled = false
Host = "0.0.0.0"
Port = "{{.zkevm_aggregator_port}}"
RetryTime = "30s"
Expand All @@ -87,13 +82,10 @@ SanityCheckRPCURL = "http://{{.sequencer_name}}{{.deployment_suffix}}:{{.zkevm_r
{{else}}
SenderAddress = "{{.zkevm_l2_aggregator_address}}"
{{end}}

{{if eq .zkevm_rollup_fork_id "12"}}
UseL1BatchData = true
UseFullWitness = false
MaxWitnessRetrievalWorkers = 2
SyncModeOnlyEnabled = false
{{end}}

[Aggregator.SequencerPrivateKey]
Path = "/etc/cdk/sequencer.keystore"
Expand Down Expand Up @@ -130,7 +122,7 @@ SanityCheckRPCURL = "http://{{.sequencer_name}}{{.deployment_suffix}}:{{.zkevm_r
ForcedGas = 0
GasPriceMarginFactor = 1
MaxGasPriceLimit = 0
PersistenceFilename = ""
StoragePath = ""
ReadPendingL1Txs = false
SafeStatusL1NumberOfBlocks = 0
FinalizedStatusL1NumberOfBlocks = 0
Expand Down
2 changes: 1 addition & 1 deletion templates/trusted-node/sequence-sender-config.toml
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ MaxPendingTx = 1
ForcedGas = 0
GasPriceMarginFactor = 1
MaxGasPriceLimit = 0
PersistenceFilename = "/app/data/ethtxmanager.json"
StoragePath = "/app/data/ethtxmanager.db"
[SequenceSender.EthTxManager.Etherman]
URL = "{{.l1_rpc_url}}"
MultiGasProvider = false
Expand Down

0 comments on commit 4ec09f4

Please sign in to comment.