hashgraph / hedera-services

Crypto, token, consensus, file, and smart contract services for the Hedera public ledger
Apache License 2.0
313 stars 137 forks source link

Tweak sync permit return condition #14427

Open litt3 opened 3 months ago

litt3 commented 3 months ago

Background

Problem

Proposal

lpetrovic05 commented 3 months ago

One issue I see is that if our permit count is 0, and we wait for all events to pass through the pipeline, we create a gap where we are getting new events. Between the time all events pass through, and we start getting new ones, we have to wait for a few round trips of sync to go by, and this is wasted time I think.

litt3 commented 3 months ago

One issue I see is that if our permit count is 0, and we wait for all events to pass through the pipeline, we create a gap where we are getting new events. Between the time all events pass through, and we start getting new ones, we have to wait for a few round trips of sync to go by, and this is wasted time I think.

With the current bottleneck being transaction handling (by a huge margin), I don't think there would be any wasted time. The counters only keep track of events in the intake pipeline, and don't impose any limitations on round handling. The only way that time would be wasted is if the delay you mention causes the transaction handler to operate at less than 100% utilization (which we'd certainly want to keep an eye on while evaluating performance of this change).