Skip to content

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

Merged
merged 7 commits into from
May 23, 2025

Conversation

2-towns
Copy link
Contributor

@2-towns 2-towns commented Mar 17, 2025

Linea is supporting only Websocket.

So it would be better to use it in our testing.

Depends on codex-storage/nim-ethers#112.

Copy link
Contributor

@emizzle emizzle left a 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?

@2-towns
Copy link
Contributor Author

2-towns commented Mar 18, 2025

Nice job. What about handling websocket resubscriptions after 5 minutes?

I am still exploring the issue, I am not sure how to reproduce it.

@2-towns 2-towns force-pushed the chore/re-enable-hardhat-websocket branch from 89b8fdc to b6e6596 Compare March 19, 2025 13:19
@2-towns 2-towns marked this pull request as ready for review March 19, 2025 13:21
Copy link
Member

@AuHau AuHau left a 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.

@AuHau AuHau self-requested a review March 19, 2025 16:30
@AuHau
Copy link
Member

AuHau commented Mar 19, 2025

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.

@2-towns 2-towns force-pushed the chore/re-enable-hardhat-websocket branch from 6bf37ac to c65b2cd Compare April 10, 2025 08:59
@@ -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)
Copy link
Contributor

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?

Copy link
Contributor Author

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.

Copy link
Contributor Author

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 ?

@2-towns 2-towns force-pushed the chore/re-enable-hardhat-websocket branch from 3ba1c77 to 0f81b4d Compare April 18, 2025 08:40
@2-towns 2-towns force-pushed the chore/re-enable-hardhat-websocket branch 2 times, most recently from d3912db to 4087153 Compare May 23, 2025 11:09
@2-towns 2-towns enabled auto-merge May 23, 2025 11:09
@2-towns 2-towns added this pull request to the merge queue May 23, 2025
@github-merge-queue github-merge-queue bot removed this pull request from the merge queue due to failed status checks May 23, 2025
@2-towns 2-towns added this pull request to the merge queue May 23, 2025
Merged via the queue into master with commit f7d06cd May 23, 2025
19 checks passed
@2-towns 2-towns deleted the chore/re-enable-hardhat-websocket branch May 23, 2025 15:07
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants