Eric
Eric

Reputation: 24890

Ethereum, which syncmode to use, fast or full?

There is a geth program running, and provide --rpc service.

What the service do:

Currently we are using full mode, but it's a bit slow, and takes more disk space.


Questions


(I asked another question about ethereum on Ethereum site, if you are interested could you also take a look: https://ethereum.stackexchange.com/questions/78293/how-to-migrate-geths-data)

Upvotes: 4

Views: 10164

Answers (1)

aliras
aliras

Reputation: 424

full sync downloads all blocks of the blockchain and replays all transactions that ever happened. While doing so, it stores the receipts of transactions and continuously updates the state database.

fast sync does not replay transactions. This quote from the fast sync pull request describes it well (You can also find additional information there).

Instead of processing the entire block-chain one link at a time, and replay all transactions that ever happened in history, fast syncing downloads the transaction receipts along the blocks, and pulls an entire recent state database.

Note that it also downloads receipts so historical data can be queried.


  • Is fast mode enough for above usage?

    fast sync is used only for initially getting the blockchain. After the fast sync process ended, your node acts just as a full synced node. Since a fast synced node also has all the historical data, it is suitable for your use-case.

  • Which is better?

    Depends on. In case of full sync, you need processing power, while in the other case, you need bandwidth.

  • If we switch from full mode to fast mode, will geth have to re-download all the years of history? Or, it will reuse the history?

    For security reasons, you can not switch the sync mode of an already running node.

Upvotes: 12

Related Questions