MetaMask / eth-block-tracker

A JS module for keeping track of the latest Ethereum block by polling an ethereum provider
MIT License
132 stars 81 forks source link

Regression in v10.1.0 #258

Closed legobeat closed 3 months ago

legobeat commented 3 months ago

@metamask/eth-block-tracker v10.1.0 is causing a regression noticed in CI for @metamask/eth-json-rpc-filters: https://github.com/MetaMask/eth-json-rpc-filters/pull/176#issuecomment-2240913555

Error: PollingBlockTracker - encountered an error while attempting to update latest block:
TypeError: this._provider.request is not a function
    at PollingBlockTracker._fetchLatestBlock (/home/runner/work/eth-json-rpc-filters/eth-json-rpc-filters/node_modules/@metamask/eth-block-tracker/src/PollingBlockTracker.ts:275:43)
    at PollingBlockTracker._updateLatestBlock (/home/runner/work/eth-json-rpc-filters/eth-json-rpc-filters/node_modules/@metamask/eth-block-tracker/src/PollingBlockTracker.ts:258:36)
    at PollingBlockTracker._updateAndQueue (/home/runner/work/eth-json-rpc-filters/eth-json-rpc-filters/node_modules/@metamask/eth-block-tracker/src/PollingBlockTracker.ts:292:18)
    at PollingBlockTracker._start (/home/runner/work/eth-json-rpc-filters/eth-json-rpc-filters/node_modules/@metamask/eth-block-tracker/src/PollingBlockTracker.ts:249:10)
    at PollingBlockTracker._maybeStart (/home/runner/work/eth-json-rpc-filters/eth-json-rpc-filters/node_modules/@metamask/eth-block-tracker/src/PollingBlockTracker.ts:166:10)
    at PollingBlockTracker._onNewListener (/home/runner/work/eth-json-rpc-filters/eth-json-rpc-filters/node_modules/@metamask/eth-block-tracker/src/PollingBlockTracker.ts:146:12)
    at safeApply (/home/runner/work/eth-json-rpc-filters/eth-json-rpc-filters/node_modules/@metamask/safe-event-emitter/index.ts:10:13)
    at PollingBlockTracker.emit (/home/runner/work/eth-json-rpc-filters/eth-json-rpc-filters/node_modules/@metamask/safe-event-emitter/index.ts:63:7)
    at _addListener (node:events:560:14)
    at PollingBlockTracker.addListener (node:events:609:10)
    at PollingBlockTracker.once (node:events:653:8)
    at /home/runner/work/eth-json-rpc-filters/eth-json-rpc-filters/test/util.js:50:50
    at new Promise (<anonymous>)
    at Object.trackNextBlock (/home/runner/work/eth-json-rpc-filters/eth-json-rpc-filters/test/util.js:50:12)
    at deployLogEchoContract (/home/runner/work/eth-json-rpc-filters/eth-json-rpc-filters/test/util.js:149:15)
    at processTicksAndRejections (node:internal/process/task_queues:95:5)
    at PollingBlockTracker._updateAndQueue (/home/runner/work/eth-json-rpc-filters/eth-json-rpc-filters/node_modules/@metamask/eth-block-tracker/src/PollingBlockTracker.ts:294:22)
    at processTicksAndRejections (node:internal/process/task_queues:95:5)
Error: PollingBlockTracker - encountered an error while attempting to upda
mcmire commented 3 months ago

@kanthesha and I have deprecated 10.1.0, marked the change in #252 as a breaking change, and re-released it as 11.0.0.