Skip to content

Commit

Permalink
merge base
Browse files Browse the repository at this point in the history
  • Loading branch information
temaniarpit27 committed Feb 19, 2025
2 parents adccc25 + ee07ffc commit e01b00e
Show file tree
Hide file tree
Showing 15 changed files with 26,017 additions and 78 deletions.
136 changes: 136 additions & 0 deletions agglayer.log

Large diffs are not rendered by default.

4 changes: 2 additions & 2 deletions aggsender/aggsender.go
Original file line number Diff line number Diff line change
Expand Up @@ -302,7 +302,7 @@ func (a *AggSender) sendCertificate(ctx context.Context) (*agglayer.SignedCertif
}

a.saveCertificateToFile(signedCertificate)
a.log.Infof("certificate ready to be send to AggLayer: %s", signedCertificate.Brief())
a.log.Infof("certificate ready to be sent to AggLayer: %s", signedCertificate.Brief())
if a.cfg.DryRun {
a.log.Warn("dry run mode enabled, skipping sending certificate")
return signedCertificate, nil
Expand All @@ -312,7 +312,7 @@ func (a *AggSender) sendCertificate(ctx context.Context) (*agglayer.SignedCertif
return nil, fmt.Errorf("error sending certificate: %w", err)
}

a.log.Debugf("certificate send: Height: %d cert: %s", signedCertificate.Height, signedCertificate.Brief())
a.log.Debugf("certificate sent: Height: %d cert: %s", signedCertificate.Height, signedCertificate.Brief())

raw, err := json.Marshal(signedCertificate)
if err != nil {
Expand Down
2 changes: 1 addition & 1 deletion aggsender/aggsender_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@ func TestConfigString(t *testing.T) {
"DryRun: false\n" +
"EnableRPC: false\n" +
"CheckStatusCertificateInterval: 0s\n" +
"RetryCertInmediatlyAfterInError: false\n" +
"RetryCertImmediatelyAfterInError: false\n" +
"MaxSubmitRate: RateLimitConfig{Unlimited}\n" +
"MaxEpochPercentageAllowedToSendCertificate: 0\n"

Expand Down
2 changes: 1 addition & 1 deletion aggsender/config.go
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,7 @@ func (c Config) String() string {
"DryRun: " + fmt.Sprintf("%t", c.DryRun) + "\n" +
"EnableRPC: " + fmt.Sprintf("%t", c.EnableRPC) + "\n" +
"CheckStatusCertificateInterval: " + c.CheckStatusCertificateInterval.String() + "\n" +
"RetryCertInmediatlyAfterInError: " + fmt.Sprintf("%t", c.RetryCertAfterInError) + "\n" +
"RetryCertImmediatelyAfterInError: " + fmt.Sprintf("%t", c.RetryCertAfterInError) + "\n" +
"MaxSubmitRate: " + c.MaxSubmitCertificateRate.String() + "\n" +
"MaxEpochPercentageAllowedToSendCertificate: " +
fmt.Sprintf("%d", c.MaxEpochPercentageAllowedToSendCertificate) + "\n"
Expand Down
8 changes: 7 additions & 1 deletion bridgesync/e2e_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -51,11 +51,17 @@ func TestBridgeEventE2E(t *testing.T) {
)
require.NoError(t, err)
helpers.CommitBlocks(t, setup.L1Environment.SimBackend, 1, blockTime)
bn, err := setup.L1Environment.SimBackend.Client().BlockNumber(ctx)
simulatedClient := setup.L1Environment.SimBackend.Client()
bn, err := simulatedClient.BlockNumber(ctx)
require.NoError(t, err)
bridge.BlockNum = bn
receipt, err := setup.L1Environment.SimBackend.Client().TransactionReceipt(ctx, tx.Hash())
require.NoError(t, err)
bridge.TxHash = receipt.TxHash
block, err := simulatedClient.BlockByNumber(ctx, new(big.Int).SetUint64(bn))
require.NoError(t, err)
bridge.BlockTimestamp = block.Time()
require.NoError(t, err)
require.Equal(t, receipt.Status, types.ReceiptStatusSuccessful)
expectedBridges = append(expectedBridges, bridge)
expectedRoot, err := setup.L1Environment.BridgeContract.GetRoot(nil)
Expand Down
4 changes: 2 additions & 2 deletions config/default.go
Original file line number Diff line number Diff line change
Expand Up @@ -136,7 +136,7 @@ WriteTimeout = "2s"
MaxRequestsPerIPAndSecond = 10
[ClaimSponsor]
DBPath = "{{PathRWData}}/claimsopnsor.sqlite"
DBPath = "{{PathRWData}}/claimsponsor.sqlite"
Enabled = false
SenderAddr = "0xfa3b44587990f97ba8b6ba7e230a5f0e95d14b3d"
BridgeAddrL2 = "0xB7098a13a48EcE087d3DA15b2D28eCE0f89819B8"
Expand All @@ -152,7 +152,7 @@ GasOffset = 0
GetReceiptMaxTime = "250ms"
GetReceiptWaitInterval = "1s"
PrivateKeys = [
{Path = "/app/keystore/claimsopnsor.keystore", Password = "testonly"},
{Path = "/app/keystore/claimsponsor.keystore", Password = "testonly"},
]
ForcedGas = 0
GasPriceMarginFactor = 1
Expand Down
25,846 changes: 25,846 additions & 0 deletions node.log

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion test/bats/helpers/lxly-bridge.bash
Original file line number Diff line number Diff line change
Expand Up @@ -194,7 +194,7 @@ function claim_tx_hash() {
readonly current_deposit=$(mktemp)
jq '.[(0|tonumber)]' $bridge_deposit_file | tee $current_deposit
readonly current_proof=$(mktemp)
echo ".... requesting merkel proof for $tx_hash deposit_cnt=$curr_deposit_cnt network_id: $curr_network_id" >&3
echo ".... requesting merkle proof for $tx_hash deposit_cnt=$curr_deposit_cnt network_id: $curr_network_id" >&3
request_merkle_proof "$curr_deposit_cnt" "$curr_network_id" "$bridge_merkle_proof_url" "$current_proof"
echo "FILE current_deposit=$current_deposit"
echo "FILE bridge_deposit_file=$bridge_deposit_file"
Expand Down
6 changes: 3 additions & 3 deletions test/bats/pp/bridge-e2e-msg.bats
Original file line number Diff line number Diff line change
Expand Up @@ -44,18 +44,18 @@ setup() {
readonly l1_rpc_network_id=$(cast call --rpc-url $l1_rpc_url $bridge_addr 'networkID() (uint32)')
readonly l2_rpc_network_id=$(cast call --rpc-url $l2_rpc_url $bridge_addr 'networkID() (uint32)')
gas_price=$(cast gas-price --rpc-url "$l2_rpc_url")
readonly weth_token_addr=$(cast call --rpc-url $l2_rpc_url $bridge_addr 'WETHToken()' | cast parse-bytes32-address)
readonly weth_token_addr=$(cast call --rpc-url $l2_rpc_url $bridge_addr 'WETHToken() (address)')
}


@test "transfer message" {
@test "Transfer message" {
echo "====== bridgeMessage L1 -> L2" >&3
destination_addr=$sender_addr
destination_net=$l2_rpc_network_id
run bridge_message "$native_token_addr" "$l1_rpc_url"
assert_success

echo "====== Claim in L2" >&3
echo "====== claimMessage (L2)" >&3
timeout="120"
claim_frequency="10"
run wait_for_claim "$timeout" "$claim_frequency" "$l2_rpc_url" "bridgeMessage"
Expand Down
2 changes: 1 addition & 1 deletion test/bats/pp/bridge-e2e.bats
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ setup() {

@test "Native gas token deposit to WETH" {
destination_addr=$sender_addr
run cast call --rpc-url $l2_rpc_url $bridge_addr 'WETHToken()(address)'
run cast call --rpc-url $l2_rpc_url $bridge_addr 'WETHToken() (address)'
assert_success
readonly weth_token_addr=$output

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,13 +27,13 @@ args:


cdk_node_image: aggkit:latest
cdk_erigon_node_image: hermeznetwork/cdk-erigon:v2.61.2
zkevm_contracts_image: leovct/zkevm-contracts:v9.0.0-rc.3-pp-fork.12-patch.1
cdk_erigon_node_image: hermeznetwork/cdk-erigon:v2.61.9-RC1
zkevm_contracts_image: leovct/zkevm-contracts:v9.0.0-rc.5-pp-fork.12
additional_services: []
consensus_contract_type: pessimistic
sequencer_type: erigon
erigon_strict_mode: false
gas_token_enabled: false
zkevm_use_real_verifier: true
zkevm_use_real_verifier: false
enable_normalcy: true
verifier_program_vkey: 0x00766aa16a6efe4ac05c0fe21d4b50f9631dbd1a2663a982da861427085ea2ea
8 changes: 4 additions & 4 deletions test/combinations/fork12-pessimistic-multi.yml
Original file line number Diff line number Diff line change
@@ -1,14 +1,14 @@
args:
cdk_node_image: aggkit:latest
agglayer_image: ghcr.io/agglayer/agglayer:0.2.0-rc.20
cdk_erigon_node_image: hermeznetwork/cdk-erigon:v2.61.2
zkevm_contracts_image: leovct/zkevm-contracts:v9.0.0-rc.3-pp-fork.12-patch.1
agglayer_image: ghcr.io/agglayer/agglayer:main
cdk_erigon_node_image: hermeznetwork/cdk-erigon:v2.61.9-RC1
zkevm_contracts_image: leovct/zkevm-contracts:v9.0.0-rc.5-pp-fork.12
additional_services: []
consensus_contract_type: pessimistic
sequencer_type: erigon
erigon_strict_mode: false
gas_token_enabled: false
zkevm_use_real_verifier: true
zkevm_use_real_verifier: false
enable_normalcy: true
verifier_program_vkey: 0x00766aa16a6efe4ac05c0fe21d4b50f9631dbd1a2663a982da861427085ea2ea
agglayer_prover_sp1_key: {{.AGGLAYER_PROVER_SP1_KEY}}
9 changes: 3 additions & 6 deletions test/combinations/fork12-pessimistic.yml
Original file line number Diff line number Diff line change
@@ -1,11 +1,8 @@
args:
agglayer_image: ghcr.io/agglayer/agglayer:0.2.0-rc.20
cdk_erigon_node_image: hermeznetwork/cdk-erigon:v2.61.2
cdk_node_image: aggkit:latest
zkevm_bridge_proxy_image: haproxy:3.0-bookworm
zkevm_bridge_service_image: hermeznetwork/zkevm-bridge-service:v0.6.0-RC1
zkevm_bridge_ui_image: leovct/zkevm-bridge-ui:multi-network
zkevm_contracts_image: leovct/zkevm-contracts:v9.0.0-rc.3-pp-fork.12-patch.1
agglayer_image: ghcr.io/agglayer/agglayer:main
cdk_erigon_node_image: hermeznetwork/cdk-erigon:v2.61.9-RC1
zkevm_contracts_image: leovct/zkevm-contracts:v9.0.0-rc.5-pp-fork.12
additional_services: []
consensus_contract_type: pessimistic
sequencer_type: erigon
Expand Down
13 changes: 7 additions & 6 deletions test/scripts/agglayer_certificates_monitor.sh
Original file line number Diff line number Diff line change
Expand Up @@ -9,13 +9,16 @@ function parse_params() {
fi

# The number of batches to be verified.
settle_certificates_target="$1"
readonly settle_certificates_target="$1"

# The script timeout (in seconds).
timeout="$2"
readonly timeout="$2"

# The network id of the L2 network.
l2_rpc_network_id="$3"
readonly l2_rpc_network_id="$3"

# The agglayer rpc url.
readonly agglayer_rpc_url="$(kurtosis port print aggkit agglayer agglayer)"
}

function check_timeout() {
Expand All @@ -28,8 +31,6 @@ function check_timeout() {
}

function check_num_certificates() {
readonly agglayer_rpc_url="$(kurtosis port print aggkit agglayer agglayer)"

cast_output=$(cast rpc --rpc-url "$agglayer_rpc_url" "interop_getLatestKnownCertificateHeader" "$l2_rpc_network_id" 2>&1)

if [ $? -ne 0 ]; then
Expand Down Expand Up @@ -81,7 +82,7 @@ function extract_certificate_status() {
parse_params $*
start_time=$(date +%s)
end_time=$((start_time + timeout))
echo "[$(date '+%Y-%m-%d %H:%M:%S')] Start monitoring agglayer certificates progress..."
echo "[$(date '+%Y-%m-%d %H:%M:%S')] Start monitoring agglayer certificates (agglayer rpc url $agglayer_rpc_url, network id $l2_rpc_network_id)..." >&3
while true; do
check_num_certificates
check_timeout $end_time
Expand Down
47 changes: 0 additions & 47 deletions test/scripts/batch_verification_monitor.sh

This file was deleted.

0 comments on commit e01b00e

Please sign in to comment.