Skip to content

Conversation

@0xOmarA
Copy link
Contributor

@0xOmarA 0xOmarA commented Jul 16, 2025

Summary

This PR improves the logging for contract deployment to get better errors for some of the things I encountered while working on #10.

Description

I recently encountered the following error:

  2025-07-16T15:45:21.042621Z ERROR revive_dt_core::driver: Contract deployment failed, target: Leader, error: invalid character '_' at position 206
    at crates/core/src/driver/mod.rs:483 on main ThreadId(1)
    in revive_dt_core::driver::Deploying contracts with contract_name: "Main"
    in revive_dt_core::driver::Handling input with input_idx: 0
    in revive_dt_core::driver::Handling case with case_name: "main", case_idx: 0
    in revive_dt_core::driver::With solc mode with solc_mode: SolcMode { solc_version: None, solc_optimize: None, llvm_optimizer_settings: [] }
    in revive_dt_core::driver::Handling metadata file
    in retester::Running driver with metadata_file_path: "era-compiler-tests/solidity/complex/create/create_in_library/test.json"

Without any extra information on which parts of the code this error originated from. After doing some debugging it turned out that it was an issue with the hex::decode of the compiled contracts code where the placeholders for libraries are not hex strings but UTF-8 encoded strings.

This PR solves this issue with logging until we fix the issues we have around linking. I realize that linking might be somewhat complex as a quick search lead me to think that linking forms a DAG where we could have ContractA -> LibraryA -> LibraryB and we would need to handle these cases correctly. So, I have elected to not solve that in this PR, and I might look into the matterlabs tester to see how they handle the linking and borrow some ideas from there in terms of the ordering of the linking, and such.

What do you think? @xermicus

@xermicus
Copy link
Member

Fair enough

@0xOmarA 0xOmarA added this pull request to the merge queue Jul 16, 2025
Merged via the queue into main with commit 2d51778 Jul 16, 2025
5 checks passed
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.

3 participants