Skip to content

apollo_l1_provider: add handling for TransactionConsumed event #7677

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

Open
wants to merge 1 commit into
base: 05-14-refactor_apollo_l1_provider_types_change_event_transactionconsumed_to_hold_tx_hash
Choose a base branch
from

Conversation

AlonLStarkWare
Copy link
Contributor

No description provided.

@reviewable-StarkWare
Copy link

This change is Reviewable

Copy link
Contributor Author

AlonLStarkWare commented Jul 1, 2025

This stack of pull requests is managed by Graphite. Learn more about stacking.

@AlonLStarkWare AlonLStarkWare requested a review from giladchase July 1, 2025 07:25
@AlonLStarkWare AlonLStarkWare marked this pull request as ready for review July 1, 2025 07:25
@AlonLStarkWare AlonLStarkWare force-pushed the 05-14-refactor_apollo_l1_provider_types_change_event_transactionconsumed_to_hold_tx_hash branch from 8df63df to c439902 Compare July 1, 2025 07:34
@AlonLStarkWare AlonLStarkWare force-pushed the 06-30-apollo_l1_provider_add_handling_for_transactionconsumed_event branch from 22e7a2b to 6ce36f4 Compare July 1, 2025 07:34
@AlonLStarkWare AlonLStarkWare force-pushed the 05-14-refactor_apollo_l1_provider_types_change_event_transactionconsumed_to_hold_tx_hash branch from c439902 to d3f152c Compare July 1, 2025 07:36
@AlonLStarkWare AlonLStarkWare force-pushed the 06-30-apollo_l1_provider_add_handling_for_transactionconsumed_event branch 4 times, most recently from 538e438 to 0756c83 Compare July 1, 2025 10:00
Copy link
Contributor

@guy-starkware guy-starkware left a comment

Choose a reason for hiding this comment

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

Reviewed 3 of 5 files at r1, all commit messages.
Reviewable status: 3 of 5 files reviewed, 1 unresolved discussion (waiting on @giladchase)


crates/apollo_l1_provider/src/transaction_manager.rs line 317 at r1 (raw file):

        }

        self.records.remove(tx_hash)

This returns true if it succeeds?

Copy link
Contributor Author

@AlonLStarkWare AlonLStarkWare left a comment

Choose a reason for hiding this comment

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

Reviewable status: 3 of 5 files reviewed, 1 unresolved discussion (waiting on @giladchase and @guy-starkware)


crates/apollo_l1_provider/src/transaction_manager.rs line 317 at r1 (raw file):

Previously, guy-starkware wrote…

This returns true if it succeeds?

yep

Copy link
Contributor

@guy-starkware guy-starkware left a comment

Choose a reason for hiding this comment

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

Reviewed 2 of 5 files at r1.
Reviewable status: :shipit: complete! all files reviewed, all discussions resolved (waiting on @giladchase)

@AlonLStarkWare AlonLStarkWare force-pushed the 05-14-refactor_apollo_l1_provider_types_change_event_transactionconsumed_to_hold_tx_hash branch from d3f152c to a1ea388 Compare July 2, 2025 11:30
@AlonLStarkWare AlonLStarkWare force-pushed the 06-30-apollo_l1_provider_add_handling_for_transactionconsumed_event branch from 0756c83 to 8fde2ec Compare July 2, 2025 11:30
Copy link
Contributor

@giladchase giladchase left a comment

Choose a reason for hiding this comment

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

Just to verify: are you certain that the requirement was to delete the tx on consumption?

I think Lior mentioned that he doesn't want to delete txs at this point. even at the cost of an increasingly bloaty memory, given how few l1 handlers we actually get, just so we'll have some record of it passing through.

Reviewed 2 of 5 files at r1, all commit messages.
Reviewable status: :shipit: complete! all files reviewed, all discussions resolved (waiting on @AlonLStarkWare)


crates/apollo_l1_provider/src/transaction_manager.rs line 282 at r1 (raw file):

    pub(crate) fn consume_tx(&mut self, tx_hash: &TransactionHash) -> bool {
        let Some(record) = self.records.get(tx_hash) else {
            warn!("Attempted to consume unknown transaction: {tx_hash:?}");

This is not necessarily a warning, it can happen shortly after starting up, where an old tx is consumed from before the point we started scraping.
Make sure to have this case present in a unit tests, and convert to debug print with a message explaining this case, so in case it happens ppl won't be alarmed, it's part of a possible happy flow

Code quote:

            warn!("Attempted to consume unknown transaction: {tx_hash:?}");

crates/apollo_l1_provider/src/l1_scraper.rs line 121 at r1 (raw file):

                L1Event::LogMessageToL2 { l1_tx_hash, .. } => Some(*l1_tx_hash),
                L1Event::ConsumedMessageToL2(event_data) => {
                    debug!("Consumed message on L1 with event_data: {event_data:?}");

tx_hash

Code quote:

                L1Event::ConsumedMessageToL2(event_data) => {
                    debug!("Consumed message on L1 with event_data: {event_data:?}");

Copy link

github-actions bot commented Aug 2, 2025

There hasn't been any activity on this pull request recently, and in order to prioritize active work, it has been marked as stale.
This PR will be closed and locked in 7 days if no further activity occurs.
Thank you for your contributions!

@github-actions github-actions bot added the stale label Aug 2, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants