Skip to content

Conversation

@t00ts
Copy link
Contributor

@t00ts t00ts commented Dec 30, 2025

(Self-explanatory title)

This is part of #3160.

My goal overall is to have an always-running background task that continuously fetches and updates gas price data. As I move forward in integration, I might (will surely try to) merge this with our current L1 sync task to avoid bloating our runtime with yet another task, but for now, I really wanted to just get this done as an independent method.

I've run some manual tests on this method and it appears to work as expected.

@t00ts t00ts force-pushed the t00ts/ethereum-get_block_header branch from 45e5954 to 6a95af3 Compare December 30, 2025 08:54
@t00ts t00ts marked this pull request as ready for review December 30, 2025 09:41
@t00ts t00ts requested a review from a team as a code owner December 30, 2025 09:41
@t00ts t00ts force-pushed the t00ts/ethereum-get_block_header branch from 7a065b7 to 1aa951d Compare December 30, 2025 09:58
@t00ts
Copy link
Contributor Author

t00ts commented Dec 30, 2025

Update: I also made get_finalized_block_number public as I think I'll need it later.

Copy link
Contributor

@kkovaacs kkovaacs left a comment

Choose a reason for hiding this comment

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

Was wondering how we're going to use these...

If the goal is a background task that's fetching information from L1 then re-creating the Websocket connection seems quite a big overhead.

I was wondering if we could structure this similarly how we're fetching starknet core contract logs from Ethereum now:

  • have a background task polling the latest finalized block
  • have a subscription for blocks (provider.subscribe_blocks()) that stores not-yet-finalized block headers in memory

@t00ts
Copy link
Contributor Author

t00ts commented Dec 30, 2025

I am well aware of this design issue and will address it in an upcoming PR.

Regardless of how we use this, the EthereumClient will keep a persistent connection that will be used for all methods.

@kkovaacs

@vbar
Copy link
Contributor

vbar commented Dec 30, 2025

Was wondering how we're going to use these...

If the goal is a background task that's fetching information from L1 then re-creating the Websocket connection seems quite a big overhead.

IMHO we should get a better idea what information will be needed, first. Looking at https://github.com/starkware-libs/sequencer/tree/main/crates/apollo_l1_gas_price , it only needs the prices every 15 minutes (yes, the interval is configurable, but surely there's some expected range), and more than that is hard to say, because it gets the going rate from some separate oracle (which I couldn't find in the repo but again, we can ask) - if Starkware plans to run that oracle publicly, we could just reuse it...

@t00ts
Copy link
Contributor Author

t00ts commented Jan 6, 2026

Design issue was addressed in #3164

Will revisit the gas price related stuff in a future PR. Closing for now.

@t00ts t00ts closed this Jan 6, 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.

4 participants