sui icon indicating copy to clipboard operation
sui copied to clipboard

[indexer] Support ipv6 on sui-indexer's RPC server

Open Gkirito opened this issue 2 years ago • 7 comments

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

Gkirito avatar Apr 13 '23 03:04 Gkirito

The latest updates on your projects. Learn more about Vercel for Git ↗︎

4 Ignored Deployments
Name Status Preview Comments Updated (UTC)
explorer ⬜️ Ignored (Inspect) Apr 20, 2023 6:56pm
explorer-storybook ⬜️ Ignored (Inspect) Apr 20, 2023 6:56pm
sui-wallet-kit ⬜️ Ignored (Inspect) Apr 20, 2023 6:56pm
wallet-adapter ⬜️ Ignored (Inspect) Apr 20, 2023 6:56pm

vercel[bot] avatar Apr 13 '23 03:04 vercel[bot]

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.

Gkirito avatar Apr 18 '23 02:04 Gkirito

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?

gegaowp avatar Apr 20 '23 18:04 gegaowp

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?

Thanks OK, I will fix it.

Gkirito avatar Apr 20 '23 18:04 Gkirito

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)

Gkirito avatar Apr 20 '23 19:04 Gkirito

Hi @gegaowp, I fixed it, Could you review it again?

Gkirito avatar Apr 20 '23 19:04 Gkirito

@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

gegaowp avatar Apr 20 '23 19:04 gegaowp

@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

gegaowp avatar Apr 24 '23 20:04 gegaowp

@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

Gkirito avatar Apr 25 '23 00:04 Gkirito