Skip to content

Comments

use alloy GenericContractError in reth_primitives::abi::decode_revert_reason#4759

Merged
DaniPopes merged 4 commits intoparadigmxyz:alloyfrom
alessandromazza98:issue4730
Sep 26, 2023
Merged

use alloy GenericContractError in reth_primitives::abi::decode_revert_reason#4759
DaniPopes merged 4 commits intoparadigmxyz:alloyfrom
alessandromazza98:issue4730

Conversation

@alessandromazza98
Copy link
Contributor

Closes #4730

@alessandromazza98
Copy link
Contributor Author

I get some errors related to git dependencies not allowed. Specifically related to alloy which I actually need to use GenericContractError...

@codecov
Copy link

codecov bot commented Sep 25, 2023

Codecov Report

Merging #4759 (146823e) into alloy (9e613b4) will decrease coverage by 0.03%.
The diff coverage is 0.00%.

Impacted file tree graph

Files Coverage Δ
crates/revm/revm-inspectors/src/tracing/types.rs 0.00% <0.00%> (ø)
crates/rpc/rpc/src/eth/error.rs 9.39% <0.00%> (ø)
crates/primitives/src/abi.rs 0.00% <0.00%> (ø)

... and 8 files with indirect coverage changes

Flag Coverage Δ
integration-tests 15.99% <0.00%> (+<0.01%) ⬆️
unit-tests 62.84% <0.00%> (-0.03%) ⬇️

Flags with carried forward coverage won't be shown. Click here to find out more.

Components Coverage Δ
reth binary 32.07% <ø> (ø)
blockchain tree 83.76% <ø> (ø)
pipeline 88.53% <ø> (ø)
storage (db) 73.55% <ø> (ø)
trie 94.48% <ø> (ø)
txpool 49.52% <ø> (-0.47%) ⬇️
networking 76.92% <ø> (+0.03%) ⬆️
rpc 57.67% <0.00%> (ø)
consensus 62.89% <ø> (ø)
revm 28.40% <0.00%> (ø)
payload builder 8.20% <ø> (ø)
primitives 85.51% <0.00%> (-0.05%) ⬇️

@onbjerg
Copy link
Collaborator

onbjerg commented Sep 25, 2023

@alessandromazza98 you need to add it here:

reth/deny.toml

Lines 97 to 103 in 0f9def0

allow-git = [
"https://github.com/bluealloy/revm",
"https://github.com/boa-dev/boa",
"https://github.com/ethereum/c-kzg-4844",
"https://github.com/sigp/discv5",
"https://github.com/stevefan1999-personal/rust-igd",
]

@onbjerg onbjerg added the C-debt A clean up/refactor of existing code label Sep 25, 2023
@DaniPopes
Copy link
Member

DaniPopes commented Sep 25, 2023

@alessandromazza98 Can you please rebase your branch on top of alloy (#4737) and change the target branch to it? (Same goes for all the other issues in #4715). This fixes any CI issues.

Copy link
Member

@DaniPopes DaniPopes left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

rest LGTM after rebase

@alessandromazza98
Copy link
Contributor Author

alessandromazza98 commented Sep 25, 2023

Ok fixed the comments and changed branch where to put my PR into, hope to have done it correctly @DaniPopes ?

@alessandromazza98 alessandromazza98 changed the base branch from main to alloy September 25, 2023 17:05
Copy link
Member

@DaniPopes DaniPopes left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Last few things

@DaniPopes
Copy link
Member

Would be nice if we could add some test cases for this function, but I don't really know how to get them "efficiently". Maybe we can open an issue after this

@alessandromazza98
Copy link
Contributor Author

Solved comments.

Speaking about the .as_deref() it does not work and you have to use a closure because while Bytes can be automatically dereferened to &[u8], inside the and_then(..) method the compiler cannot do the conversion so you should force it with a closure like it is now.

Let me know if you like it.

@alessandromazza98
Copy link
Contributor Author

Would be nice if we could add some test cases for this function, but I don't really know how to get them "efficiently". Maybe we can open an issue after this

I am interested in helping on this one. We can create a related issue and I could work on that.

The properly test we should create some contracts that fails (both in Solidity and Vyper) and check if this function decodes the revert reason properly. Or maybe we could copy and paste some reverts from some contracts on-chain?

Copy link
Member

@DaniPopes DaniPopes left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

C-debt A clean up/refactor of existing code

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Replace ethers usage in reth_primitives::abi::decode_revert_reason

3 participants