trufflesuite / drizzle-legacy

Reactive Ethereum datastore for dapp UIs.
http://truffleframework.com/docs/drizzle/getting-started
MIT License
503 stars 128 forks source link

Potential error in polling #203

Closed cds-amal closed 5 years ago

cds-amal commented 5 years ago

The current implementation of polling in Drizzle may skip blocks.

Drizzle uses eth-block-tracker-es5 ver ^2.32 and subscribes to its BlockTracker's latest event. This can potentially skip a block if multiple blocks were generated within the polling period.

It may effect test blockchains where blocktimes are short

Relevant doc.

The latest event is emitted for every that is detected to be the latest block. This means skipping a block if there were two created since the last polling period. Use this event if you don't care about stale blocks.

Note: eth-block-tracker-es6 has evolved to version 4 and is another package currently maintained by MetaMask.