Skip to content
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

polygon: fix wallet connected/disconnected notifications show up constantly #3163

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

norwnd
Copy link
Contributor

@norwnd norwnd commented Jan 27, 2025

Been running this change for couple of weeks now, pretty sure it's stable and it fixes the issue.

Closes #3143

Copy link
Member

@JoeGruffins JoeGruffins left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you for looking at this norwnd. All of these values may be back from when we thought we could use local light nodes, and now when testing its mostly simnet, so the actual time it takes for providers to respond, normally, is useful info.

Maybe we should update the live tests to output the time it takes for all providers to respond with all methods.

@@ -88,7 +88,7 @@ const (
// confCheckTimeout is the amount of time allowed to check for
// confirmations. Testing on testnet has shown spikes up to 2.5
// seconds. This value may need to be adjusted in the future.
confCheckTimeout = 4 * time.Second
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We are a little worried about trade ticks taking a long time, and this may increase those. Do the errors end in failed trades or they are just loud?

Actually the comment is probably from back when we thought we could use light nodes, so providers would be longer. 30 seconds feels excessive though. Does just a little more work? like... 6 or 8?

@@ -3700,7 +3700,7 @@ func (eth *ETHWallet) monitorBlocks(ctx context.Context) {
// tipChange callback function is invoked and a goroutine is started to check
// if any contracts in the findRedemptionQueue are redeemed in the new blocks.
func (eth *ETHWallet) checkForNewBlocks(ctx context.Context) {
ctx, cancel := context.WithTimeout(ctx, 2*time.Second)
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thirty seconds also seems excessive here... does 8 work? It's only asking for a header.

@JoeGruffins
Copy link
Member

Oh the tests do show time for a set provider, just not for the free ones. Here are some times randomly for me and getting the header:

#### "https://rpc.ankr.com/eth" passed "HeaderByNumber": 116.722563ms 
#### "https://ethereum.blockpi.network/v1/rpc/public" passed "HeaderByNumber": 395.203018ms 
#### "https://rpc.flashbots.net" passed "HeaderByNumber": 235.225585ms 
#### "wss://eth.llamarpc.com" passed "HeaderByNumber": 213.214977ms 
#### "https://eth-mainnet.nodereal.io/v1/1659dfb40aa24bbb8153a677b98064d7" passed "HeaderByNumber": 45.94739ms 
#### "https://ethereum.publicnode.com" passed "HeaderByNumber": 285.207842ms 

They all seem pretty low, ofc that could change based on how busy they are and distance from them...

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.

polygon: wallet connected/disconnected notifications show up constantly
2 participants