streamingfast / substreams

Powerful Blockchain streaming data engine, based on StreamingFast Firehose technology.
Apache License 2.0
159 stars 45 forks source link

Issues with determinism between production-mode and dev mode #225

Closed sduchesneau closed 1 year ago

sduchesneau commented 1 year ago

(Similar issues must be investigated when switching between wasmtime and wazero on feature/wazero branch)

Running the following commands show determinism issues:

SERVER-SIDE: from latest firehose-ethereum v1.4.3, pointing to eth-mainnet blocks fireeth start firehose --substreams-enabled=true --substreams-state-store-url=/tmp/states [...]

dev-mode: rm -rf /tmp/states && substreams run -e localhost:9000 --insecure https://github.com/streamingfast/substreams-uniswap-v3/releases/download/v0.2.7/substreams.spkg graph_out -t 12369800 | grep -vE '(^TraceID|all.done)' | jq -s '.[1]["@data"].entityChanges|.[0].entity' returns "Pool"

prod-mode: rm -rf /tmp/states && substreams run -e localhost:9000 --insecure https://github.com/streamingfast/substreams-uniswap-v3/releases/download/v0.2.7/substreams.spkg graph_out -t 12369800 --production-mode | grep -vE '(^TraceID|all.done)' | jq -s '.[1]["@data"].entityChanges|.[0].entity' returns "Transaction"

sduchesneau commented 1 year ago

Possibly linked, in feature/wazero branch, even when using wasmtime as the runtime:

SERVER-SIDE: from firehose-ethereum branch feature/wazero-parallel fireeth start firehose --substreams-enabled=true --substreams-state-store-url=/tmp/states [...]

dev-mode: rm -rf /tmp/states && substreams run -e localhost:9000 --insecure https://github.com/streamingfast/substreams-uniswap-v3/releases/download/v0.2.7/substreams.spkg graph_out -t 12369800 | grep -vE '(^TraceID|all.done)' | jq -s '.[1]["@data"].entityChanges|.[0].entity' returns "PoolDayData"

(this is different than both values from the v1.4.3 branch)

sduchesneau commented 1 year ago

This has been fixed in feature/wazero branch. Merging to develop soon.

sduchesneau commented 1 year ago

Fixed https://github.com/streamingfast/substreams/pull/229