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

fix(starknet_gateway): convert mempool errors to the correct gw error #2995

Merged
merged 1 commit into from
Jan 1, 2025

Conversation

yair-starkware
Copy link
Contributor

No description provided.

@reviewable-StarkWare
Copy link

This change is Reviewable

Copy link
Contributor Author

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

@yair-starkware yair-starkware marked this pull request as ready for review December 29, 2024 09:44
Copy link

graphite-app bot commented Dec 29, 2024

Graphite Automations

"Yair - Auto-assign" took an action on this PR • (12/29/24)

1 assignee was added to this PR based on Yair's automation.

@yair-starkware
Copy link
Contributor Author

crates/starknet_gateway/src/errors.rs line 99 at r1 (raw file):

                    // mempool clients.
                    unreachable!("Unexpected mempool error in gateway context: {}", mempool_error);
                }

@giladchase @ShahakShama
Please approve that P2pPropagatorClientError & TransactionNotFound are not supposed to happen in any GW flow to your best knowledge.

Code quote:

                MempoolError::P2pPropagatorClientError { .. }
                | MempoolError::TransactionNotFound { .. } => {
                    // These errors are not expected to happen within the gateway, only from other
                    // mempool clients.
                    unreachable!("Unexpected mempool error in gateway context: {}", mempool_error);
                }

Copy link
Collaborator

@alonh5 alonh5 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 2 files at r1, all commit messages.
Reviewable status: all files reviewed, 2 unresolved discussions (waiting on @giladchase, @ShahakShama, and @yair-starkware)


crates/starknet_gateway/src/errors.rs line 81 at r1 (raw file):

}

pub fn mempool_client_err_to_gw_spec_err(value: MempoolClientError) -> GatewaySpecError {

Can this be a From impl?

@yair-starkware
Copy link
Contributor Author

crates/starknet_gateway/src/errors.rs line 81 at r1 (raw file):

Previously, alonh5 (Alon Haramati) wrote…

Can this be a From impl?

No, because neither MempoolClientError nor GatewaySpecError are defined in our crate

Copy link
Collaborator

@alonh5 alonh5 left a comment

Choose a reason for hiding this comment

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

:lgtm:

Reviewable status: all files reviewed, 1 unresolved discussion (waiting on @giladchase and @ShahakShama)


crates/starknet_gateway/src/errors.rs line 99 at r1 (raw file):

Previously, yair-starkware (Yair) wrote…

@giladchase @ShahakShama
Please approve that P2pPropagatorClientError & TransactionNotFound are not supposed to happen in any GW flow to your best knowledge.

TransactionNotFound can't happen in the add_tx flow AFAICT. @ShahakShama Can you confirm for P2pPropagatorClientError?

Copy link
Contributor

@ShahakShama ShahakShama 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: all files reviewed, 1 unresolved discussion (waiting on @giladchase)


crates/starknet_gateway/src/errors.rs line 99 at r1 (raw file):

Previously, alonh5 (Alon Haramati) wrote…

TransactionNotFound can't happen in the add_tx flow AFAICT. @ShahakShama Can you confirm for P2pPropagatorClientError?

It can happen. I'll create a PR to change it so that it can't happen

Copy link
Contributor

@ShahakShama ShahakShama 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: all files reviewed, 1 unresolved discussion (waiting on @giladchase)


crates/starknet_gateway/src/errors.rs line 99 at r1 (raw file):

Previously, ShahakShama wrote…

It can happen. I'll create a PR to change it so that it can't happen

After #3001 is merged it can't happen

Copy link
Contributor Author

@yair-starkware yair-starkware 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: 0 of 2 files reviewed, 1 unresolved discussion (waiting on @alonh5 and @giladchase)


crates/starknet_gateway/src/errors.rs line 99 at r1 (raw file):

Previously, ShahakShama wrote…

After #3001 is merged it can't happen

Converted the error to a warning

@yair-starkware
Copy link
Contributor Author

crates/starknet_gateway/src/errors.rs line 99 at r1 (raw file):

Previously, yair-starkware (Yair) wrote…

Converted the error to a warning

As we talked in slack

Copy link
Collaborator

@alonh5 alonh5 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 2 files at r2, all commit messages.
Reviewable status: all files reviewed, 1 unresolved discussion (waiting on @giladchase and @yair-starkware)


crates/starknet_gateway/src/errors.rs line 81 at r2 (raw file):

}

pub fn mempool_client_result_to_gw_spec_result(

Add a short doc?

Copy link
Contributor Author

@yair-starkware yair-starkware 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: all files reviewed, 1 unresolved discussion (waiting on @alonh5 and @giladchase)


crates/starknet_gateway/src/errors.rs line 81 at r2 (raw file):

Previously, alonh5 (Alon Haramati) wrote…

Add a short doc?

Done.

@yair-starkware yair-starkware force-pushed the yair/fix_mempool_error branch from ef157e6 to 8711296 Compare January 1, 2025 09:53
Copy link
Collaborator

@alonh5 alonh5 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 2 files at r3, all commit messages.
Reviewable status: :shipit: complete! all files reviewed, all discussions resolved (waiting on @giladchase)

@yair-starkware yair-starkware added this pull request to the merge queue Jan 1, 2025
Merged via the queue into main with commit 3563c1c Jan 1, 2025
8 checks passed
@github-actions github-actions bot locked and limited conversation to collaborators Jan 3, 2025
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants