safe-global / safe-docs

Developer Docs for building on Safe.
https://docs.safe.global
MIT License
51 stars 70 forks source link

Documentation re: Nethermind #434

Open svanegmond opened 6 months ago

svanegmond commented 6 months ago

Describe the bug

Nethermind requires additional settings to work with Safe beyond the requirement for an archive node.

To Reproduce

  1. Sync a Nethermind host to the Shyft chain.
  2. Attempt to fetch a transaction older than 2.35M blocks with eth_getTransactionByHash

The issue is the setting Receipt.TxLookupLimit. It is documented like this:

The number of recent blocks to maintain transaction index for. 0 to never remove indices, -1 to never index. Defaults to 2350000.

I confirmed on the Nethermind discord:

is it right that a receipt being purged should cause getTransactionByHash to deny the existence of the tx? It can still be observed by fetching the block it’s contained in.

Nethermind dev replied:

Hi, it just does not save all of the txhash -> block mapping which take up a lof of space.

I have filed a feature request to cause the TxLookupLimit to be 0 when pruning is disabled. We'll see if they agree. Meantime, can you document that Receipt.TxLookupLimit must be set to 0 in order to be able to index "old" transactions?

svanegmond commented 6 months ago

the documentation page I'm talking about is here - https://docs.safe.global/advanced/api-rpc-requirements

svanegmond commented 6 months ago

Ok. My point of pointing all this out is that if you start a Safe instance and begin using Safe, it will work. If you start to commission a Safe instance a few million blocks after beginning to use Safe, it will forever be stuck (with few useful log outputs) trying to obtain transactions it can never obtain.

For ongoing operations, sure, turn off full archive, but it needs to be on for initial scan to succeed.

svanegmond commented 6 months ago

This appears to be chatGPT.

I know what the problem is.

This bug is giving suggestions to improve the documentation.

Uxio0 commented 5 months ago

Feel free to send a PR to safe-docs