Skip to content

improvement(rpc-server): rpc server dynamic port allocation#2342

Merged
shamardy merged 9 commits intodevfrom
rpc_dynamic_port_alloc
Feb 20, 2025
Merged

improvement(rpc-server): rpc server dynamic port allocation#2342
shamardy merged 9 commits intodevfrom
rpc_dynamic_port_alloc

Conversation

@Alrighttt
Copy link
Copy Markdown

This allows a rpcport value of 0 to be used within the config. This is the standard way of indicating "use any available port". I found this necessary for running many KDF instances in parallel within Sia CI tests.

@mariocynicys mariocynicys changed the title improvement(rpc-server):Rpc server dynamic port allocation improvement(rpc-server): Rpc server dynamic port allocation Feb 6, 2025
@mariocynicys mariocynicys changed the title improvement(rpc-server): Rpc server dynamic port allocation improvement(rpc-server): rpc server dynamic port allocation Feb 6, 2025
@Alrighttt
Copy link
Copy Markdown
Author

Is there anyway to later retrieve the port number from MmCtx? If not, I will change the rpc_started value of MmCtx from a boolean to u16, so it can be easily retrieved in CI tests.

removes rpc_started from MmCtx for wasm target
@CharlVS
Copy link
Copy Markdown

CharlVS commented Feb 11, 2025

Will running multiple KDF instances off of the same directory cause issues? If so, will the final revision of this PR protect against running multiple instances off the same directory? Imo, that's bound to happen.

@shamardy
Copy link
Copy Markdown
Collaborator

Will running multiple KDF instances off of the same directory cause issues?

If these instances are using the same seed/mnemonic then yes it will cause issues. If not, it should not cause issues as I did this before by using a different rpc port when testing swaps locally between 2 nodes and we do this in tests as well.

shamardy
shamardy previously approved these changes Feb 17, 2025
borngraced
borngraced previously approved these changes Feb 17, 2025
mariocynicys
mariocynicys previously approved these changes Feb 20, 2025
Copy link
Copy Markdown
Collaborator

@mariocynicys mariocynicys left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

a nit. lgtm otherwise.

@shamardy shamardy dismissed stale reviews from mariocynicys, borngraced, and themself via 7bfefe7 February 20, 2025 11:00
@shamardy shamardy merged commit 86d3002 into dev Feb 20, 2025
@shamardy shamardy deleted the rpc_dynamic_port_alloc branch February 20, 2025 11:28
dimxy pushed a commit to dimxy/komodo-defi-framework that referenced this pull request Feb 24, 2025
* dev: (24 commits)
  fix(eth-tpu): remove state from funding validation (GLEECBTC#2334)
  improvement(rpc-server): rpc server dynamic port allocation (GLEECBTC#2342)
  fix(tests): fix or ignore unstable tests (GLEECBTC#2365)
  fix(fs): make `filter_files_by_extension` return only files (GLEECBTC#2364)
  fix(derive_key_from_path): check length of current_key_material (GLEECBTC#2356)
  chore(release): bump mm2 version to 2.4.0-beta (GLEECBTC#2346)
  fix(tests): add additional testnet sepolia nodes to test code (GLEECBTC#2358)
  fix(swaps): maintain legacy compatibility for negotiation messages (GLEECBTC#2353)
  refactor(SwapOps): impl defaults for protocol specific swapops fns (GLEECBTC#2354)
  feat(tpu-v2): provide swap protocol versioning (GLEECBTC#2324)
  feat(wallet): add change mnemonic password rpc (GLEECBTC#2317)
  fix(tpu-v2): fix tpu-v2 wait for payment spend and extract secret (GLEECBTC#2261)
  feat(tendermint): unstaking/undelegation (GLEECBTC#2330)
  fix(utxo-withdraw): get hw ctx only when `PrivKeyPolicy` is trezor (GLEECBTC#2333)
  feat(event-streaming): API-driven subscription management (GLEECBTC#2172)
  fix(hash-types): remove panic, enforce fixed-size arrays (GLEECBTC#2279)
  fix(ARRR): store unconfirmed change output (GLEECBTC#2276)
  feat(tendermint): staking/delegation (GLEECBTC#2322)
  chore(deps): `timed-map` migration (GLEECBTC#2247)
  fix(mem-leak): `running_swap` never shrinks (GLEECBTC#2301)
  ...
dimxy pushed a commit that referenced this pull request Feb 26, 2025
* dev:
  feat(tendermint): claim delegation rewards (#2351)
  fix(eth-tpu): remove state from funding validation (#2334)
  improvement(rpc-server): rpc server dynamic port allocation (#2342)
  fix(tests): fix or ignore unstable tests (#2365)
  fix(fs): make `filter_files_by_extension` return only files (#2364)
dimxy pushed a commit that referenced this pull request Mar 5, 2025
* dev:
  feat(rpc): add is_success field to legacy MySwapStatusResponse (#2371)
  fix(key-derivation): use stored Argon2 parameters instead of default values (#2360)
  fix(tests): stabilize `tendermint_coin::test_claim_staking_rewards` (#2373)
  improvement(RPCs): group staking rpcs under a namespace (#2372)
  feat(tendermint): claim delegation rewards (#2351)
  fix(eth-tpu): remove state from funding validation (#2334)
  improvement(rpc-server): rpc server dynamic port allocation (#2342)
  fix(tests): fix or ignore unstable tests (#2365)
  fix(fs): make `filter_files_by_extension` return only files (#2364)
  fix(derive_key_from_path): check length of current_key_material (#2356)
  chore(release): bump mm2 version to 2.4.0-beta (#2346)
  fix(tests): add additional testnet sepolia nodes to test code (#2358)
  fix(swaps): maintain legacy compatibility for negotiation messages (#2353)
  refactor(SwapOps): impl defaults for protocol specific swapops fns (#2354)
  feat(tpu-v2): provide swap protocol versioning (#2324)
  feat(wallet): add change mnemonic password rpc (#2317)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants