-
Notifications
You must be signed in to change notification settings - Fork 65
apollo_l1_provider: improve add_tx and prevent double scraping #10508
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
apollo_l1_provider: improve add_tx and prevent double scraping #10508
Conversation
41bfe7f to
45ec5b5
Compare
1044e6f to
8f322a9
Compare
sirandreww-starkware
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@sirandreww-starkware reviewed 1 of 3 files at r1.
Reviewable status: 1 of 3 files reviewed, 1 unresolved discussion (waiting on @guy-starkware)
crates/apollo_l1_provider/src/transaction_manager.rs line 179 at r1 (raw file):
); } record.tx.set(tx, block_timestamp, scrape_timestamp);
You set either way? should there be a check that hashes match?
guy-starkware
left a comment
There was a problem hiding this 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 3 files reviewed, 1 unresolved discussion (waiting on @sirandreww-starkware)
crates/apollo_l1_provider/src/transaction_manager.rs line 179 at r1 (raw file):
Previously, sirandreww-starkware (Andrew Luka) wrote…
You set either way? should there be a check that hashes match?
The record is stored by hash. You can't have a duplicated tx if the hash doesn't match (it will be recorded as a new tx).
guy-starkware
left a comment
There was a problem hiding this 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 3 files reviewed, 1 unresolved discussion (waiting on @sirandreww-starkware)
crates/apollo_l1_provider/src/transaction_manager.rs line 179 at r1 (raw file):
Previously, guy-starkware wrote…
The record is stored by hash. You can't have a duplicated tx if the hash doesn't match (it will be recorded as a new tx).
The reason we set it even if it exists is that you can get a HashOnly payload from sync, and then get it again from the scraper, which sets it to a Full payload.
I'm adding a situation where it was already a Full payload and we try to set it again, which is a bug. This shouldn't happen but if it does we don't want to accidentally re-put it on the proposable index (the queue we are using to validate or propose).
8f322a9 to
977f627
Compare
45ec5b5 to
46338eb
Compare
sirandreww-starkware
left a comment
There was a problem hiding this 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 3 files reviewed, all discussions resolved
crates/apollo_l1_provider/src/transaction_manager.rs line 179 at r1 (raw file):
Previously, guy-starkware wrote…
The reason we set it even if it exists is that you can get a HashOnly payload from sync, and then get it again from the scraper, which sets it to a Full payload.
I'm adding a situation where it was already a Full payload and we try to set it again, which is a bug. This shouldn't happen but if it does we don't want to accidentally re-put it on the proposable index (the queue we are using to validate or propose).
I see
46338eb to
ea8a958
Compare
977f627 to
aaa8741
Compare
aaa8741 to
73c16c9
Compare
ea8a958 to
0322762
Compare
ShahakShama
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@ShahakShama reviewed 1 of 3 files at r1, 1 of 1 files at r2, all commit messages.
Reviewable status: all files reviewed, 2 unresolved discussions (waiting on @guy-starkware)
crates/apollo_l1_provider/src/transaction_manager.rs line 168 at r2 (raw file):
// If exists, return false and do nothing. If not, create the record as a HashOnly payload. let is_new_record = self.create_record_if_not_exist(tx_hash); // Replace a HashOnly payload with a Full payload. If a full payload already exists, do not
Describe the entire thing in one sentence. then explain why in another sentence
Replacing a HashOnly payload is allowed, but a full payload is forbidden. The reason why is that a double scrape should not happen and may cause the tx to be re-added to the proposable index
crates/apollo_l1_provider/src/transaction_manager.rs line 176 at r2 (raw file):
info!( "Transaction {tx_hash} already exists as a HashOnly payload. It was \ probably gotten via sync, and is now updated with a Full payload."
the word sync is ambiguous. Try to add more words to describe which sync
consider "via bootstrap from sync" or "via state sync component"
guy-starkware
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Reviewable status:
complete! all files reviewed, all discussions resolved (waiting on @guy-starkware)
crates/apollo_l1_provider/src/transaction_manager.rs line 168 at r2 (raw file):
Previously, ShahakShama wrote…
Describe the entire thing in one sentence. then explain why in another sentence
Replacing a HashOnly payload is allowed, but a full payload is forbidden. The reason why is that a double scrape should not happen and may cause the tx to be re-added to the proposable index
Done.
crates/apollo_l1_provider/src/transaction_manager.rs line 176 at r2 (raw file):
Previously, ShahakShama wrote…
the word sync is ambiguous. Try to add more words to describe which sync
consider "via bootstrap from sync" or "via state sync component"
Done.
73c16c9 to
897dc8e
Compare
0322762 to
263a506
Compare
guy-starkware
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@guy-starkware reviewed 1 of 3 files at r1, 1 of 1 files at r2, 1 of 1 files at r3, all commit messages.
Reviewable status:complete! all files reviewed, all discussions resolved (waiting on @guy-starkware)
guy-starkware
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@guy-starkware reviewed 5 of 5 files at r4, all commit messages.
Reviewable status:complete! all files reviewed, all discussions resolved (waiting on @guy-starkware)

No description provided.