Skip to content

EthereumRegistryWriter: onCidAdded restart resiliency #954

@lautarodragan

Description

@lautarodragan

Currently if EthereumRegistryWriter is restarted after an addCid transaction has been sent to geth but before the associated cidAdded event is picked up, that event will never be picked up, since EthereumRegistryWriter always starts listening to cidAdded events from the latest block geth has seen.

This can be solved by indexing onCidAdded.blockNumber in the db, pick up the highest onCidAdded.blockNumber on startup and passing that to fromBlock.

const fromBlock = await db. // some aggregate `sum` function or sort by and findOne
const onCidAddedPromievent = await ethereumRegistryContract.onCidAdded({ fromBlock }, handleEventError)

The chances of this happening are probably slim so not the highest priority at the moment.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions