Internals Transactions - beatoz/beatoz-go GitHub Wiki
Note
Do not use dark mode. The following diagram is optimized for light mode.
%%{
initialize: {
'theme': 'default',
'sequence': {
'showSequenceNumbers':true,
'mirrorActors': false,
'wrap': true
}
}
}%%
sequenceDiagram
participant tm as BlockExecutor
box rgba(0,0,0,0.2) Beatoz
participant client as beatozLocalClient
participant app as BeatozApp
end
tm ->> tm: execBlockOnProxyApp
activate tm
loop Execute Txs
tm ->>+ client: DeliverAsyncTx
client ->>+ app: DeliverTx
app ->> app: Exeucte Tx
app -->>- client: result
client ->>+ tm: callback(result)
tm -->>- client:
client -->>- tm: <br/>
end
tm ->>+ client: EndBlockSync
client ->>+ app: EndBlock
app -->>- client: result
client -->>- tm: result
deactivate tm
%%{
init: {
'theme': 'default',
'sequence': {
'showSequenceNumbers':true,
'mirrorActors': false,
'wrap': true
}
}
}%%
sequenceDiagram
participant tm as BlockExecutor
box rgba(0,0,0,0.2) Beatoz
participant client as beatozLocalClient
participant app as BeatozApp
participant txp as TxPreparer
end
tm ->> tm: execBlockOnProxyApp
activate tm
loop Add Txs
rect cyan
tm ->>+ client: DeliverAsyncTx
client -)+ txp: Add
txp -->>- client: return nil
client -->>- tm: reutrn nil
end
end
par create TrxContexts for all txs added
rect cyan
txp ->> app: asyncPrepareTrxContext
end
end
tm ->>+ client: EndBlockSync
client ->> txp: Wait for finishing TrxContext creation.
client ->> txp: Get TrxContexts
loop Execute Txs
rect cyan
client ->>+ app: asyncExecTrxContext
app ->> app: Execute Tx
app -->>- client: result
client ->> tm: callback(result)
activate tm
deactivate tm
end
end
client ->>+ app: EndBlock
app -->>- client: result
client -->>- tm: result
deactivate tm