hashgraph / hedera-services

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

Add consumer callbacks for system transactions as inputWires in `PlatformWiring` #16707

Open IvanKavaldzhiev opened 4 days ago

IvanKavaldzhiev commented 4 days ago

Problem

SwirldState API will be enhanced with changes in preHandle and handleConsensusRound, adding additional consumer as a callback. This callback should be properly integrated inside hedera.app by being populated with system transactions. These consumers should take the system transactions in a sychronized manner and pass them to StateSignatureCollector.

Solution

Add these consumers as wire definitions inside PlatformWiring. This will guarantee thread-safety of the transactions that are read. This can be done in the following manner:

  1. applicationTransactionPrehandlerWiring.outputWire can be soldiered to a preHandleConsumerCallback.inputWire
  2. stateSignatureCollectorWiring.inputWire for handlePreconsensusSignatures can be soldiered to the preHandleConsumerCallback.outputWire
  3. transactionHandlerWiring.outputWire can be soldiered to a handlerConsumerCallBack.inputWire
  4. stateSignatureCollectorWiring.inputWire for handlePostconsensusSignatures can be soldiered to the handlerConsumerCallBack.outputWire

Alternatives

No response