From 90217e23134f588ed0bd7c5308ff209346a05d2b Mon Sep 17 00:00:00 2001 From: rigelrozanski Date: Wed, 14 Nov 2018 15:14:34 -0500 Subject: [PATCH] docs and pending --- PENDING.md | 3 +- docs/spec/baseapp/WIP_abci_application.md | 46 +++++++++++++++++++++++ 2 files changed, 48 insertions(+), 1 deletion(-) create mode 100644 docs/spec/baseapp/WIP_abci_application.md diff --git a/PENDING.md b/PENDING.md index 52bf8a7ee..49a66c79d 100644 --- a/PENDING.md +++ b/PENDING.md @@ -33,7 +33,8 @@ FEATURES for getting governance parameters. * SDK - * [simulator] \#2682 MsgEditValidator now looks at the validator's max rate, thus it now succeeds a significant portion of the time + * [simulator] \#2682 MsgEditValidator now looks at the validator's max rate, thus it now succeeds a significant portion of the time + * [core] \#2775 Add deliverTx maximum block gas limit * Tendermint diff --git a/docs/spec/baseapp/WIP_abci_application.md b/docs/spec/baseapp/WIP_abci_application.md new file mode 100644 index 000000000..52f0ab18d --- /dev/null +++ b/docs/spec/baseapp/WIP_abci_application.md @@ -0,0 +1,46 @@ +# ABCI application + +The `BaseApp` struct fulfills the tendermint-abci `Application` interface. + +## Info + +## SetOption + +## Query + +## CheckTx + +## InitChain +TODO pseudo code + +During chain initialization InitChain runs the initialization logic directly on +the CommitMultiStore and commits it. The deliver and check states are +initialized with the ChainID. Additionally the Block gas meter is initialized +with an infinite amount of gas to run any genesis transactions. + +Note that we do not `Commit` during `InitChain` however BeginBlock for block 1 +starts from this deliverState. + + +## BeginBlock +TODO complete description & pseudo code + +The block gas meter is reset within BeginBlock for the deliver state. +If no maximum block gas is set within baseapp then an infinite +gas meter is set, otherwise a gas meter with the baseapp `maximumBlockGas` +is initialized + +## DeliverTx +TODO complete description & pseudo code + +Before transaction logic is run, the `BlockGasMeter` is first checked for +remaining gas. If no gas remains, then `DeliverTx` immediately returns an error. + +After the transaction has been processed the used gas is deducted from the +BlockGasMeter. If the remaining gas exceeds the meter's limits, then DeliverTx +returns an error and the transaction is not committed. + +## EndBlock + +## Commit +