Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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
Add arbi validator #19
Add arbi validator #19
Changes from 64 commits
09f558f
2ed2c13
3481092
15b2386
7ebb0c9
25b3c0e
3f7d601
0c31ad2
5e1ef4b
2ab3282
ffb66d0
57fd4b0
b925d95
16315dc
750fbc7
c6159df
13da401
c412d33
82bbb12
971f3a2
5450c6a
98b4174
a6128cd
b54dfe9
148255a
75e4609
e7a9fa5
0d07456
5a60366
50e9cc5
94c3d78
4e86131
c1b2b05
8108904
661853f
db012b6
ece9823
6865e7b
ae74902
77a6b7c
2c61006
479c4f8
d4a53e2
b48975f
896a818
519c861
381345a
be7eee5
4b7865c
b49dc6f
b43c139
128bbbd
36f68d5
c33121c
ef71297
5cd3bbf
3d98ec7
656e579
e9c065e
2a1feb6
91b3390
cf6f9b1
d15a480
9770701
d4d3147
402a151
aac64fd
74785ae
File filter
Filter by extension
Conversations
Jump to
There are no files selected for viewing
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.
Are any of these operations costly? Should we be caching the latest block?
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.
We're making two RPC calls to fetch the latest node from the L1 contract and the corresponding L2 block. Besides that, it's just event parsing. Given that the latestNodeCreated is updated roughly every hour on the mainnet, I think it could be a really good idea to cache both the Node and Block. However, there might be additional infrastructure like Redis needed to do that properly with the serverless Cloudflare worker the gateway is deployed on.
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.
One of the RPCs is an event filter, though, which can be slow and costly. Perhaps we can at least cache the result in-process in a variable?
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.
I have added a simple in-memory cache that caches the values for a particular nodeIndex. It can be easily replaced by a more sophisticated cache by implementing the IBlockCache interface