Finschia / cometbft

CometBFT (fork of Tendermint Core): A distributed, Byzantine fault-tolerant, deterministic state machine replication engine
https://docs.cometbft.com
Apache License 2.0
0 stars 0 forks source link

Add unique handling of servers (Triage on ostracon#515) #15

Open 0Tech opened 8 months ago

0Tech commented 8 months ago

The subject of the triage:

Mdaiki0730 commented 8 months ago

It seems that it is not applied as of v0.38.0. I think it is better to send the PR upstream to prevent security degradation due to cross-checking with the light client's primary. https://github.com/cometbft/cometbft/blob/v0.38.0/statesync/stateprovider.go#L48-L86

Mdaiki0730 commented 8 months ago

Additional discussion is required.

servers is given by config.StateSync.RPCServers. https://github.com/cometbft/cometbft/blob/v0.38.0/node/node.go#L204

If you check the value passed during test, RPCAddress will be entered in RPCServers. https://github.com/cometbft/cometbft/blob/v0.38.0/test/e2e/runner/setup.go#L229 https://github.com/cometbft/cometbft/blob/main/test/e2e/pkg/testnet.go#L552

This duplication therefore helps create clients and providers to the same address.