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(sync): add poll_pending_data to sync config #515

Merged
merged 6 commits into from
Aug 22, 2024

Conversation

guy-starkware
Copy link
Contributor

@guy-starkware guy-starkware commented Aug 19, 2024

This small PR adds a boolean to the SyncConfig struct that allows turning on or off the polling for pending data. This is on by default.


This change is Reviewable

@guy-starkware guy-starkware force-pushed the guyn/poll_pending_boolean branch from a9597e0 to 445ef6f Compare August 19, 2024 13:14
@guy-starkware guy-starkware changed the title Add poll_pending_data to sync config feat:Add poll_pending_data to sync config Aug 20, 2024
@guy-starkware guy-starkware changed the title feat:Add poll_pending_data to sync config feat: Add poll_pending_data to sync config Aug 20, 2024
@guy-starkware guy-starkware force-pushed the guyn/poll_pending_boolean branch from 901b5aa to 744c182 Compare August 20, 2024 11:14
@guy-starkware guy-starkware force-pushed the guyn/poll_pending_boolean branch from 744c182 to 8c048e0 Compare August 20, 2024 11:17
@guy-starkware guy-starkware force-pushed the guyn/poll_pending_boolean branch from 8c048e0 to 4e62729 Compare August 20, 2024 11:23
@guy-starkware guy-starkware changed the title feat: Add poll_pending_data to sync config feat: add poll_pending_data to sync config Aug 20, 2024
Copy link

codecov bot commented Aug 20, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 76.66%. Comparing base (091490f) to head (8431918).
Report is 268 commits behind head on main.

Additional details and impacted files
@@            Coverage Diff             @@
##             main     #515      +/-   ##
==========================================
+ Coverage   76.45%   76.66%   +0.21%     
==========================================
  Files         314      349      +35     
  Lines       34205    36548    +2343     
  Branches    34205    36548    +2343     
==========================================
+ Hits        26152    28021    +1869     
- Misses       5775     6222     +447     
- Partials     2278     2305      +27     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

Copy link
Contributor

@DvirYo-starkware DvirYo-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 2 files at r6, 2 of 3 files at r7, all commit messages.
Reviewable status: 4 of 5 files reviewed, 4 unresolved discussions (waiting on @guy-starkware)


-- commits line 2 at r7:
add a scope to the commit message.


config/papyrus/default_config.json line 392 at r7 (raw file):

    "value": 1000
  },
  "sync.poll_pending_data": {

The polling is an implementation detail and does not fully explain the effect of the configuration value. Consider something like collect_pending_data


config/papyrus/default_config.json line 395 at r7 (raw file):

    "description": "Whether to poll for pending data.",
    "privacy": "Public",
    "value": true

I think the default value should be false. We don't want the node to do extra work unless explicitly requested.

Code quote:

"value": true

crates/papyrus_sync/src/lib.rs line 695 at r7 (raw file):

                if reader.begin_ro_txn()?.get_state_marker()? == header_marker{
                    // Here is the only place we update the pending data.
                    if poll_pending_data {

Move this check to line 693

Code quote:

 if poll_pending_data {

Copy link
Contributor Author

@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.

Reviewable status: 1 of 5 files reviewed, 4 unresolved discussions (waiting on @DvirYo-starkware)


-- commits line 2 at r7:

Previously, DvirYo-starkware wrote…

add a scope to the commit message.

what would be the scope in this case?


config/papyrus/default_config.json line 392 at r7 (raw file):

Previously, DvirYo-starkware wrote…

The polling is an implementation detail and does not fully explain the effect of the configuration value. Consider something like collect_pending_data

Done.


config/papyrus/default_config.json line 395 at r7 (raw file):

Previously, DvirYo-starkware wrote…

I think the default value should be false. We don't want the node to do extra work unless explicitly requested.

Done.


crates/papyrus_sync/src/lib.rs line 695 at r7 (raw file):

Previously, DvirYo-starkware wrote…

Move this check to line 693

Done.

Copy link
Contributor

@DvirYo-starkware DvirYo-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 4 of 4 files at r8, all commit messages.
Reviewable status: all files reviewed, 1 unresolved discussion (waiting on @guy-starkware)


-- commits line 2 at r7:

Previously, guy-starkware wrote…

what would be the scope in this case?

You can see all the commitline definitions in the sequencer/commitlint.config.js file. In this case, it would be sync

@guy-starkware guy-starkware changed the title feat: add poll_pending_data to sync config feat(sync): add poll_pending_data to sync config Aug 21, 2024
Copy link
Contributor Author

@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.

Reviewable status: all files reviewed, 1 unresolved discussion (waiting on @DvirYo-starkware)


-- commits line 2 at r7:

Previously, DvirYo-starkware wrote…

You can see all the commitline definitions in the sequencer/commitlint.config.js file. In this case, it would be sync

Done.

Copy link
Contributor

@DvirYo-starkware DvirYo-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:

Reviewable status: :shipit: complete! all files reviewed, all discussions resolved (waiting on @guy-starkware)

@guy-starkware guy-starkware merged commit 97d58ba into main Aug 22, 2024
39 of 40 checks passed
@github-actions github-actions bot locked and limited conversation to collaborators Aug 24, 2024
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.

2 participants