Skip to content

Detect blockchain node is on a fork when it's obvious #399

@james-toussaint

Description

@james-toussaint

Forks happen regularly on Goerli.

A deal/task can immediately go off-chain to a contribution timeout status if the contribution timeout value read on the blockchain was 0 (1970-01-01).
eg.: https://core.dev-pool.goerli.iex.ec/tasks/0xa4d31e17e8e55aa70a4a17c3c05a2832983f815b10adaba190e2a5d038e54a2b
contributionDeadline":"1970-01-01"

With latest code:


the task won't be added at all.

Nevertheless, if a deal has been received (meaning the task exists) while the on-chain contributionTimeout is 0, it is very likely the blockchain node is on a fork. In this case, we might be able to detect it and schedule a re-read until the blockchain node is on the right fork again.

Note: The case where we first received a deal on a fork which isn't the mainchain anymore (couple blocks after) is (probably?) less likely.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions