[alloy][sui-bridge] Integrate Alloy multiprovider in sui bridge#25257
[alloy][sui-bridge] Integrate Alloy multiprovider in sui bridge#252570xsiddharthks merged 3 commits intomainfrom
Conversation
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
a43b101 to
1dd2847
Compare
1dd2847 to
d6e5e9d
Compare
d6e5e9d to
ce66671
Compare
|
|
||
| [dependencies] | ||
| alloy = { version = "1.1.3", features = ["rand", "sol-types", "json-rpc", "provider-ws"] } | ||
| alloy-multiprovider-strategy = { git = "https://github.com/0xsiddharthks/alloy-multiprovider-strategy", rev = "0f8d034e679631a715f9eed104089430ae57283a" } |
There was a problem hiding this comment.
Should we move this somewhere within the MystenLabs org?
There was a problem hiding this comment.
Yeah, I had talked to Brandon about it.
As of now, it's a fairly common pattern in the monorepo to have links to repositories / forks owned by personal accounts.
But I'm totally open to transferring the repo ownership to the MystenLabs org if thats recommended.
There was a problem hiding this comment.
Cool, sounds good to me I just wanted to check
There was a problem hiding this comment.
Yeah this is ok for the time being.
| /// Quorum-based consensus is used across providers for redundancy. | ||
| #[serde(default, skip_serializing_if = "Option::is_none")] | ||
| pub eth_rpc_urls: Option<Vec<String>>, | ||
| /// Quorum size for multi-provider consensus. Must be <= number of URLs. |
There was a problem hiding this comment.
I don't think we're validating that the quorum is <= the number of URLs?
There was a problem hiding this comment.
we have this validation in the multiprovider itself, when it initializes.
There was a problem hiding this comment.
You can probably have this just be Vec and change the skip serialize to Vec::is_empty
| pub struct EthConfig { | ||
| /// Rpc url for Eth fullnode, used for query stuff. | ||
| pub eth_rpc_url: String, | ||
| /// @deprecated (use eth_rpc_urls instead) |
There was a problem hiding this comment.
Does @deprecated in a comment actually trigger any deprecation warnings? Maybe we should use #[deprecated]?
There was a problem hiding this comment.
So this is more a note, we are not deprecating the actual rust field itself. And i wouldn't be surprised if ever after we role this out most folks won't update configs
Description
This PR builds on top of #24575 and replaces the native Alloy provider with the multiprovider implementation.
I have added the following fields to the sui bridge config:
This change is backwords compatible with the existing config, but we will deprecate the eth_rpc_url field in the future once all node operators have migrated to using the new config fields.
Test plan
I have thoroughly tested the
alloy-multiprovider-strategycrate via various test scripts.Also all the CI tests are passing on the sui repo.
Release notes
Check each box that your changes affect. If none of the boxes relate to your changes, release notes aren't required.
For each box you select, include information after the relevant heading that describes the impact of your changes that a user might notice and any actions they must take to implement updates.
Operators can now configure multiple Ethereum RPC endpoints with quorum-based consensus for improved redundancy and fault tolerance.
New optional YAML config fields (in sui bridge config):
eth-rpc-urls(list of RPC URLs),eth-rpc-quorum(quorum size, defaults to 1)eth-health-check-interval-secs(health check interval, defaults to 300s).The existing
eth-rpc-urlfield continues to work for backward compatibility. When a single URL is configured, the multi-provider layer operates as a zero-overhead passthrough with no quorum, health-check, or locking machinery.