Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
jeremyjams opened this issue Mar 10, 2021 · 0 comments
Open

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

jeremyjams opened this issue Mar 10, 2021 · 0 comments

Comments

@jeremyjams
Copy link
Member

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant