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 multi-rpc client for server #2104
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.
utACK, a few minor things.
I'm going to rebase #2013 on this PR and test today.
I addressed your first review, @chappjc. One thing I'm still thinking about doing is advancing the endpoint index if a header appears outdated. |
BTW, how's #2074 for you, for client
ofc
…On Sun, Feb 5, 2023, 11:41 AM buck54321 ***@***.***> wrote:
I addressed your first review, @chappjc <https://github.com/chappjc>. One
thing I'm still thinking about doing is advancing the endpoint index if a
header appears outdated.
—
Reply to this email directly, view it on GitHub
<#2104 (comment)>, or
unsubscribe
<https://github.com/notifications/unsubscribe-auth/ACHQOSMMAQVYNY6NAO4VSK3WV7Q3HANCNFSM6AAAAAAUR2IPHY>
.
You are receiving this because you were mentioned.Message ID:
***@***.***>
|
server/asset/eth/rpcclient.go
Outdated
bn, err := ec.BlockNumber(ctx) | ||
if err != nil { | ||
return err | ||
} | ||
hdr, err = ec.HeaderByNumber(ctx, big.NewInt(int64(bn))) | ||
return err |
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.
Doing some testing with Blast (blastapi.io) and I got a method not found, but I can't tell what method:
[ERR] ASSET[eth][RPC]: Unpropagated error from "wss://eth-mainnet.blastapi.io/xxxxx-xyyyy-adsfasdf": Method not found
[INF] ASSET[eth][RPC]: Switching RPC endpoint to "ws://127.0.0.1:8546"
On startup it did the balance method check and as expected it went the dumb way:
[DBG] ASSET[eth]: Parsed 2 endpoints from the ETH config file
[WRN] ASSET[eth][RPC]: Error checking required modules at "wss://eth-mainnet.blastapi.io/xxxxx-xyyyy-adsfasdf": unable to check supported modules: Method not found
[WRN] ASSET[eth][RPC]: Will not account for pending transactions in balance calculations at "wss://eth-mainnet.blastapi.io/xxxxx-xyyyy-adsfasdf"
[DBG] ASSET[eth][RPC]: API endpoints supported by ws://127.0.0.1:8546: admin:1.0 engine:1.0 eth:1.0 net:1.0 rpc:1.0 txpool:1.0
So possibly there's another method missing and blast isn't gonna work, or the smart/dumb switch didn't work as expected. I don't think it was checking a balance at the time, so it's probably another method sadly.
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.
You could add blastapi to your ~/dextest/providers.json
and run go test -tags rpclive,lgpl -run TestMainnetCompliance
in client/asset/eth to see if anything pops out. I've seen "Method not found"
for SuggestGasTipCap
before. Not sure how that aligns with CheckAPIModules
.
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.
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.
That seems like a good idea. Also, on startup when it checks each endpoint it could compare the best header times (even hash and height) to be sure one doesn't look dead or stalled. |
No description provided.