-
Notifications
You must be signed in to change notification settings - Fork 28
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_l1_provider): add scraper #2853
base: gilad/add-base-layer-to-infra
Are you sure you want to change the base?
Conversation
giladchase
commented
Dec 20, 2024
•
edited
Loading
edited
- base layer constant file will hold the identifiers of Starknet Events.
- fetch_events will get events from base layer and send to provider
Artifacts upload workflows: |
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.
Reviewed 7 of 7 files at r1, all commit messages.
Reviewable status: all files reviewed, 2 unresolved discussions (waiting on @giladchase and @matan-starkware)
crates/starknet_l1_provider/src/l1_scraper.rs
line 55 at r1 (raw file):
self.fetch_events().await?; } }
Is this the canonical run
implementation in our node?
Code quote:
async fn _run(&mut self) -> L1ScraperResult<(), B> {
loop {
sleep(self.config.polling_interval).await;
// TODO: retry.
self.fetch_events().await?;
}
}
crates/starknet_l1_provider/src/l1_scraper.rs
line 60 at r1 (raw file):
#[derive(Clone, Debug, Serialize, Deserialize, Validate, PartialEq)] pub struct L1ScraperConfig { // TODO: make this config into trait.
WDYM? Why?
Code quote:
// TODO: make this config into trait.
f887cbb
to
83be466
Compare
573a0b3
to
75d3714
Compare
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.
Reviewed 2 of 2 files at r2, all commit messages.
Reviewable status: all files reviewed, 2 unresolved discussions (waiting on @giladchase and @matan-starkware)
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.
Reviewed 4 of 7 files at r1, 2 of 2 files at r2, all commit messages.
Reviewable status: all files reviewed, 4 unresolved discussions (waiting on @giladchase)
-- commits
line 4 at r2:
We don't want these to be configurable?
Code quote:
- base layer constant file will hold the identifiers of Starknet Events.
crates/starknet_l1_provider/src/l1_scraper_tests.rs
line 0 at r2 (raw file):
Why add an empty file?
- Currently only implementing the simplest event to parse, the rest are coming up. - removed two unused error variants: `FeltParseError`, `Serde`
83be466
to
1c38ffc
Compare
- base layer constant file will hold the identifiers of Starknet Events. - fetch_events will get events from base layer and send to provider
75d3714
to
717a4de
Compare
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: 5 of 8 files reviewed, 3 unresolved discussions (waiting on @elintul and @matan-starkware)
Previously, matan-starkware wrote…
We don't want these to be configurable?
I might be misunderstanding you, but AFAIK event identifiers (in Ethereum) are fixed, they are always:
keccak(<signature_of_event>)
.
The identifier will only change if the signature changes, and this updates the const during compilation time (since the consts are generated from sol!
).
crates/starknet_l1_provider/src/l1_scraper.rs
line 55 at r1 (raw file):
Previously, elintul (Elin) wrote…
Is this the canonical
run
implementation in our node?
I haven't found any similar run
use-case in our code. We currently only have loop-and-select! style run
s, without any loop-do-sleep-awake
loops.
With that said, this is a very basic implementation, I'll extend it soon once the pressure's off, unless you have stuff in mind now?
crates/starknet_l1_provider/src/l1_scraper.rs
line 60 at r1 (raw file):
Previously, elintul (Elin) wrote…
WDYM? Why?
Seems to be refactoring leftovers, doesn't make sense here, removed.
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.
Reviewed 3 of 3 files at r3, all commit messages.
Reviewable status: all files reviewed, 2 unresolved discussions (waiting on @giladchase and @matan-starkware)
crates/starknet_l1_provider/src/l1_scraper.rs
line 55 at r1 (raw file):
Previously, giladchase wrote…
I haven't found any similar
run
use-case in our code. We currently only have loop-and-select! stylerun
s, without anyloop-do-sleep-awake
loops.With that said, this is a very basic implementation, I'll extend it soon once the pressure's off, unless you have stuff in mind now?
Nope, sounds good.
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: all files reviewed, 2 unresolved discussions (waiting on @giladchase and @matan-starkware)
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: all files reviewed, 1 unresolved discussion (waiting on @matan-starkware)
1c38ffc
to
94ce4e7
Compare