Zondax / namadexer

Namada indexer
39 stars 57 forks source link

Error: InvalidTxData #129

Closed StoneMac65 closed 8 months ago

StoneMac65 commented 8 months ago

I faced new error at block number 11461

 2024-02-14T06:06:32.625790Z  INFO namadexer::indexer: Got block 11461
    at src/indexer/mod.rs:51
    in namadexer::indexer::get_block with block_height: 11461

  2024-02-14T06:06:32.629317Z ERROR namadexer::indexer: Closing block producer task due to an error saving last block: Invalid Transaction data
    at src/indexer/mod.rs:229

Error: InvalidTxData
msobh13 commented 8 months ago

same here

hkey0 commented 8 months ago

same

zenodeapp commented 8 months ago

Sigh. I think my transaction caused this. I attempted to do a custom wasm tx with a serialized tx dump and I received this exact same error. It was around that time as well when I did this.

zenodeapp commented 8 months ago

Sigh. I think my transaction caused this. I attempted to do a custom wasm tx with a serialized tx dump and I received this exact same error. It was around that time as well when I did this.

Okay no wait, I'm not sure if it was mine. Not even sure how to properly check this.

gnosed commented 8 months ago

same

Pa1amar commented 8 months ago

same error

mrspir commented 8 months ago

same with block 11450

rllola commented 8 months ago

Looking at it now... It could be that they changed something for the transaction in 0.31.4

ValidatorVN commented 8 months ago

Stuck at height=10875

shurinov commented 8 months ago

same 11471 block commit 3ec0b294402e4e3e052350dda1c3d5425a7e4340

at /usr/local/cargo/registry/src/index.crates.io-6f17d22bba15001f/tendermint-rpc-0.34.0/src/client/transport/http.rs:163
    in namadexer::indexer::get_block with block_height: 11471

  2024-02-14T12:25:13.906405Z DEBUG hyper::client::pool: reuse idle connection for ("http", host.docker.internal:26657)
    at /usr/local/cargo/registry/src/index.crates.io-6f17d22bba15001f/hyper-0.14.28/src/client/pool.rs:254
    in namadexer::indexer::get_block with block_height: 11471

  2024-02-14T12:25:13.906423Z DEBUG hyper::proto::h1::io: flushed 285 bytes
    at /usr/local/cargo/registry/src/index.crates.io-6f17d22bba15001f/hyper-0.14.28/src/proto/h1/io.rs:340

  2024-02-14T12:25:13.906442Z ERROR namadexer::indexer: Closing block producer task due to an error saving last block: Invalid Transaction data
    at src/indexer/mod.rs:229

OpenTelemetry trace error occurred. Exporter jaeger encountered the following error(s): thrift agent failed on transportation layer, not open, Connection refused (os error 111)
OpenTelemetry trace error occurred. Exporter jaeger encountered the following error(s): thrift agent failed on transportation layer, not open, Connection refused (os error 111)
Error: InvalidTxData
zenodeapp commented 8 months ago

@rllola could you see which tx caused this?

I was doing transactions at that time that stated that I was missing TxData and right after adding a data-path with a serialized tx dump, the transaction went through but caused WasmErrors in the internal transaction saying invalid TxData. So feels like it might be caused by this. Though not sure how to back trace.

rllola commented 8 months ago

@zenodeapp I have the transaction ID : 05d5d5178675b1f929e5f9cf7938601571ddf3213cf10f939e04a2f516b94fff

I have the same error but we might have been too struct on check and we should just not raised an error when meeting unknown type of tx.

spidey-169 commented 8 months ago

Same here my indexer is stuck at block 11450. http://namada-indexer.spidey.services/block/last

rllola commented 8 months ago

Good news I have found the issue and I have a patch. Should be ready soon.

zenodeapp commented 8 months ago

@zenodeapp I have the transaction ID : 05d5d5178675b1f929e5f9cf7938601571ddf3213cf10f939e04a2f516b94fff

I have the same error but we might have been too struct on check and we should just not raised an error when meeting unknown type of tx.

Hmm, having difficulty finding out where this tx originated from: https://namada-rpc.zenode.app/block_results?height=11451 (finding it here and also via CLI).

I'll try to replicate what I did yesterday and see if it's the same.

zenodeapp commented 8 months ago

Yes, got it! Just a moment.

zenodeapp commented 8 months ago

To replicate:

namada tx --memo $MEMO --owner zen --node $ZEN_NAMADA_HTTP --code-path tx_bridge_pool.wasm

Result:

Enter your decryption password: 
Transaction added to mempool.
Wrapper transaction hash: 8919B814F82841312A412808539C243AD695CB942DCE27C3E3A648FF6C9F5EB4
Inner transaction hash: C0E813FA14195199C79FD845DA261D0D61DB0CEE0F036F5791E7A79F6CFCDC2E
Wrapper transaction accepted at height 15160. Used 21 gas.
Waiting for inner transaction result...
Transaction failed.
Details: {
  "inner_tx": null,
  "info": "Error trying to apply a transaction: Missing tx section: RuntimeError: unreachable\n    at <unnamed> (<module>[622]:0x534ad)\n    at <unnamed> (<module>[76]:0x1b976)\n    at <unnamed> (<module>[73]:0x1b7ba)\n    at <unnamed> (<module>[11]:0x12b72)\n    at <unnamed> (<module>[649]:0x5473a)",
  "log": "",
  "height": 15161,
  "hash": "C0E813FA14195199C79FD845DA261D0D61DB0CEE0F036F5791E7A79F6CFCDC2E",
  "code": "WasmRuntimeError",
  "gas_used": "3218"
}

May get solved over on this side, but might need to be prevented to get on-chain in the first place. Or handled appropriately. Like perhaps give it a special type of tx when invalid custom wasm transactions are made? Dunno, spitballing here.

Should probably refer the other team members to here.

zenodeapp commented 8 months ago

Good news I have found the issue and I have a patch. Should be ready soon.

Oh wow, I didn't see this. Awesome!

rllola commented 8 months ago

The fix has been merged. I tested it so hopefully I am closing this issue and we don't have to re-open it.

suntzu93 commented 8 months ago

Tried latest code but still got same issue , anyone passed it ?

ERROR namadexer::indexer: Closing block producer task due to an error saving last block: Invalid Transaction data
    at src/indexer/mod.rs:229

Error: InvalidTxData
msobh13 commented 8 months ago

I think you will have to reopen it again . the issue still the same . i tried new installtion with/without index. the funny thing is i have 2 servers one of them works and the other no . also i dropped the db and created new one same issue

StoneMac65 commented 8 months ago

I made a new and clean installation/ got stuck again

zenodeapp commented 8 months ago

@rllola Hey, so the issue isn't necessarily tied to just the bridge_pool tx. It's when creating invalid transactions (or actually in this case incomplete) via custom wasm code.

I may need to tag @Fraccaman. Think it perhaps shouldn't only be handled in the indexer but also in the SDK. But I could be wrong. Or a quick fix would be to find a common way to index "code": "WasmRuntimeError"-transactions?

namada tx --owner zen --code-path tx_bridge_pool.wasm is just one example, though one could also for instance do: namada tx --owner zen --code-path tx_bond.wasm and the same 'missing transaction' error appears.

Fraccaman commented 8 months ago

invalid transactions are still accepted by the ledger just rejected, ideally I would add another tx type called unknown and categorize unserializable txs there

HadesGuard commented 8 months ago

I still got the issue sir

mrspir commented 8 months ago

invalid transactions are still accepted by the ledger just rejected, ideally I would add another tx type called unknown and categorize unserializable txs there

This is best ideas, i have a same problems here

ERROR namadexer::indexer: Closing block producer task due to an error saving last block: Invalid Transaction data

Michel-Leidson commented 8 months ago

Same here.

ERROR namadexer::indexer: Closing block producer task due to an error saving last block: Invalid Transaction data