Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix(comms/rpc): detect early close in all cases #4647

Conversation

sdbondi
Copy link
Member

@sdbondi sdbondi commented Sep 8, 2022

Description

  • fix(rpc/server): detect stream interrupt when waiting for responses from domain service and when sending any data
  • fix(rpc/client): detect early response stream drop while reading responses
  • fix(rpc): correct value for number of sessions per peer
  • fix(base_node/sync): use faster/simpler mutex for sync session tracking
  • fix(base-node): set force_sync_peers conf from base_node.force_sync_peers
  • tests(comms/rpc): test for session handling when a response stream with large messages is interrupted
  • fix(p2p/liveness): pong event returns the latency of the last ping/pong

Motivation and Context

Whenever sync latency exceeds the max, the client interrupts the stream. The server rarely picks this up and since only one sync session is allowed, the client node can not resume syncing from the same node.

fixes #4630
ref #4646 (fixes but duplicate config should be removed)
fixes #4636

How Has This Been Tested?

New previously failing the integration test, manually by syncing a new base node

@sdbondi sdbondi force-pushed the comms-rpc-detect-interuptions-in-all-cases branch from 8bf1d5f to 1bf647f Compare September 8, 2022 11:17
@stringhandler stringhandler merged commit 0125051 into tari-project:development Sep 8, 2022
@sdbondi sdbondi deleted the comms-rpc-detect-interuptions-in-all-cases branch September 8, 2022 11:25
sdbondi added a commit to sdbondi/tari that referenced this pull request Sep 16, 2022
* development: (72 commits)
  fix: reinsert transactions from failed block (tari-project#4675)
  fix: stray clippy error (tari-project#4685)
  fix(wallet): mark mined_height as null when pending outputs are cancelled (tari-project#4686)
  chore: updated dependancies (tari-project#4684)
  fix(p2p): remove DETACH flag usage (tari-project#4682)
  fix(comms): simplify and remove possibility of deadlock from pipelines and substream close (tari-project#4676)
  feat(ci): add default CI and FFI testing with custom dispatch (tari-project#4672)
  chore: remove broken test (tari-project#4678)
  fix: fix potential race condition between add_block and sync (tari-project#4677)
  fix deadlock (tari-project#4674)
  fix: add burn funds command to console wallet (see issue tari-project#4547) (tari-project#4655)
  v0.38.3
  fix: fee estimate (tari-project#4656)
  fix(comms/messaging): fix possible deadlock in outbound pipeline (tari-project#4657)
  fix: replace Luhn checksum with DammSum (tari-project#4639)
  fix(core/sync): handle deadline timeouts by changing peer (tari-project#4649)
  fix(ci): libtor build on Ubuntu (tari-project#4644)
  chore: fix log (tari-project#4634)
  v0.38.2
  fix(comms/rpc): detect early close in all cases (tari-project#4647)
  ...
@CjS77 CjS77 added the P-acks_required Process - Requires more ACKs or utACKs label Nov 11, 2022
@sdbondi sdbondi removed the P-acks_required Process - Requires more ACKs or utACKs label Nov 11, 2022
@agubarev agubarev mentioned this pull request Nov 21, 2022
stringhandler pushed a commit that referenced this pull request Nov 23, 2022
Description
---
Removed `max_randomx_vms` from `BaseNodeStateMachineConfig` and the config preset, now passing the initialized RandomXFactory in via the initializer, same for `bypass_range_proof_verification` but passing only the setting


Motivation and Context
---
#4909

There are a few duplicate config keys that exist in the base node config and the base node state machine config
meaning settings and behaviour could mismatch.

`base_node.max_randomx_vms` (this setting will not work)
`base_node.bypass_range_proof_verification` (this setting will not work)
`base_node.force_sync_peers` (this was fixed in #4647 but the fix is a bit hacky) 

https://github.com/tari-project/tari/blob/956b27954dda1f15f82bff0ba0ba0ee1f0880d2d/base_layer/core/src/base_node/state_machine_service/state_machine.rs#L52

https://github.com/tari-project/tari/blob/development/applications/tari_base_node/src/config.rs#L109

ref #4646

How Has This Been Tested?
---
manually
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
3 participants