BREAKING CHANGES
Project rename
- The binary name has changed from
sfethtofireeth(aligned with https://firehose.streamingfast.io/references/naming-conventions) - The repo name has changed from
sf-ethereumtofirehose-ethereum
Ethereum V2 blocks (with fh2-instrumented nodes)
- This will require reprocessing the chain to produce new blocks
- Protobuf Block model is now tagged
sf.ethereum.type.v2and contains the following improvements:- Fixed Gas Price on dynamic transactions (post-London-fork on ethereum mainnet, EIP-1559)
- Added "Total Ordering" concept, 'Ordinal' field on all events within a block (trx begin/end, call, log, balance change, etc.)
- Added TotalDifficulty field to ethereum blocks
- Fixed wrong transaction status for contract deployments that fail due to out of gas on pre-Homestead transactions (aligned with status reported by chain: SUCCESS -- even if no contract code is set)
- Added more instrumentation around AccessList and DynamicFee transaction, removed some elements that were useless or could not be derived from other elements in the structure, ex: gasEvents
- Added support for finalized block numbers (moved outside the proto-ethereum block, to firehose bstream v2 block)
- There are no more "forked blocks" in the merged-blocks bundles:
- The merged-blocks are therefore produced only after finality passed (before The Merge, this means after 200 confirmations).
- One-block-files close to HEAD stay in the one-blocks-store for longer
- The blocks that do not make it in the merged-blocks (forked out because of a re-org) are uploaded to another store (common-forked-blocks-store-url) and kept there for a while (to allow resolving cursors)
Firehose V2 Protocol
- This will require changes in most firehose clients
- A compatibility layer has been added to still support
sf.firehose.v1.Stream/Blocksbut only for specific values for 'ForkSteps' in request: 'irreversible' or 'new+undo' - The Firehose Blocks protocol is now under
sf.firehose.v2(bumped fromsf.firehose.v1).- Step type
IRREVERSIBLErenamed toFINAL Blocksrequest now only allows 2 modes regarding steps:NEW,UNDOandFINAL(gated by thefinal_blocks_onlyboolean flag)- Blocks that are sent out can have the combined step
NEW+FINALto prevent sending the same blocks over and over if they are already final
- Step type
Block Indexes
- Removed the Irreversible indices completely (because the merged-blocks only contain final blocks now)
- Deprecated the "Call" and "log" indices (
xxxxxxxxxx.yyy.calladdrsig.idxandxxxxxxxxxx.yyy.logaddrsig.idx), now replaced by "combined" index - Moved out the
sfeth tools generate-...command to a new app that can be launched withsfeth start generate-combined-index[,...]
Flags and environment variables
- All config via environment variables that started with
SFETH_now starts withFIREETH_ - All logs now output on stderr instead of stdout like previously
- Changed
config-filedefault from./sf.yamlto"", preventing failure without this flag. - Renamed
common-blocks-store-urltocommon-merged-blocks-store-url - Renamed
common-oneblock-store-urltocommon-one-block-store-urlnow used by firehose and relayer apps - Renamed
common-blockstream-addrtocommon-live-blocks-addr - Renamed the
mindreaderapplication toreader - Renamed all the
mindreader-node-*flags toreader-node-* - Added
common-forked-blocks-store-urlflag used by merger and firehose - Changed
--log-to-filedefault fromtruetofalse - Changed default verbosity level: now all loggers are
INFO(instead of having most of them toWARN).-vwill now activate allDEBUGlogs - Removed
common-block-index-sizes,common-index-store-url - Removed
merger-state-file,merger-next-exclusive-highest-block-limit,merger-max-one-block-operations-batch-size,merger-one-block-deletion-threads,merger-writers-leeway - Added
merger-stop-block,merger-prune-forked-blocks-after,merger-time-between-store-pruning - Removed
mindreader-node-start-block-num,mindreader-node-wait-upload-complete-on-shutdown,mindreader-node-merge-and-store-directly,mindreader-node-merge-threshold-block-age - Removed
firehose-block-index-sizes,firehose-block-index-sizes,firehose-irreversible-blocks-index-bundle-sizes,firehose-irreversible-blocks-index-url,firehose-realtime-tolerance - Removed
relayer-buffer-size,relayer-merger-addr,relayer-min-start-offset
MIGRATION
Clients
- If you depend on the proto file, update
import "sf/ethereum/type/v1/type.proto"toimport "sf/ethereum/type/v2/type.proto" - If you depend on the proto file, update all occurrences of
sf.ethereum.type.v1.<Something>tosf.ethereum.type.v2.<Something> - If you depend on
sf-ethereum/typesas a library, update all occurrences ofgithub.com/streamingfast/firehose-ethereum/types/pb/sf/ethereum/type/v1togithub.com/streamingfast/firehose-ethereum/types/pb/sf/ethereum/type/v2.
Server-side
Deployment
- The
readerrequires Firehose-instrumented Geth binary with instrumentation version 2.x (taggedfh2) - Because of the changes in the ethereum block protocol, an existing deployment cannot be migrated in-place.
- You must deploy firehose-ethereum v1.0.0 on a new environment (without any prior block or index data)
- You can put this new deployment behind a GRPC load-balancer that routes
/sf.firehose.v2.Stream/*and/sf.firehose.v1.Stream/*to your different versions. - Go through the list of changed "Flags and environment variables" and adjust your deployment accordingly.
- Determine a (shared) location for your
forked-blocks. - Make sure that you set the
one-block-storeandforked-blocks-storecorrectly on all the apps that now require it. - Add the
generate-combined-indexapp to your new deployment instead of thetoolscommand for call/logs indices.
- Determine a (shared) location for your
- If you want to reprocess blocks in batches while you set up a "live" deployment:
- run your reader node from prior data (ex: from a snapshot)
- use the
--common-first-streamable-blockflag to a 100-block-aligned boundary right after where this snapshot starts (use this flag on all apps) - perform batch merged-blocks reprocessing jobs
- when all the blocks are present, set the
common-first-streamable-blockflag to 0 on your deployment to serve the whole range
Producing merged-blocks in batch
- The
readerrequires Firehose-instrumented Geth binary with instrumentation version 2.x (taggedfh2) - The
readerdoes NOT merge block files directly anymore: you need to run it alongside amerger:- determine a
startandstopblock for your reprocessing job, aligned on a 100-blocks boundary right after your Geth data snapshot - set
--common-first-streamable-blockto your start-block - set
--merger-stop-blockto your stop-block - set
--common-one-block-store-urlto a local folder accessible to bothmergerandmindreaderapps - set
--common-merged-blocks-store-urlto the final (ex: remote) folder where you will store your merged-blocks - run both apps like this
fireeth start reader,merger --...
- determine a
- You can run as many batch jobs like this as you like in parallel to produce the merged-blocks, as long as you have data snapshots for Geth that start at this point
Producing combined block indices in batch
- Run batch jobs like this:
fireeth start generate-combined-index --common-blocks-store-url=/path/to/blocks --common-index-store-url=/path/to/index --combined-index-builder-index-size=10000 --combined-index-builder-start-block=0 [--combined-index-builder-stop-block=10000] --combined-index-builder-grpc-listen-addr=:9000
Other (non-breaking) changes
Added tools and apps
- Added
tools firehose-clientcommand with filter/index options - Added
tools normalize-merged-blockscommand to remove forked blocks from merged-blocks files (cannot transform ethereum blocks V1 into V2 because some fields are missing in V1) - Added substreams server support in firehose app (alpha) through
--substreams-enabledflag
Various
- The firehose GRPC endpoint now supports requests that are compressed using
gziporzstd - The merger does not expose
PreMergedBlocksendpoint over GRPC anymore, only HealthCheck. (relayer does not need to talk to it) - Automatically setting the flag
--firehose-genesis-fileonreadernodes if theirreader-node-bootstrap-data-urlconfig value is sets to agenesis.jsonfile. - Note to other Firehose implementors: we changed all command line flags to fit the required/optional format referred to here: https://en.wikipedia.org/wiki/Usage_message
- Added prometheus boolean metric to all apps called 'ready' with label 'app' (firehose, merger, mindreader-node, node, relayer, combined-index-builder)