testinprod-io / op-erigon

Optimism implementation on the efficiency frontier
https://op-erigon.testinprod.io
GNU Lesser General Public License v3.0
87 stars 15 forks source link

blockscout can't index create smartcontract transaction from op-erigon rpc #194

Open dome opened 5 months ago

dome commented 5 months ago

blockscout can't index create smartcontract transaction from op-erigon rpc

https://github.com/blockscout/blockscout/issues/10298

{
   "time":"2024-06-21T09:23:32.238Z",
   "severity":"error",
   "message":"** (FunctionClauseError) no function clause matching in EthereumJSONRPC.Transaction.do_elixir_to_params/1
    (ethereum_jsonrpc 6.6.0) lib/ethereum_jsonrpc/transaction.ex:257: EthereumJSONRPC.Transaction.do_elixir_to_params(%{nil => nil, "blockHash" => "0x81470042a6186721aa78e2ac0d4d48d6c1d970af851e5d6155d2f90d08934691", "blockNumber" => 384583, "block_timestamp" => ~U[2024-06-20 08:00:25Z], "chainId" => 7003, "from" => "0x506ecb4c214c7eb712dc709cc4789dfa58cf513f", "gas" => 1002901, "gasPrice" => 250, "hash" => "0x426f2548f399ac932566f02def5b04495b627157b1e40530104ba246f54fffc7", "input" => "0x608060405234801561001057600080fd5b5073506ecb4c214c7eb712dc709cc4789dfa58cf513f6040518060400160405280600b81526020016a29a2a729a2902a37b5b2b760a91b8152506040518060400160405280600381526020016229a2a760e91b81525081600390816100759190610399565b5060046100828282610399565b50506005805460ff19169055506001600160a01b0381166100be57604051631e4fbdf760e01b8152600060048201526024015b60405180910390fd5b6100c7816100f4565b506100ef73506ecb4c214c7eb712dc709cc4789dfa58cf513f683635c9adc5dea0000061014e565b61047e565b600580546001600160a01b03838116610100818102610100600160a81b031985161790945560405193909204169182907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e090600090a35050565b6001600160a01b0382166101785760405163ec442f0560e01b8152600060048201526024016100b5565b61018460008383610188565b5050565b610193838383610198565b505050565b6101a06101ab565b6101938383836101d1565b60055460ff16156101cf5760405163d93c066560e01b815260040160405180910390fd5b565b6001600160a01b0383166101fc5780600260008282546101f19190610457565b9091555061026e9050565b6001600160a01b0383166000908152602081905260409020548181101561024f5760405163391434e360e21b81526001600160a01b038516600482015260248101829052604481018390526064016100b5565b6001600160a01b03841660009081526020819052604090209082900390555b6001600160a01b03821661028a576002805482900390556102a9565b6001600160a01b03821660009081526020819052604090208054820190555b816001600160a01b0316836001600160a01b03167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef836040516102ee91815260200190565b60405180910390a3505050565b634e487b7160e01b600052604160045260246000fd5b600181811c9082168061032557607f821691505b60208210810361034557634e487b7160e01b600052602260045260246000fd5b50919050565b601f82111561019357806000526020600020601f840160051c810160208510156103725750805b601f840160051c820191505b81811015610392576000815560010161037e565b5050505050565b81516001600160401b038111156103b2576103b26102fb565b6103c6816103c08454610311565b8461034b565b6020601f8211600181146103fa57600083156103e25750848201515b600019600385901b1c1916600184901b178455610392565b600084815260208120601f198516915b8281101561042a578785015182556020948501946001909201910161040a565b50848210156104485786840151600019600387901b60f8161c191681555b50505050600190811b01905550565b8082018082111561047857634e487b7160e01b600052601160045260246000fd5b92915050565b610ed78061048d6000396000f3fe608060405234801561001057600080fd5b50600436106101515760003560e01c80635c975abb116100cd5780638da5cb5b11610081578063a9059cbb11610066578063a9059cbb146102b2578063dd62ed3e146102c5578063f2fde38b1461030b57600080fd5b80638da5cb5b1461026757806395d89b41146102aa57600080fd5b8063715018a6116100b2578063715018a61461024457806379cc67901461024c5780638456cb591461025f57600080fd5b80635c975abb1461020357806370a082311461020e57600080fd5b8063313ce567116101245780633f4ba83a116101095780633f4ba83a146101d557806340c10f19146101dd57806342966c68146101f057600080fd5b8063313ce567146101bc5780633ccfd60b146101cb57600080fd5b806306fdde0314610156578063095ea7b31461017457806318160ddd1461019757806323b872dd146101a9575b600080fd5b61015e61031e565b60405161016b9190610caa565b60405180910390f35b610187610182366004610d3f565b6103b0565b604051901515815260200161016b565b6002545b60405190815260200161016b565b6101876101b7366004610d69565b6103ca565b6040516012815260200161016b565b6101d36103ee565b005b6101d3610446565b6101d36101eb366004610d3f565b610458565b6101d36101fe366004610da6565b61046e565b60055460ff16610187565b61019b61021c366004610dbf565b73ffffffffffffffffffffffffffffffffffffffff1660009081526020819052604090205490565b6101d3610478565b6101d361025a366004610d3f565b61048a565b6101d361049f565b600554610100900473ffffffffffffffffffffffffffffffffffffffff1660405173ffffffffffffffffffffffffffffffffffffffff909116815260200161016b565b61015e6104af565b6101876102c0366004610d3f565b6104be565b61019b6102d3366004610de1565b73ffffffffffffffffffffffffffffffffffffffff918216600090815260016020908152604080832093909416825291909152205490565b6101d3610319366004610dbf565b6104cc565b60606003805461032d90610e14565b80601f016020809104026020016040519081016040528092919081815260200182805461035990610e14565b80156103a65780601f1061037b5761010080835404028352" <> ..., "maxFeePerGas" => 500, "maxPriorityFeePerGas" => 0, "nonce" => 4, "r" => 98814856848500852577101313368614632326504206594737351632831951787819762172126, "s" => 48908180386254291537439420766437668214038117997090322766807678955111142011590, "transactionIndex" => 1, "type" => 2, "v" => 1, "value" => 0})
    (ethereum_jsonrpc 6.6.0) lib/ethereum_jsonrpc/transaction.ex:253: EthereumJSONRPC.Transaction.elixir_to_params/1
    (elixir 1.14.5) lib/enum.ex:1658: Enum."-map/2-lists^map/1-0-"/2
    (elixir 1.14.5) lib/enum.ex:1658: Enum."-map/2-lists^map/1-0-"/2
    (ethereum_jsonrpc 6.6.0) lib/ethereum_jsonrpc/blocks.ex:54: EthereumJSONRPC.Blocks.from_responses/2
    (ethereum_jsonrpc 6.6.0) lib/ethereum_jsonrpc.ex:576: EthereumJSONRPC.fetch_blocks_by_params/3
    (stdlib 3.17) timer.erl:166: :timer.tc/1
    (indexer 6.6.0) lib/indexer/block/fetcher.ex:137: Indexer.Block.Fetcher.fetch_and_import_range/3

    Retrying.",
   "metadata":{
      "fetcher":"block_catchup",
      "first_block_number":384583,
      "last_block_number":384583
   }
}
ImTei commented 5 months ago

@dome Hello, can you give us more details about the error? e.g. RPC response from op-erigon is not expected form.

dome commented 5 months ago

you can reproduce

  1. setup op-erigon and op-node
  2. deploy blockscout config to op-erigon rpc
  3. deploy smartcontract ERC20 or other
  4. when blockscout fetch this block you will got error like this https://gist.githubusercontent.com/dome/5c8a8f35a020ee08cc2da93c37b7b1ea/raw/b961a9c540262f48a9d5ad7947469f124fa46f79/log.txt

easy way is

  1. git clone https://github.com/bobanetwork/boba
  2. cd boba
  3. make devnet-up
  4. connect blockscout to port 9545
ImTei commented 5 months ago

@dome Thank you for the information, but it's a blockscout error message. It seems op-erigon returns a response for the RPC request.

dome commented 5 months ago

report to blockscout already. but i'm not sure why op-geth work fine.