Zilliqa / zq2

Zilliqa 2.0 code base
Apache License 2.0
10 stars 0 forks source link

Z2-Converter : contract checker failed for some contracts while converting persistence for transition storage. #1885

Open chetan-zilliqa opened 1 week ago

chetan-zilliqa commented 1 week ago

There are around 203 contracts in ZQ1 which fails to run contract checker.

All of them fails with below error:

Checker failed for address 0xfbe7495ccdedfc73aa3e23d90936d2856b057ada with error: Failed to check contract code: Contract check error: ErrorResponse { errors: [Error { start_location: Location { line: 191 }, error_message: "Type error: cannot apply \"sha256hash\" built-in to argument(s) of type(s): ['A]" }, Error { start_location: Location { line: 517 }, error_message: "Couldn't resolve identifier: signable_to_cheque_hash" }, Error { start_location: Location { line: 523 }, error_message: "Couldn't resolve identifier: signable_to_cheque_hash" }, Error { start_location: Location { line: 543 }, error_message: "Procedure not found: AssertIsAdminSignatureAndVoidIt" }, Error { start_location: Location { line: 550 }, error_message: "Procedure not found: AssertIsAdminSignatureAndVoidIt" }, Error { start_location: Location { line: 618 }, error_message: "Procedure not found: AssertIsAdminOrServiceAccountSignatureAndVoidAndSetWasServiceAccount" }, Error { start_location: Location { line: 627 }, error_message: "Procedure not found: AssertIsAdminOrServiceAccountSignatureAndVoidAndSetWasServiceAccount" }, Error { start_location: Location { line: 659 }, error_message: "Procedure not found: AssertIsAdminSignatureAndVoidIt" }, Error { start_location: Location { line: 674 }, error_message: "Procedure not found: AssertIsAdminSignatureAndVoidIt" }, Error { start_location: Location { line: 681 }, error_message: "Procedure not found: AssertIsAdminSignatureAndVoidIt" }, Error { start_location: Location { line: 708 }, error_message: "Procedure not found: AssertIsAdminSignatureAndVoidIt" }, Error { start_location: Location { line: 715 }, error_message: "Procedure not found: AssertIsAdminSignatureAndVoidIt" }, Error { start_location: Location { line: 722 }, error_message: "Procedure not found: AssertIsAdminSignatureAndVoidIt" }, Error { start_location: Location { line: 729 }, error_message: "Procedure not found: AssertIsAdminSignatureAndVoidIt" }, Error { start_location: Location { line: 816 }, error_message: "Procedure not found: AssertIsAdminSignatureAndVoidIt" }, Error { start_location: Location { line: 822 }, error_message: "Procedure not found: AssertIsAdminSignatureAndVoidIt" }, Error { start_location: Location { line: 828 }, error_message: "Procedure not found: AssertIsAdminSignatureAndVoidIt" }, Error { start_location: Location { line: 948 }, error_message: "Procedure not found: AssertIsAdminSignatureAndVoidIt" }, Error { start_location: Location { line: 955 }, error_message: "Procedure not found: AssertIsAdminSignatureAndVoidIt" }, Error { start_location: Location { line: 967 }, error_message: "Procedure not found: AssertIsAdminSignatureAndVoidIt" }, Error { start_location: Location { line: 997 }, error_message: "Couldn't resolve identifier: signable_to_cheque_hash" }, Error { start_location: Location { line: 1010 }, error_message: "Procedure not found: AssertIsAdminSignatureAndVoidIt" }], gas_remaining: ScillaGas(9999906) }
[](url)
chetan-zilliqa commented 1 week ago

Backtrace:

Stack backtrace:
   0: anyhow::error::<impl anyhow::Error>::msg
             at /home/chetan_zilliqa_com/.cargo/registry/src/index.crates.io-6f17d22bba15001f/anyhow-1.0.93/src/backtrace.rs:27:14
   1: z2lib::converter::invoke_checker::{{closure}}::{{closure}}
             at ./z2/src/converter.rs:91:40
   2: core::result::Result<T,E>::map_err
             at /rustc/eeb90cda1969383f56a2637cbd3037bdf598841c/library/core/src/result.rs:854:27
   3: z2lib::converter::invoke_checker::{{closure}}
             at ./z2/src/converter.rs:91:13
   4: core::result::Result<T,E>::and_then
             at /rustc/eeb90cda1969383f56a2637cbd3037bdf598841c/library/core/src/result.rs:1346:22
   5: z2lib::converter::invoke_checker
             at ./z2/src/converter.rs:83:5
   6: z2lib::converter::convert_scilla_state
             at ./z2/src/converter.rs:185:32
   7: z2lib::converter::convert_persistence::{{closure}}
             at ./z2/src/converter.rs:452:21
   8: z2lib::plumbing::run_persistence_converter::{{closure}}
             at ./z2/src/plumbing.rs:370:76
   9: z2::main::{{closure}}
             at ./z2/src/bin/z2.rs:916:18
  10: <core::pin::Pin<P> as core::future::future::Future>::poll
             at /rustc/eeb90cda1969383f56a2637cbd3037bdf598841c/library/core/src/future/future.rs:123:9
  11: tokio::runtime::park::CachedParkThread::block_on::{{closure}}
             at /home/chetan_zilliqa_com/.cargo/registry/src/index.crates.io-6f17d22bba15001f/tokio-1.41.1/src/runtime/park.rs:281:63
  12: tokio::runtime::coop::with_budget
             at /home/chetan_zilliqa_com/.cargo/registry/src/index.crates.io-6f17d22bba15001f/tokio-1.41.1/src/runtime/coop.rs:107:5
  13: tokio::runtime::coop::budget
             at /home/chetan_zilliqa_com/.cargo/registry/src/index.crates.io-6f17d22bba15001f/tokio-1.41.1/src/runtime/coop.rs:73:5
  14: tokio::runtime::park::CachedParkThread::block_on
             at /home/chetan_zilliqa_com/.cargo/registry/src/index.crates.io-6f17d22bba15001f/tokio-1.41.1/src/runtime/park.rs:281:31
  15: tokio::runtime::context::blocking::BlockingRegionGuard::block_on
             at /home/chetan_zilliqa_com/.cargo/registry/src/index.crates.io-6f17d22bba15001f/tokio-1.41.1/src/runtime/context/blocking.rs:66:9
  16: tokio::runtime::scheduler::multi_thread::MultiThread::block_on::{{closure}}
             at /home/chetan_zilliqa_com/.cargo/registry/src/index.crates.io-6f17d22bba15001f/tokio-1.41.1/src/runtime/scheduler/multi_thread/mod.rs:87:13
  17: tokio::runtime::context::runtime::enter_runtime
             at /home/chetan_zilliqa_com/.cargo/registry/src/index.crates.io-6f17d22bba15001f/tokio-1.41.1/src/runtime/context/runtime.rs:65:16
  18: tokio::runtime::scheduler::multi_thread::MultiThread::block_on
             at /home/chetan_zilliqa_com/.cargo/registry/src/index.crates.io-6f17d22bba15001f/tokio-1.41.1/src/runtime/scheduler/multi_thread/mod.rs:86:9
  19: tokio::runtime::runtime::Runtime::block_on_inner
             at /home/chetan_zilliqa_com/.cargo/registry/src/index.crates.io-6f17d22bba15001f/tokio-1.41.1/src/runtime/runtime.rs:370:45
  20: tokio::runtime::runtime::Runtime::block_on
             at /home/chetan_zilliqa_com/.cargo/registry/src/index.crates.io-6f17d22bba15001f/tokio-1.41.1/src/runtime/runtime.rs:340:13
  21: z2::main
             at ./z2/src/bin/z2.rs:591:5
  22: core::ops::function::FnOnce::call_once
             at /rustc/eeb90cda1969383f56a2637cbd3037bdf598841c/library/core/src/ops/function.rs:250:5
  23: std::sys::backtrace::__rust_begin_short_backtrace
             at /rustc/eeb90cda1969383f56a2637cbd3037bdf598841c/library/std/src/sys/backtrace.rs:152:18
  24: std::rt::lang_start::{{closure}}
             at /rustc/eeb90cda1969383f56a2637cbd3037bdf598841c/library/std/src/rt.rs:162:18
  25: core::ops::function::impls::<impl core::ops::function::FnOnce<A> for &F>::call_once
             at /rustc/eeb90cda1969383f56a2637cbd3037bdf598841c/library/core/src/ops/function.rs:284:13
  26: std::panicking::try::do_call
             at /rustc/eeb90cda1969383f56a2637cbd3037bdf598841c/library/std/src/panicking.rs:557:40
  27: std::panicking::try
             at /rustc/eeb90cda1969383f56a2637cbd3037bdf598841c/library/std/src/panicking.rs:521:19
  28: std::panic::catch_unwind
             at /rustc/eeb90cda1969383f56a2637cbd3037bdf598841c/library/std/src/panic.rs:350:14
  29: std::rt::lang_start_internal::{{closure}}
             at /rustc/eeb90cda1969383f56a2637cbd3037bdf598841c/library/std/src/rt.rs:141:48
  30: std::panicking::try::do_call
             at /rustc/eeb90cda1969383f56a2637cbd3037bdf598841c/library/std/src/panicking.rs:557:40
  31: std::panicking::try
             at /rustc/eeb90cda1969383f56a2637cbd3037bdf598841c/library/std/src/panicking.rs:521:19
  32: std::panic::catch_unwind
             at /rustc/eeb90cda1969383f56a2637cbd3037bdf598841c/library/std/src/panic.rs:350:14
  33: std::rt::lang_start_internal
             at /rustc/eeb90cda1969383f56a2637cbd3037bdf598841c/library/std/src/rt.rs:141:20
  34: std::rt::lang_start
             at /rustc/eeb90cda1969383f56a2637cbd3037bdf598841c/library/std/src/rt.rs:161:17
  35: main
  36: <unknown>
  37: __libc_start_main
  38: _start

Note that currently we are not saving transitions for these failed contracts in the zq2 converter code.

chetan-zilliqa commented 2 days ago

address.txt Attached are the list of contract accounts that fails.

chetan-zilliqa commented 2 days ago

I roughly checked some random contracts, and they were all created in 2022. There are no transactions in most of them. Only contract creation. Some of them have it , for eg : https://viewblock.io/zilliqa/address/zil154n94kfsm2h2ha3x9rvt2l0p8p7w0ykwdff8k9 https://viewblock.io/zilliqa/address/zil1km4yrn96rcwa3l3una2z6cy2k9afpnmrpa7net?tab=state , but no recent transactions. We can check with the IgniteDao team as well.

Please validate this understanding.