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: improve sanity check script #293

Draft
wants to merge 21 commits into
base: main
Choose a base branch
from

Conversation

leovct
Copy link
Member

@leovct leovct commented Oct 1, 2024

Description

  • Compare batch info between L2 RPC and L2 sequencer
  • Compare batch info between L2 RPC and L1 contract
  • Compare batch info between L2 RPC and L2 datastreamer
  • Log batch verification gap
  • Log the type of rollup (validium or rollup)
  • Log data comittee members
  • Format logs

Test

$ ./scripts/sanity-check.sh
Running sanity check script with config:
- L1 RPC URL:			https://rpc2.sepolia.org
- L2 Sequencer URL:		https://rpc.cardona.zkevm-rpc.com
- L2 Datastreamer URL:		datastream.cardona.zkevm-rpc.com:6900
- L2 RPC URL:			https://etherscan.cardona.zkevm-rpc.com
- Rollup Manager Address:	0x32d33D5137a7cFFb54c5Bf8371172bcEc5f310ff
- Rollup ID:			1
- Datastreamer config:
{
  "Online": {
    "URI": "datastream.cardona.zkevm-rpc.com:6900",
    "StreamType": 1
  },
  "Log": {
    "Environment": "development",
    "Level": "error",
    "Outputs": [
      "stdout"
    ]
  }
}

####################################################################################################
#   ____   ___  _     _    _   _ ____    ____    _  _____  _
#  |  _ \ / _ \| |   | |  | | | |  _ \  |  _ \  / \|_   _|/ \
#  | |_) | | | | |   | |  | | | | |_) | | | | |/ _ \ | | / _ \
#  |  _ <| |_| | |___| |__| |_| |  __/  | |_| / ___ \| |/ ___ \
#  |_| \_\\___/|_____|_____\___/|_|     |____/_/   \_\_/_/   \_\
#
####################################################################################################

Fetching rollup data...
{
  "rollupContract": "0xA13Ddb14437A8F34897131367ad3ca78416d6bCa",
  "chainId": "2442",
  "verifierAddress": "0x74c21D41d39B2bfF371e584Ef5c1Ac25e02fBfe3",
  "forkId": "11",
  "lastLocalExitRoot": "0xa9bc7a6f80839a5b0df03d6c13abfeb251838ee4a25af439251ddc6d74f39650",
  "lastSequencedBatch": "128011",
  "lastVerifiedBatch": "128011",
  "lastPendingState": "0",
  "lastPendingStateConsolidated": "0",
  "lastVerifiedBatchBeforeUpgrade": "125247",
  "rollupTypeId": "6",
  "rollupCompatibilityId": "0"
}

Fetching rollup type data...
{
  "consensusImplementation": "0x21cB76952f70E289Db812B00bEBFBD6F3b465267",
  "verifier": "0x74c21D41d39B2bfF371e584Ef5c1Ac25e02fBfe3",
  "forkID": "11",
  "rollupCompatibilityID": "0",
  "obsolete": "false",
  "genesis": "0xc012c41e4583a2e3b776aff34aea0b4fd235d098484a455956554dbf69b8235e"
}

Consensus type: rollup

####################################################################################################
#   _____ ____  _   _ ____ _____ _____ ____    ____    _  _____ ____ _   _
#  |_   _|  _ \| | | / ___|_   _| ____|  _ \  | __ )  / \|_   _/ ___| | | |
#    | | | |_) | | | \___ \ | | |  _| | | | | |  _ \ / _ \ | || |   | |_| |
#    | | |  _ <| |_| |___) || | | |___| |_| | | |_) / ___ \| || |___|  _  |
#    |_| |_| \_\\___/|____/ |_| |_____|____/  |____/_/   \_\_| \____|_| |_|
#
####################################################################################################

Fetching last batch numbers L2 sequencer and L2 RPC...
- SEQUENCER: 128013
- RPC: 128013

✅ Batch numbers match.

Fetching data from L2 sequencer...
Batch: 128013
{
  "accInputHash": "0x2080382cb02a664d2e0e4370beb8cdcb42092d831e199c6cda252ec873eb8aea",
  "blocks": 430,
  "closed": false,
  "coinbase": "0x761d53b47334bee6612c0bd1467fb881435375b2",
  "globalExitRoot": "0xa3aa34779a2174bfb94bcf15230bdf8abd36ad8bbfe2fecc2b68a51dd49e0030",
  "localExitRoot": "0xa9bc7a6f80839a5b0df03d6c13abfeb251838ee4a25af439251ddc6d74f39650",
  "mainnetExitRoot": "0x049bec321b0275898738dfed535f8e546f816e4728c4aad9486badcb90af0cbb",
  "number": "0x1f40d",
  "rollupExitRoot": "0xbb1f9f693b173420023ba450455e397c54b762ea7a3dc223502329639881d64d",
  "sendSequencesTxHash": null,
  "stateRoot": "0x78c1317e75725e9ecf26c9d284afd6215f9e30acdab35eba4a88ff8afd5cc183",
  "timestamp": "0x66feab26",
  "transactions": 35,
  "verifyBatchTxHash": null
}

Fetching data from L2 RPC...
Batch: 128013
{
  "accInputHash": "0x96055768d44a1d1dda51ddeec7f49854a11a0b5f7fcdeb8dfb067d652536c81b",
  "blocks": 430,
  "closed": false,
  "coinbase": "0x761d53b47334bee6612c0bd1467fb881435375b2",
  "globalExitRoot": "0xa3aa34779a2174bfb94bcf15230bdf8abd36ad8bbfe2fecc2b68a51dd49e0030",
  "localExitRoot": "0xa9bc7a6f80839a5b0df03d6c13abfeb251838ee4a25af439251ddc6d74f39650",
  "mainnetExitRoot": "0x049bec321b0275898738dfed535f8e546f816e4728c4aad9486badcb90af0cbb",
  "number": "0x1f40d",
  "rollupExitRoot": "0xbb1f9f693b173420023ba450455e397c54b762ea7a3dc223502329639881d64d",
  "sendSequencesTxHash": null,
  "stateRoot": "0x78c1317e75725e9ecf26c9d284afd6215f9e30acdab35eba4a88ff8afd5cc183",
  "timestamp": "0x66feab26",
  "transactions": 35,
  "verifyBatchTxHash": null
}

Comparing L2 sequencer and L2 RPC...
❌ accInputHash mismatch:
- l2_sequencer:	0x2080382cb02a664d2e0e4370beb8cdcb42092d831e199c6cda252ec873eb8aea
- l2_rpc:	0x96055768d44a1d1dda51ddeec7f49854a11a0b5f7fcdeb8dfb067d652536c81b

❌ The JSON objects are not the same.

####################################################################################################
#  __     _____ ____ _____ _   _   _    _     ___ __________ ____    ____    _  _____ ____ _   _
#  \ \   / /_ _|  _ \_   _| | | | / \  | |   |_ _|__  / ____|  _ \  | __ )  / \|_   _/ ___| | | |
#   \ \ / / | || |_) || | | | | |/ _ \ | |    | |  / /|  _| | | | | |  _ \ / _ \ | || |   | |_| |
#    \ V /  | ||  _ < | | | |_| / ___ \| |___ | | / /_| |___| |_| | | |_) / ___ \| || |___|  _  |
#     \_/  |___|_| \_\|_|  \___/_/   \_\_____|___/____|_____|____/  |____/_/   \_\_| \____|_| |_|
#
####################################################################################################

Batch: 128011

Fetching data from L2 RPC...
{
  "accInputHash": "0x96055768d44a1d1dda51ddeec7f49854a11a0b5f7fcdeb8dfb067d652536c81b",
  "blocks": 575,
  "closed": true,
  "coinbase": "0x761d53b47334bee6612c0bd1467fb881435375b2",
  "globalExitRoot": "0xd9aaa6aac27b2ce25fd11ac55f633bd6eaa91188ec709247378876f1200a180d",
  "localExitRoot": "0xa9bc7a6f80839a5b0df03d6c13abfeb251838ee4a25af439251ddc6d74f39650",
  "mainnetExitRoot": "0x8c4ca23c3483fd2069223234604e9b6e4312175a52a4e13f8567cb913267e380",
  "number": "0x1f40b",
  "rollupExitRoot": "0xbb1f9f693b173420023ba450455e397c54b762ea7a3dc223502329639881d64d",
  "sendSequencesTxHash": "0x438878d2e3eb03046db3e8a58f08f066378f0e8a6a17be7c89308ce8348bed40",
  "stateRoot": "0xcea8739d7e4b6c4da4f1bec4296a98958cd7cd893f6d1c9ee76e80c8e233ab1b",
  "timestamp": "0x66fe9ed3",
  "transactions": 47,
  "verifyBatchTxHash": null
}

Fetching data from L2 sequencer...
{
  "accInputHash": "0xb23daf7bed1b2950fc00de3d029a9b0ff34334a20061c04415c406a9c3fc4a5d",
  "blocks": 575,
  "closed": true,
  "coinbase": "0x761d53b47334bee6612c0bd1467fb881435375b2",
  "globalExitRoot": "0xd9aaa6aac27b2ce25fd11ac55f633bd6eaa91188ec709247378876f1200a180d",
  "localExitRoot": "0xa9bc7a6f80839a5b0df03d6c13abfeb251838ee4a25af439251ddc6d74f39650",
  "mainnetExitRoot": "0x8c4ca23c3483fd2069223234604e9b6e4312175a52a4e13f8567cb913267e380",
  "number": "0x1f40b",
  "rollupExitRoot": "0xbb1f9f693b173420023ba450455e397c54b762ea7a3dc223502329639881d64d",
  "sendSequencesTxHash": "0x438878d2e3eb03046db3e8a58f08f066378f0e8a6a17be7c89308ce8348bed40",
  "stateRoot": "0xcea8739d7e4b6c4da4f1bec4296a98958cd7cd893f6d1c9ee76e80c8e233ab1b",
  "timestamp": "0x66fe9ed3",
  "transactions": 47,
  "verifyBatchTxHash": null
}

Fetching data from L2 datastreamer...
{
  "localExitRoot": "0xa9bc7a6f80839a5b0df03d6c13abfeb251838ee4a25af439251ddc6d74f39650",
  "stateRoot": "0xcea8739d7e4b6c4da4f1bec4296a98958cd7cd893f6d1c9ee76e80c8e233ab1b"
}

Fetching data from L1 RollupManager contract...
{
  "accInputHash": "0x96055768d44a1d1dda51ddeec7f49854a11a0b5f7fcdeb8dfb067d652536c81b",
  "timestamp": "0x66fea204",
  "previousLastBatchSequenced": "128010",
  "stateRoot": "0xcea8739d7e4b6c4da4f1bec4296a98958cd7cd893f6d1c9ee76e80c8e233ab1b"
}

Comparing L2 sequencer and L2 RPC...
❌ accInputHash mismatch:
- l2_sequencer:	0xb23daf7bed1b2950fc00de3d029a9b0ff34334a20061c04415c406a9c3fc4a5d
- l2_rpc:	0x96055768d44a1d1dda51ddeec7f49854a11a0b5f7fcdeb8dfb067d652536c81b

❌ The JSON objects are not the same.

Comparing L2 datastreamer and L2 rpc...
✅ The JSON objects are the same.

Comparing L2 sequencer and L1 contracts...
❌ accInputHash mismatch:
- l2_sequencer:	0xb23daf7bed1b2950fc00de3d029a9b0ff34334a20061c04415c406a9c3fc4a5d
- l1_contract:	0x96055768d44a1d1dda51ddeec7f49854a11a0b5f7fcdeb8dfb067d652536c81b

❌ timestamp mismatch:
- l2_sequencer:	0x66fe9ed3
- l1_contract:	0x66fea204

❌ The JSON objects are not the same.

Comparing L2 RPC and L1 contracts...
❌ timestamp mismatch:
- l2_rpc:	0x66fe9ed3
- l1_contract:	0x66fea204

❌ The JSON objects are not the same.

####################################################################################################
#  __     _______ ____  ___ _____ ___ _____ ____    ____    _  _____ ____ _   _
#  \ \   / / ____|  _ \|_ _|  ___|_ _| ____|  _ \  | __ )  / \|_   _/ ___| | | |
#   \ \ / /|  _| | |_) || || |_   | ||  _| | | | | |  _ \ / _ \ | || |   | |_| |
#    \ V / | |___|  _ < | ||  _|  | || |___| |_| | | |_) / ___ \| || |___|  _  |
#     \_/  |_____|_| \_\___|_|   |___|_____|____/  |____/_/   \_\_| \____|_| |_|
#
####################################################################################################

Batch: 128011

Fetching data from L2 RPC...
{
  "accInputHash": "0x96055768d44a1d1dda51ddeec7f49854a11a0b5f7fcdeb8dfb067d652536c81b",
  "blocks": 575,
  "closed": true,
  "coinbase": "0x761d53b47334bee6612c0bd1467fb881435375b2",
  "globalExitRoot": "0xd9aaa6aac27b2ce25fd11ac55f633bd6eaa91188ec709247378876f1200a180d",
  "localExitRoot": "0xa9bc7a6f80839a5b0df03d6c13abfeb251838ee4a25af439251ddc6d74f39650",
  "mainnetExitRoot": "0x8c4ca23c3483fd2069223234604e9b6e4312175a52a4e13f8567cb913267e380",
  "number": "0x1f40b",
  "rollupExitRoot": "0xbb1f9f693b173420023ba450455e397c54b762ea7a3dc223502329639881d64d",
  "sendSequencesTxHash": "0x438878d2e3eb03046db3e8a58f08f066378f0e8a6a17be7c89308ce8348bed40",
  "stateRoot": "0xcea8739d7e4b6c4da4f1bec4296a98958cd7cd893f6d1c9ee76e80c8e233ab1b",
  "timestamp": "0x66fe9ed3",
  "transactions": 47,
  "verifyBatchTxHash": null
}

Fetching data from L2 sequencer...
{
  "accInputHash": "0x96055768d44a1d1dda51ddeec7f49854a11a0b5f7fcdeb8dfb067d652536c81b",
  "blocks": 575,
  "closed": true,
  "coinbase": "0x761d53b47334bee6612c0bd1467fb881435375b2",
  "globalExitRoot": "0xd9aaa6aac27b2ce25fd11ac55f633bd6eaa91188ec709247378876f1200a180d",
  "localExitRoot": "0xa9bc7a6f80839a5b0df03d6c13abfeb251838ee4a25af439251ddc6d74f39650",
  "mainnetExitRoot": "0x8c4ca23c3483fd2069223234604e9b6e4312175a52a4e13f8567cb913267e380",
  "number": "0x1f40b",
  "rollupExitRoot": "0xbb1f9f693b173420023ba450455e397c54b762ea7a3dc223502329639881d64d",
  "sendSequencesTxHash": "0x438878d2e3eb03046db3e8a58f08f066378f0e8a6a17be7c89308ce8348bed40",
  "stateRoot": "0xcea8739d7e4b6c4da4f1bec4296a98958cd7cd893f6d1c9ee76e80c8e233ab1b",
  "timestamp": "0x66fe9ed3",
  "transactions": 47,
  "verifyBatchTxHash": null
}

Fetching data from L2 datastreamer...
{
  "localExitRoot": "0xa9bc7a6f80839a5b0df03d6c13abfeb251838ee4a25af439251ddc6d74f39650",
  "stateRoot": "0xcea8739d7e4b6c4da4f1bec4296a98958cd7cd893f6d1c9ee76e80c8e233ab1b"
}

Fetching data from L1 RollupManager contract...
{
  "accInputHash": "0x96055768d44a1d1dda51ddeec7f49854a11a0b5f7fcdeb8dfb067d652536c81b",
  "timestamp": "0x66fea204",
  "previousLastBatchSequenced": "128010",
  "stateRoot": "0xcea8739d7e4b6c4da4f1bec4296a98958cd7cd893f6d1c9ee76e80c8e233ab1b"
}

Comparing L2 sequencer and L2 RPC...
✅ The JSON objects are the same.

Comparing L2 datastreamer and L2 rpc...
✅ The JSON objects are the same.

Comparing L2 sequencer and L1 contracts...
❌ timestamp mismatch:
- l2_sequencer:	0x66fe9ed3
- l1_contract:	0x66fea204

❌ The JSON objects are not the same.

Comparing L2 RPC and L1 contracts...
❌ timestamp mismatch:
- l2_rpc:	0x66fe9ed3
- l1_contract:	0x66fea204

❌ The JSON objects are not the same.

####################################################################################################
#   ____    _  _____ ____ _   _    ____    _    ____
#  | __ )  / \|_   _/ ___| | | |  / ___|  / \  |  _ \
#  |  _ \ / _ \ | || |   | |_| | | |  _  / _ \ | |_) |
#  | |_) / ___ \| || |___|  _  | | |_| |/ ___ \|  __/
#  |____/_/   \_\_| \____|_| |_|  \____/_/   \_\_|
#
####################################################################################################

L2 Sequencer
- Trusted:	128013
- Virtual:	128011 (2)
- Verified:	128010 (3)

L2 RPC
- Trusted:	128013
- Virtual:	128011 (2)
- Verified:	128010 (3)

L1 RollupManager Contract
- Virtual:	128011
- Verified:	128011

References (if applicable)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant