sui
sui copied to clipboard
[indexer] Support ipv6 on sui-indexer's RPC server
Description
Support ipv6 for sui-indexer's RPC server
Test Plan
Run sui-indexer with sub args --rpc-server-url "::"
Ex.
full command
cargo run --package sui-indexer --bin sui-indexer -- --db-url "postgres://postgres:[email protected]:5432/sui-indexer" --rpc-client-url "https://fullnode.devnet.sui.io:443" --rpc-server-worker --rpc-server-url "::"
If your changes are not user-facing and not a breaking change, you can skip the following section. Otherwise, please indicate what changed, and then add to the Release Notes section as highlighted during the release process.
Type of Change (Check all that apply)
- [ ] user-visible impact
- [ ] breaking change for a client SDKs
- [ ] breaking change for FNs (FN binary must upgrade)
- [ ] breaking change for validators or node operators (must upgrade binaries)
- [ ] breaking change for on-chain data layout
- [ ] necessitate either a data wipe or data migration
Release notes
The latest updates on your projects. Learn more about Vercel for Git ↗︎
Is there anyone who can review this PR? We really need support ipv6 to deploy the indexer process in our AWS EKS which uses the IPV6 network without IPV4 support.
cargo fmt && cargo xclippy -D warnings failed, can you fix that?
Also can you paste more in the test plan section, like output from both ipv4 and v6 ones?
cargo fmt && cargo xclippy -D warningsfailed, can you fix that? Also can you paste more in the test plan section, like output from both ipv4 and v6 ones?
Thanks OK, I will fix it.
Test for ipv6
Log
sui-indexer --db-url "postgres://postgres:@127.0.0.1:5432/sui_full_node_indexer" --rpc-client-url "https://sui-testnet-wave3.coming.chat:443" --rpc-server-worker --rpc-server-url "::"
2023-04-20T18:56:57.287762Z INFO sui_indexer: Parsed indexer config: IndexerConfig {
db_url: "postgres://postgres:@127.0.0.1:5432/sui_full_node_indexer",
rpc_client_url: "https://sui-testnet-wave3.coming.chat:443",
client_metric_host: "0.0.0.0",
client_metric_port: 9184,
rpc_server_url: "::",
rpc_server_port: 9000,
migrated_methods: [],
reset_db: false,
fullnode_sync_worker: false,
rpc_server_worker: true,
skip_db_commit: false,
}
2023-04-20T18:56:57.288890Z INFO sui_indexer: Starting prometheus server with labels: {"indexer_fullnode": "sui-testnet-wave3.coming.chat"}
2023-04-20T18:56:57.354385Z INFO sui_indexer: Creating connection pool with size: 187
2023-04-20T18:56:57.363452Z INFO sui_indexer::store::pg_indexer_store: Found 1 tables with partitions : [{"objects_history": 0}]
2023-04-20T18:56:57.363537Z INFO sui_indexer: Sui indexer of version "0.32.0" started...
2023-04-20T18:56:57.363710Z INFO sui_indexer: Starting indexer with only RPC server
2023-04-20T18:56:57.502705Z INFO sui_json_rpc: acl=Const("*")
2023-04-20T18:56:57.503109Z INFO sui_json_rpc: Compatibility method routing enabled.
2023-04-20T18:56:57.503416Z INFO sui_json_rpc: Sui JSON-RPC server listening on [::]:9000 local_addr=[::]:9000
Status of Port Listening
lsof -i tcp:9000
COMMAND PID USER FD TYPE DEVICE SIZE/OFF NODE NAME
sui-index 46732 root 20u IPv6 0x89984aeefec27edf 0t0 TCP *:cslistener (LISTEN)
Test for ipv4
Log
sui-indexer --db-url "postgres://postgres:@127.0.0.1:5432/sui_full_node_indexer" --rpc-client-url "https://sui-testnet-wave3.coming.chat:443" --rpc-server-worker --rpc-server-url "0.0.0.0"
2023-04-20T19:09:05.213494Z INFO sui_indexer: Parsed indexer config: IndexerConfig {
db_url: "postgres://postgres:@127.0.0.1:5432/sui_full_node_indexer",
rpc_client_url: "https://sui-testnet-wave3.coming.chat:443",
client_metric_host: "0.0.0.0",
client_metric_port: 9184,
rpc_server_url: "0.0.0.0",
rpc_server_port: 9000,
migrated_methods: [],
reset_db: false,
fullnode_sync_worker: false,
rpc_server_worker: true,
skip_db_commit: false,
}
2023-04-20T19:09:05.214568Z INFO sui_indexer: Starting prometheus server with labels: {"indexer_fullnode": "sui-testnet-wave3.coming.chat"}
2023-04-20T19:09:05.269651Z INFO sui_indexer: Creating connection pool with size: 187
2023-04-20T19:09:05.274264Z INFO sui_indexer::store::pg_indexer_store: Found 1 tables with partitions : [{"objects_history": 0}]
2023-04-20T19:09:05.274341Z INFO sui_indexer: Sui indexer of version "0.32.0" started...
2023-04-20T19:09:05.274516Z INFO sui_indexer: Starting indexer with only RPC server
2023-04-20T19:09:05.416014Z INFO sui_json_rpc: acl=Const("*")
2023-04-20T19:09:05.416445Z INFO sui_json_rpc: Compatibility method routing enabled.
2023-04-20T19:09:05.416757Z INFO sui_json_rpc: Sui JSON-RPC server listening on 0.0.0.0:9000 local_addr=0.0.0.0:9000
Status of Port Listening
lsof -i tcp:9000
COMMAND PID USER FD TYPE DEVICE SIZE/OFF NODE NAME
sui-index 47515 root 20u IPv4 0x89984af893d406e7 0t0 TCP *:cslistener (LISTEN)
Hi @gegaowp, I fixed it, Could you review it again?
@Gkirito the change looks good, it has a CI failure though but prob not related to your change, I will take care of it and merge this PR soon. Thanks for making the change and the detailed test results
@Gkirito to get around the CI failure I had to create another PR https://github.com/MystenLabs/sui/pull/11255 and rebase, but this is now merged to main. I will also cherry-pick it to latest release branch 0.33
@Gkirito to get around the CI failure I had to create another PR #11255 and rebase, but this is now merged to main. I will also cherry-pick it to latest release branch 0.33
Ok