-
Notifications
You must be signed in to change notification settings - Fork 29
chore(marketplace): switch to websocket #1166
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
Conversation
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.
Nice job. What about handling websocket resubscriptions after 5 minutes?
I am still exploring the issue, I am not sure how to reproduce it. |
89b8fdc
to
b6e6596
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.
Well the Hardhat bug is just unfortunate :-( It is hacky approach, but I can't think of better one, so LGTM.
Actually, I have (I think 😅) a better idea - what about adding this functionality (automatically resubscriptions) directly to the nim-ethers under compile flag? No hacky private property access needed. It will be cleanly turned on only when the nim-ether's user needs... IMHO better then this. |
6bf37ac
to
c65b2cd
Compare
@@ -23,6 +23,10 @@ ethersuite "On-Chain Clock": | |||
let future = (getTime() + 42.years).toUnix | |||
discard await ethProvider.send("evm_setNextBlockTimestamp", @[%future]) | |||
discard await ethProvider.send("evm_mine") | |||
|
|||
# Ensure that state updates are sync with WS | |||
discard await ethProvider.getBlock(BlockTag.latest) |
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.
How does fetching the latest block ensure state updates are synchronous?
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 am not sure I was gonna to ask for a review.
But my guess is that with Websocket, since it is asynchronous and does not wait for the state update, the client might not immediately reflect the new block's state after evm_mine, so we need to get the latest block to ensure the client is synced with the blockchain.
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.
@emizzle are these changes okay for you ?
3ba1c77
to
0f81b4d
Compare
d3912db
to
4087153
Compare
Linea is supporting only Websocket.
So it would be better to use it in our testing.
Depends on codex-storage/nim-ethers#112.