Skip to content
This repository was archived by the owner on Oct 19, 2024. It is now read-only.

feature: first draft timelag middleware #457

Merged
merged 6 commits into from
Sep 17, 2021
Merged

feature: first draft timelag middleware #457

merged 6 commits into from
Sep 17, 2021

Conversation

prestwich
Copy link
Collaborator

Provides a TimeLag middleware that offsets tip-related requests by a constant parameter K

e.g. TimelagMiddleware<M, 60> will modify eth_call, eth_getBlockNumber and other related parameters to use the current chain tip - 60 blocks

This provides a modicum of protection from reorgs

Please review

  • did I miss any requests that ought to be modified?
  • is the Unsupported behavior reasonable?
  • thoughts on the approach?
  • double-check normalization logic

ethers_providers::FilterWatcher<'_, Self::Provider, ethers_core::types::TxHash>,
Self::Error,
> {
Err(TimeLagError::Unsupported)
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think Unsupported is fine, curious what others think

@gakonst gakonst merged commit 57736ed into master Sep 17, 2021
@gakonst gakonst deleted the prestwich/timelag branch September 17, 2021 17:38
# for free to subscribe to this conversation on GitHub. Already have an account? #.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants