Skip to content

Comments

fix: L1 gas prices subscription#3193

Closed
vbar wants to merge 3 commits intomainfrom
vbar/gas-prices-sync-unit-test
Closed

fix: L1 gas prices subscription#3193
vbar wants to merge 3 commits intomainfrom
vbar/gas-prices-sync-unit-test

Conversation

@vbar
Copy link
Contributor

@vbar vbar commented Jan 16, 2026

Fixes sync_gas_prices getting stuck on historical data, ignoring subscribed updates.

The sync_gas_prices function often failed to update L1GasPriceProvider, because L1GasPriceProvider expects its samples to be added in sequential block order, and sync_gas_prices tries twice, possibly with a gap in between.

@vbar vbar requested a review from a team as a code owner January 16, 2026 12:05
}
}
})
.await?;
Copy link
Contributor

Choose a reason for hiding this comment

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

Hmm, I'm not quite sure I understand this.

Isn't ethereum.subscribe_block_headers(_).await? expected to ~never return unless an error occurs?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Hmm, yes - which would mean the code after it is just dead...

Copy link
Contributor Author

Choose a reason for hiding this comment

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

@kkovaacs
Copy link
Contributor

Maybe we should wait for some input from @t00ts before going on with this one.

As far as I understand the initial idea was something like this:

  • Fetch "historical" price data from the starting block in the config.
  • Then subscribe to block headers (you don't get historical headers here).

This is meant to ensure that we do have price data starting from a point in history. Removing fetching of historical prices changes this code significantly and I'm not absolutely convinced that we don't need that.

@vbar
Copy link
Contributor Author

vbar commented Jan 20, 2026

This is meant to ensure that we do have price data starting from a point in history. Removing fetching of historical prices changes this code significantly and I'm not absolutely convinced that we don't need that.

Yes - upon reflection, if the retrieval of historical prices cannot be before the subscription, and it cannot be after it, it could still be inside...

@vbar
Copy link
Contributor Author

vbar commented Jan 20, 2026

Superseded by #3197 .

@vbar vbar closed this Jan 20, 2026
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

Successfully merging this pull request may close these issues.

2 participants