Skip to content
This repository has been archived by the owner on Nov 27, 2024. It is now read-only.

Missing identifying coinbase transfer #335

Open
syang-ng opened this issue Jul 21, 2023 · 0 comments
Open

Missing identifying coinbase transfer #335

syang-ng opened this issue Jul 21, 2023 · 0 comments

Comments

@syang-ng
Copy link

Description

The transaction 0x3839cb0c3d4c94e9fcb3f59e054f34f5dee025c3e651ff5fc52e36821c300bef transfers 13.915316914625093691 ETH to coinbase. However, mev-inspect cannot identify this transfer but labels it as 0.

Labeled by mev-inspect:

created_at block_number transaction_hash transaction_index miner_address coinbase_transfer base_fee_per_gas gas_price gas_price_with_coinbase_transfer gas_used transaction_to_address transaction_from_address
2023-07-17 14:50:45.057002 16522150 0xef2e48a62560bec20883bbc11369223de41caacc4f4d490abbcb495a08d0a7f9 0 0xdafea492d9c6733ae3d56b7ed1adb60692c98bc5 0 21017183471 22017183471 22017183471 364902 0x6352a56caadc4f1e25cd6c75970fa768a3304e64 0x346f1d297c98c28574742b067b67a80cda2dc0d9
2023-07-17 14:50:45.057002 16522150 0x3839cb0c3d4c94e9fcb3f59e054f34f5dee025c3e651ff5fc52e36821c300bef 1 0xdafea492d9c6733ae3d56b7ed1adb60692c98bc5 0 21017183471 26017183471 26017183471 492787 0x70d772361eb567eb45da56e147e5224e2abedeba 0xc207c7b5a4735de955c4cf844e10be8c8034d760
2023-07-17 14:50:45.057002 16522150 0x6e6c311136ca562a8f70f4139b60ecc3780b91a8cd34ac7375c32d3adcedaa42 2 0xdafea492d9c6733ae3d56b7ed1adb60692c98bc5 0 21017183471 46200000000 46200000000 52475 0xb62132e35a6c13ee1ee0f84dc5d40bad8d815206 0xffec0067f5a79cff07527f63d83dd5462ccf8ba4

Labeled by Etherscan:

image

Bug Analysis

The mev-inspect will only identify the trace whose action["input"]=="0x" according to the source code. Therefore, it will ignore all traces whose input is not 0x.

def get_transfer(trace: ClassifiedTrace) -> Optional[Transfer]:
if _is_simple_eth_transfer(trace):
return build_eth_transfer(trace)
if isinstance(trace, DecodedCallTrace):
return _build_erc20_transfer(trace)
return None
def _is_simple_eth_transfer(trace: ClassifiedTrace) -> bool:
return (
trace.value is not None
and trace.value > 0
and "input" in trace.action
and trace.action["input"] == "0x"
)

In the transaction 0x3839cb0c3d4c94e9fcb3f59e054f34f5dee025c3e651ff5fc52e36821c300bef, the input of the call is 0x00000000. This link shows the detail traces:

image

Bug Fix

Can we remove the requirement of action["input"]=="0x"? Is it necessary to filter out other not simple ETH transfer transactions?

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

No branches or pull requests

1 participant