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

feat(starknet_integration_tests): use monitoring instead of reading storage #3755

Merged
merged 1 commit into from
Jan 30, 2025

Conversation

yair-starkware
Copy link
Contributor

No description provided.

@reviewable-StarkWare
Copy link

This change is Reviewable

Copy link

graphite-app bot commented Jan 28, 2025

Graphite Automations

"Yair - Auto-assign" took an action on this PR • (01/28/25)

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

Copy link
Contributor

@Itay-Tsabary-Starkware Itay-Tsabary-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 4 files reviewed, 4 unresolved discussions (waiting on @alonh5, @nadin-Starkware, and @yair-starkware)


crates/starknet_integration_tests/src/sequencer_manager.rs line 338 at r1 (raw file):

/// Gets the latest block number from the batcher's metrics.
async fn get_latest_block_number(batcher_monitoring_client: &MonitoringClient) -> BlockNumber {

This is not the batcher's monitoring client, but the node's. Please rephrase accordingly (throughout).

Code quote:

batcher_monitoring_client: &MonitoringClient

crates/starknet_integration_tests/src/sequencer_manager.rs line 352 at r1 (raw file):

async fn get_account_nonce(
    batcher_monitoring_client: &MonitoringClient,
    storage_reader: &StorageReader,

Do you plan on addressing this as well? If so, please add a todo.

Code quote:

storage_reader: &StorageReader,

crates/starknet_integration_tests/src/sequencer_manager.rs line 355 at r1 (raw file):

    contract_address: ContractAddress,
) -> Nonce {
    let block_number = get_latest_block_number(batcher_monitoring_client).await;

WDYT about renaming this fn? The current context was with the batcher storage reader, hence this implied we are referring to the batcher block height. However, and following the previous comment, the fn name no longer indicates the block we are referring to.

Code quote:

get_latest_block_number

crates/starknet_integration_tests/src/sequencer_manager.rs line 363 at r1 (raw file):

}

/// Sample a storage until sufficiently many blocks have been stored. Returns an error if after

Please update.

Code quote:

Sample a storage until sufficiently many blocks have been stored.

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 4 files reviewed, 4 unresolved discussions (waiting on @alonh5, @Itay-Tsabary-Starkware, and @nadin-Starkware)


crates/starknet_integration_tests/src/sequencer_manager.rs line 338 at r1 (raw file):

Previously, Itay-Tsabary-Starkware wrote…

This is not the batcher's monitoring client, but the node's. Please rephrase accordingly (throughout).

It's the executable that contains the batcher, do we call each executable a node?


crates/starknet_integration_tests/src/sequencer_manager.rs line 352 at r1 (raw file):

Previously, Itay-Tsabary-Starkware wrote…

Do you plan on addressing this as well? If so, please add a todo.

I'm not sure, this is not something that we can get from monitoring, we need RPC for this - @alonh5


crates/starknet_integration_tests/src/sequencer_manager.rs line 355 at r1 (raw file):

Previously, Itay-Tsabary-Starkware wrote…

WDYT about renaming this fn? The current context was with the batcher storage reader, hence this implied we are referring to the batcher block height. However, and following the previous comment, the fn name no longer indicates the block we are referring to.

The function is still returning the same block number it returned before thanks to the call to prev.
IIUC, your suggestion is to change that and fix all the callers?
If so, I will do it in a separate PR.


crates/starknet_integration_tests/src/sequencer_manager.rs line 363 at r1 (raw file):

Previously, Itay-Tsabary-Starkware wrote…

Please update.

Done.

@yair-starkware yair-starkware force-pushed the yair/e2e_use_monitoring branch 2 times, most recently from 0b1ddb0 to 6e6bc62 Compare January 28, 2025 11:30
Copy link
Contributor

@Itay-Tsabary-Starkware Itay-Tsabary-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 4 files reviewed, 3 unresolved discussions (waiting on @alonh5, @nadin-Starkware, and @yair-starkware)


crates/starknet_integration_tests/src/sequencer_manager.rs line 338 at r1 (raw file):

Previously, yair-starkware (Yair) wrote…

It's the executable that contains the batcher, do we call each executable a node?

Node: the set of all components (gateway, batcher, etc.)
Executable: an instance running the binary with a config, setting up one or more components

A node is run using one or more executables.

I do see your point though, it's the (executable that runs the batcher)'s monitoring client.
Can this be better emphasized though?


crates/starknet_integration_tests/src/sequencer_manager.rs line 355 at r1 (raw file):

Previously, yair-starkware (Yair) wrote…

The function is still returning the same block number it returned before thanks to the call to prev.
IIUC, your suggestion is to change that and fix all the callers?
If so, I will do it in a separate PR.

Not at all, I suggested about renaming the fn from get_latest_block_number to get_batcher_latest_block_number, or something of that sort.
Motivation: to indicate it is about the batcher and not the consensus for example.

@yair-starkware yair-starkware force-pushed the yair/move_metrics_registration branch from 3138901 to 2f89609 Compare January 28, 2025 12:30
@yair-starkware yair-starkware force-pushed the yair/e2e_use_monitoring branch from 6e6bc62 to 90788e9 Compare January 28, 2025 12:30
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 3 of 4 files at r1, 1 of 1 files at r2, all commit messages.
Reviewable status: all files reviewed, 3 unresolved discussions (waiting on @Itay-Tsabary-Starkware, @nadin-Starkware, and @yair-starkware)


crates/starknet_integration_tests/src/sequencer_manager.rs line 352 at r1 (raw file):

Previously, yair-starkware (Yair) wrote…

I'm not sure, this is not something that we can get from monitoring, we need RPC for this - @alonh5

We don't actually need the nonce in this case, we just wanted to check all txs in general went in blocks. Can you use the n_txs metrics here?

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: 3 of 4 files reviewed, 3 unresolved discussions (waiting on @alonh5, @Itay-Tsabary-Starkware, and @nadin-Starkware)


crates/starknet_integration_tests/src/sequencer_manager.rs line 338 at r1 (raw file):

Previously, Itay-Tsabary-Starkware wrote…

Node: the set of all components (gateway, batcher, etc.)
Executable: an instance running the binary with a config, setting up one or more components

A node is run using one or more executables.

I do see your point though, it's the (executable that runs the batcher)'s monitoring client.
Can this be better emphasized though?

discussed f2f, leaving the current name


crates/starknet_integration_tests/src/sequencer_manager.rs line 355 at r1 (raw file):

Previously, Itay-Tsabary-Starkware wrote…

Not at all, I suggested about renaming the fn from get_latest_block_number to get_batcher_latest_block_number, or something of that sort.
Motivation: to indicate it is about the batcher and not the consensus for example.

Done.

@yair-starkware
Copy link
Contributor Author

crates/starknet_integration_tests/src/sequencer_manager.rs line 352 at r1 (raw file):

Previously, alonh5 (Alon Haramati) wrote…

We don't actually need the nonce in this case, we just wanted to check all txs in general went in blocks. Can you use the n_txs metrics here?

Will do in a following PR

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.

Reviewable status: 3 of 4 files reviewed, 4 unresolved discussions (waiting on @Itay-Tsabary-Starkware, @nadin-Starkware, and @yair-starkware)


crates/starknet_integration_tests/src/sequencer_manager.rs line 285 at r2 (raw file):

            })
            .expect("Node 0 should be either idle or running.")
    }

Let's take one of the running nodes, it doesn't have to be the first node.

Suggestion:

    fn running_batcher_monitoring_client(&self) -> &MonitoringClient {
        self.idle_nodes
            .get(&0)
            .map(|node| node.batcher_monitoring_client())
            .or_else(|| {
                self.running_nodes
                    .get(&0)
                    .map(|running_node| running_node.node_setup.batcher_monitoring_client())
            })
            .expect("Node 0 should be either idle or running.")
    }

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 1 of 1 files at r3, all commit messages.
Reviewable status: all files reviewed, 4 unresolved discussions (waiting on @Itay-Tsabary-Starkware, @nadin-Starkware, and @yair-starkware)


crates/starknet_integration_tests/src/sequencer_manager.rs line 352 at r1 (raw file):

Previously, yair-starkware (Yair) wrote…

Will do in a following PR

np

@yair-starkware
Copy link
Contributor Author

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: 3 of 4 files reviewed, 4 unresolved discussions (waiting on @alonh5, @Itay-Tsabary-Starkware, and @nadin-Starkware)


crates/starknet_integration_tests/src/sequencer_manager.rs line 285 at r2 (raw file):

Previously, alonh5 (Alon Haramati) wrote…

Let's take one of the running nodes, it doesn't have to be the first node.

Done.

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 1 of 1 files at r4, all commit messages.
Reviewable status: all files reviewed, 5 unresolved discussions (waiting on @Itay-Tsabary-Starkware, @nadin-Starkware, and @yair-starkware)


crates/starknet_integration_tests/src/sequencer_manager.rs line 285 at r2 (raw file):

Previously, yair-starkware (Yair) wrote…

Done.

Rename as suggested?


crates/starknet_integration_tests/src/sequencer_manager.rs line 346 at r4 (raw file):

    )
    .prev() // The metric is the height marker so we need to subtract 1 to get the latest.
    .unwrap()

expect in both

Code quote:

            .unwrap(),
    )
    .prev() // The metric is the height marker so we need to subtract 1 to get the latest.
    .unwrap()

@yair-starkware yair-starkware force-pushed the yair/move_metrics_registration branch from 2f89609 to 70caf22 Compare January 29, 2025 10:12
@yair-starkware yair-starkware force-pushed the yair/e2e_use_monitoring branch from fe1e355 to ebfb4dc Compare January 29, 2025 10:12
@yair-starkware yair-starkware force-pushed the yair/move_metrics_registration branch from 70caf22 to 5a5e05b Compare January 30, 2025 08:00
@yair-starkware yair-starkware force-pushed the yair/e2e_use_monitoring branch from ebfb4dc to 3c87d00 Compare January 30, 2025 08:00
@yair-starkware yair-starkware requested a review from alonh5 January 30, 2025 08:08
@yair-starkware yair-starkware force-pushed the yair/e2e_use_monitoring branch from 3c87d00 to 48f14f9 Compare January 30, 2025 08:08
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, 5 unresolved discussions (waiting on @alonh5, @Itay-Tsabary-Starkware, and @nadin-Starkware)


crates/starknet_integration_tests/src/sequencer_manager.rs line 285 at r2 (raw file):

Previously, alonh5 (Alon Haramati) wrote…

Rename as suggested?

Done.


crates/starknet_integration_tests/src/sequencer_manager.rs line 346 at r4 (raw file):

Previously, alonh5 (Alon Haramati) wrote…

expect in both

Done.

Copy link
Contributor

@Itay-Tsabary-Starkware Itay-Tsabary-Starkware left a comment

Choose a reason for hiding this comment

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

:lgtm:

Reviewed 3 of 4 files at r1, 1 of 1 files at r5, all commit messages.
Reviewable status: all files reviewed, 2 unresolved discussions (waiting on @alonh5 and @nadin-Starkware)

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:

Reviewed 1 of 1 files at r5, all commit messages.
Reviewable status: :shipit: complete! all files reviewed, all discussions resolved (waiting on @nadin-Starkware)

@yair-starkware yair-starkware changed the base branch from yair/move_metrics_registration to main January 30, 2025 11:17
@yair-starkware yair-starkware force-pushed the yair/e2e_use_monitoring branch from 48f14f9 to e719b7b Compare January 30, 2025 11:24
Copy link

graphite-app bot commented Jan 30, 2025

Merge activity

  • Jan 30, 6:25 AM EST: Graphite disabled "merge when ready" on this PR due to: We hit a GitHub rate limit while trying to merge. If you are attempting to merge a large stack, breaking it up into smaller chunks may help..

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.

Reviewed 1 of 4 files at r1, 3 of 3 files at r6, all commit messages.
Reviewable status: :shipit: complete! all files reviewed, all discussions resolved (waiting on @nadin-Starkware)

@yair-starkware yair-starkware added this pull request to the merge queue Jan 30, 2025
Merged via the queue into main with commit f4c63e0 Jan 30, 2025
21 checks passed
@github-actions github-actions bot locked and limited conversation to collaborators Feb 1, 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