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

[Bug] deploy deserial error using artifact sol! macro #745

Closed
alexlatif opened this issue May 13, 2024 · 3 comments
Closed

[Bug] deploy deserial error using artifact sol! macro #745

alexlatif opened this issue May 13, 2024 · 3 comments
Labels
bug Something isn't working

Comments

@alexlatif
Copy link

alexlatif commented May 13, 2024

Component

contract

What version of Alloy are you on?

0.1.0

Operating System

macOS (Apple Silicon)

Describe the bug

i cannot seem to understand where i am going wrong in trying to call deploy on a contract i have just made using the sol macro. error thrown is in deserialization during the .deploy

    sol!(
        #[sol(rpc)]
        Count,
        "test/Counter.json"
    );

    let contract_name = "foo";
    let contract =
        Count::deploy(provider).await.context(format!("Failed to deploy: {}", contract_name))?;

    info!("Deployed at: {}", format!("{}", contract.address()));

no constructor args in my contract


`trace` for full body bytes=845
Error: Failed to deploy: foo

Caused by:
    0: deserialization error: invalid number at line 1 column 23
    1: invalid number at line 1 column 23

standard middleware provider

    let provider = ProviderBuilder::new()
        .with_recommended_fillers()
        .signer(EthereumSigner::from(wallet))
        .on_http(rpc_url);
  1. how can I debug this better?

  2. what do i do to fix it?

@alexlatif alexlatif added the bug Something isn't working label May 13, 2024
@alexlatif alexlatif changed the title [Bug] debug hard on deploy deserial error using artifact sol! macro [Bug] deploy deserial error using artifact sol! macro May 13, 2024
@DaniPopes
Copy link
Member

What RPC are you using?
Can you run with RUST_LOG=alloy=trace and post the full response JSON?

@alexlatif
Copy link
Author

alexlatif commented May 13, 2024

infura.io currently on Eth Sepolia

2024-05-13T20:02:09.209418Z DEBUG ReqwestTransport{url=https://sepolia.infura.io/v3/2PWWLK6SolIUtcFp9dGL4SnIwre}: alloy_transport_http::reqwest_transport: retrieved response body. Use `trace` for full body bytes=767
2024-05-13T20:02:09.209432Z TRACE ReqwestTransport{url=https://sepolia.infura.io/v3/2PWWLK6SolIUtcFp9dGL4SnIwre}: alloy_transport_http::reqwest_transport: response body body={"jsonrpc":"2.0","id":1,"result":{"baseFeePerBlobGas":["0xc0","0xb2","0xab","0x98","0x9e","0x92","0xa4","0xb9","0xd0","0xea","0xfd"],"baseFeePerGas":["0x4cb8cf181","0x53075988e","0x4fb92ee18","0x45c209055","0x4e790dca2","0x58462e84e","0x5b7659f4e","0x5d66ea3aa","0x6283c6e45","0x5ecf0e1e5","0x5da59cf89"],"blobGasUsedRatio":[0.16666666666666666,0.3333333333333333,0,0.6666666666666666,0.16666666666666666,1,1,1,1,0.8333333333333334],"gasUsedRatio":[0.8288135,0.3407616666666667,0,0.9997232,0.999601,0.6444664333333333,0.5848306333333333,0.7189564,0.34952733333333336,0.4509799666666667],"oldestBlock":"0x59f94f","reward":[["0x59682f00"],["0x59682f00"],["0x0"],["0x59682f00"],["0x59682f00"],["0x3b9aca00"],["0x59682f00"],["0x59682f00"],["0x3b9aca00"],["0x59682f00"]]}}
2024-05-13T20:02:09.209510Z TRACE alloy_json_rpc::result: deserializing response ty=alloy_rpc_types::eth::fee::FeeHistory json="{\"baseFeePerBlobGas\":[\"0xc0\",\"0xb2\",\"0xab\",\"0x98\",\"0x9e\",\"0x92\",\"0xa4\",\"0xb9\",\"0xd0\",\"0xea\",\"0xfd\"],\"baseFeePerGas\":[\"0x4cb8cf181\",\"0x53075988e\",\"0x4fb92ee18\",\"0x45c209055\",\"0x4e790dca2\",\"0x58462e84e\",\"0x5b7659f4e\",\"0x5d66ea3aa\",\"0x6283c6e45\",\"0x5ecf0e1e5\",\"0x5da59cf89\"],\"blobGasUsedRatio\":[0.16666666666666666,0.3333333333333333,0,0.6666666666666666,0.16666666666666666,1,1,1,1,0.8333333333333334],\"gasUsedRatio\":[0.8288135,0.3407616666666667,0,0.9997232,0.999601,0.6444664333333333,0.5848306333333333,0.7189564,0.34952733333333336,0.4509799666666667],\"oldestBlock\":\"0x59f94f\",\"reward\":[[\"0x59682f00\"],[\"0x59682f00\"],[\"0x0\"],[\"0x59682f00\"],[\"0x59682f00\"],[\"0x3b9aca00\"],[\"0x59682f00\"],[\"0x59682f00\"],[\"0x3b9aca00\"],[\"0x59682f00\"]]}"
2024-05-13T20:02:09.210043Z TRACE alloy_json_rpc::result: failed to deserialize response err=Error("invalid number", line: 1, column: 23)

is this an RPC specific issue? if so what would you recommend?

@DaniPopes
Copy link
Member

DaniPopes commented May 13, 2024

I cannot reproduce this, please try on latest main commit

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants