solana icon indicating copy to clipboard operation
solana copied to clipboard

RPC-SendTransactionService channel: remove Arc-Mutex wrapper

Open apfitzge opened this issue 5 months ago • 3 comments

Problem

  • The channel between rpc and send-transaction-service is unneccessarily behind a mutex lock
  • Crossbeam channels are designed to be used concurrently, no need to hide them behind a lock

Summary of Changes

  • Remove mutex lock
  • Remove arc wrapper (no longer necessary without mutex)

Fixes #

apfitzge avatar Feb 05 '24 21:02 apfitzge

the mutex is required, so we would be able to drop transactions that are already in process https://github.com/solana-labs/solana/blob/9dca15a5b7a6e0938e45b3249156d84b51832c27/send-transaction-service/src/send_transaction_service.rs#L434-L451

it's possible to drop mutex in send thread and retry thread would be merged

fanatid avatar Feb 06 '24 01:02 fanatid

the mutex is required, so we would be able to drop transactions that are already in process

https://github.com/solana-labs/solana/blob/9dca15a5b7a6e0938e45b3249156d84b51832c27/send-transaction-service/src/send_transaction_service.rs#L434-L451

it's possible to drop mutex in send thread and retry thread would be merged

This PR is removing a mutex on the channel from rpc to sts. The lock you're referring to is on the map of transactions in STS (initial sending thread and retry thread), and is not being touched.

Removing the mutex on channel just allows multiple RPC threads to add transactions to the channel concurrently. If duplicates are added by RPC threads, the dups will be dropped in initial receiving as they are currently, the only difference is the RPC thread isn't blocked on inserting into the channel.

apfitzge avatar Feb 16 '24 19:02 apfitzge

ops, sorry looks like I looked at something else :upside_down_face:

fanatid avatar Feb 16 '24 19:02 fanatid

This repository is no longer in use. Please re-open this pull request in the agave repo: https://github.com/anza-xyz/agave

willhickey avatar Mar 03 '24 04:03 willhickey