telosnetwork / hyperion-telos-evm-plugin

3 stars 1 forks source link

Indexing failure with Anchor signed transactions #31

Open poplexity opened 2 years ago

poplexity commented 2 years ago

2022-03-20T22:54:22: {"action_ordinal":1,"creator_action_ordinal":0,"receipt":["action_receipt_v0",{"receiver":"eosio.evm","act_digest":"30B70C389BF9F07A67243F576FD6570557F0B7E7B4C89017D8DD2BF859FE4518","global_sequence":"9823630621","recv_seque nce":"505218","auth_sequence":[{"account":"foflexitytls","sequence":"1713"}],"code_sequence":1,"abi_sequence":1}],"receiver":"eosio.evm","act":{"account":"eosio.evm","name":"raw","authorization":[{"actor":"foflexitytls","permission":"active"}]," data":{"ram_payer":"eosio.evm","tx":"F8480C85745EF2D63182AC1194D102CE6A4DB07D247FCC28F366A623DF0938CA9E80A42E1A7D4D00000000000000000000000000000000000000000000000006F05B59D3B20000288080","estimate_gas":false,"sender":"A45D3C1694A663A1C1DC606A303 798F6EFA0DEBD"}},"context_free":false,"elapsed":"954","console":"RCPT{{{\"charged_gas\": \"745ef2d631\",\"trx_index\": 0,\"block\": 205777546,\"status\": 1,\"epoch\": 1647816862,\"createdaddr\": \"\",\"gasused\": \"89a7\",\"gasusedblock\": \"89a 7\",\"logs\": [{\"address\": \"d102ce6a4db07d247fcc28f366a623df0938ca9e\",\"data\": \"00000000000000000000000000000000000000000000000006f05b59d3b20000\",\"topics\": [\"7fcf532c15f0a6db0bd6d0e038bea71d30d808c7d98cb3bf7268a95bf5081b65\",\"a45d3c16 94a663a1c1dc606a303798f6efa0debd\"]}],\"output\": \"\",\"errors\": [],\"itxs\": []}}}RCPT\n","account_ram_deltas":[],"account_disk_deltas":[],"except":null,"error_code":null,"return_value":""} 2022-03-20T22:54:22: Receipt: {"charged_gas":"745ef2d631","trx_index":0,"block":205777546,"status":1,"epoch":1647816862,"createdaddr":"","gasused":"89a7","gasusedblock":"89a7","logs":[{"address":"d102ce6a4db07d247fcc28f366a623df0938ca9e","data": "00000000000000000000000000000000000000000000000006f05b59d3b20000","topics":["7fcf532c15f0a6db0bd6d0e038bea71d30d808c7d98cb3bf7268a95bf5081b65","a45d3c1694a663a1c1dc606a303798f6efa0debd"]}],"output":"","errors":[],"itxs":[]} 2022-03-20T22:54:22: Error: Incompatible EIP155-based V 40 and chain id 40. See the Common parameter of the Transaction constructor to set the chain id. 2022-03-20T22:54:22: at Transaction._validateTxV (/hyperion-history-api/plugins/repos/telos-evm/node_modules/@ethereumjs/tx/src/legacyTransaction.ts:337:17) 2022-03-20T22:54:22: at new Transaction (/hyperion-history-api/plugins/repos/telos-evm/node_modules/@ethereumjs/tx/src/legacyTransaction.ts:105:24) 2022-03-20T22:54:22: at Function.fromValuesArray (/hyperion-history-api/plugins/repos/telos-evm/node_modules/@ethereumjs/tx/src/legacyTransaction.ts:79:12) 2022-03-20T22:54:22: at Function.fromSerializedTx (/hyperion-history-api/plugins/repos/telos-evm/node_modules/@ethereumjs/tx/src/legacyTransaction.ts:49:17) 2022-03-20T22:54:22: at handler (/hyperion-history-api/plugins/repos/telos-evm/index.ts:182:48) 2022-03-20T22:54:22: at HyperionModuleLoader.processActionData (/hyperion-history-api/modules/loader.ts:51:40) 2022-03-20T22:54:22: at Object.attachActionExtras (/hyperion-history-api/workers/ds-pool.ts:138:22) 2022-03-20T22:54:22: at HyperionParser.deserializeActionData (/hyperion-history-api/modules/parsers/base-parser.ts:190:31) 2022-03-20T22:54:22: at runMicrotasks () 2022-03-20T22:54:22: at processTicksAndRejections (node:internal/process/task_queues:96:5) 2022-03-20T22:54:22: at HyperionParser.parseAction (/hyperion-history-api/modules/parsers/2.1-parser.ts:32:9) 2022-03-20T22:54:22: at DSPoolWorker.processTraces (/hyperion-history-api/workers/ds-pool.ts:450:39) 2022-03-20T22:54:22: at DSPoolWorker.processMessages (/hyperion-history-api/workers/ds-pool.ts:399:13) 2022-03-20T22:54:22: { 2022-03-20T22:54:22: ram_payer: 'eosio.evm', 2022-03-20T22:54:22: tx: 'F8480C85745EF2D63182AC1194D102CE6A4DB07D247FCC28F366A623DF0938CA9E80A42E1A7D4D00000000000000000000000000000000000000000000000006F05B59D3B20000288080', 2022-03-20T22:54:22: estimate_gas: false, 2022-03-20T22:54:22: sender: 'A45D3C1694A663A1C1DC606A303798F6EFA0DEBD' 2022-03-20T22:54:22: }

poplexity commented 2 years ago

This may suggest that the EVM contract isn't properly enforcing chain id, if the transaction made it thru the contract and failed on chainId in the indexer.

poplexity commented 2 years ago

The contract only checks chainId when there is a signed transaction, so with transactions signed by Telos native accounts the chainId is not checked. This is fine, the chainId and EIP155 is to prevent replay attacks and Telos native signed transactions can't be replayed.

So, need to better handle this in the indexer... and will not be including EIP155 chainId in native signed transactions in Teloscan.