-
Notifications
You must be signed in to change notification settings - Fork 184
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge PR: partial concurrent for DeliverTxs (#1801)
* remove setUpdateCount * remove useless code * remove Mutex in DTTManager * remove unused import * check whether getTxFee is nil before call it * add log * add log for fee-collector * add break logic for replay * add log * add log * remove SetFeeCollector log * print info of commistStore * print commitstore info * add log * print SetCoins * remove unused import * remove 01 for addr * remove log * print SetCoins * print GasConsumed * check GlobalHeight before print log * print GasConsumed * close multi cache * remove log * add log * add log * add log * add log * change deliverTxsMode when do mock replay * remove log * deal with empty block * rerun no evm tx * add log * remove log * add log * print deliverState.ms * add log info * print account info * create module account for feeCollector before setcoins * add log * set nextTaskRoutine whether ready or not * optimize keepAliveTicker * updateFeeCollectorAccHandler in EndBlock * Stop keepAliveTicker * rerun all concurrent txs after cosmos tx finished * remove GetModuleAccount in updateFeeCollectorHandler * add log * add dttRoutineStepWaitRerun * sleep some time to wait account update finished * set prevTaskIndex on accountUpdated * stop keepAliveTicker before running serial * use rerunRoutines list * add log * add condition for ExtractNextSerialFromTicker * change keepAliveIntervalMS * reset nextTaskRoutine * remove reset * add condition for stop dttRoutine * add log * add log * disable FlagMultiCache * fix conflicts * print commitids * print commitIDs * print string * stop replay * print string * print setCoins * print setCoins * remove dirty code * add RunMsgFailed log * add RunMsgFailed info * add log * add log * add log * add log * add log * print gas info * add log * add log * add ConsumeGas * modify log * add consumeGas * remove log * set context without withXXX * add log * use GetAccountGas instead of TryAddGetAccountGas * remove log * remove log * remove log * add log * add log * add log * remove log * use defer to catch panic and recover * optimize judgement for !isEvm * use AddConsumeGasForSendCoins to consume gas * remove useless code * add log * remove log * revert defer-s in runtxWithInfo * add log * modify consumed gas for SendCoins to FeeCollector * add log * add log * add log * modify AddConsumeGasForSendCoins * add log * modify AddConsumeGasForSendCoins * use InfiniteGasMeter when GetModuleAccount * remove log * check writeGas * merge from pc-no-fee-collector * use FlagDeliverTxsExecMode * remove DeliverTxsExecMode * modify ut * remove log * optimize conditions for not rerun ante * tidy code * remove log * add intItem for conflictPair * remove log * add log * add log * add log * add log * set DeliverTxsMode in replay * optimize hasConflict * remove log * remove all log * remove log * remove comments * rewrite deductFees for ethGasConsume * update FeeCollector account before executing cosmos tx * optimize code * remove GetAccountBinarySize * remove parameter in ethGasConsume * rerun cosmos tx before running serial content * calculate replay duration and print it * modify ut for anteHandler * remove suite.app.SupplyKeeper.GetModuleAccount * add condition for not check rerun * optimize serialRoutine * add pin for RunMsg and Refund * add log * optimize logic for rerunRoutines * add FlagDeliverTxsConcurrentNum * add log * add log * do not calculate gas during updateFeeCollectorHandler * updateFeeCollectorAcc only when fee changed * remove log * remove unused import * remove parameter from SetAccount * fix ut for SetAccount * add condition for calling UpdateAccountInStateDB * use optional parameter in SetAccount (#1900) * use optional parameter in SetAccount * optimize accountUpdated func in DTTManager * first commit * Mz/pc option (#1901) * use optional parameter in SetAccount * optimize accountUpdated func in DTTManager * optimize OnAccountUpdated * use normal parameter in OnAccountUpdated * split functions in DTTManager * encapsulate conditions * set gasUsed 0 when ante failed * add log * use startRunMsg to judge whether ante failed or not * add log * delete unless code * fix build * remove log * remove log * fix ut bug * merge defer funcs * use recover when run ante * delete preWriteMs * split defer because of recover * take care of error from VerifySig * add comment * remove a condition for calling updateFeeCollectorAccHandler * Update store.go * upd * upd * use const * use cache in runTxModeDeliverPartConcurrent * splite defer func-s in serialExecution * fix conflict * remove check config for FlagDeliverTxsExecMode and FlagParalleledTx * Update baseapp_runtx.go * typ * address to string * delete modeHandlerDeliverPartConcurrent * support prerun * optimize code * revert changes for ParalleledTx * remove useless code * small modify * fix random panic * remove FlagParalleledTx * write ms cache after handleGasConsumed * modify stopChan * register dynamic config in repair * delete evmTxFeeHandler * fix ut Co-authored-by: KamiD <[email protected]> Co-authored-by: Zhong Qiu <[email protected]> Co-authored-by: chunfengSun <[email protected]> Co-authored-by: zhongqiuwood <[email protected]> Co-authored-by: xiangjianmeng <[email protected]>
- Loading branch information
1 parent
4926092
commit af9a55a
Showing
44 changed files
with
973 additions
and
167 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,38 @@ | ||
package app | ||
|
||
import ( | ||
"encoding/hex" | ||
sdk "github.com/okex/exchain/libs/cosmos-sdk/types" | ||
"github.com/okex/exchain/libs/cosmos-sdk/x/auth" | ||
authante "github.com/okex/exchain/libs/cosmos-sdk/x/auth/ante" | ||
evmtypes "github.com/okex/exchain/x/evm/types" | ||
"strings" | ||
) | ||
|
||
// getTxFeeAndFromHandler get tx fee and from | ||
func getTxFeeAndFromHandler(ak auth.AccountKeeper) sdk.GetTxFeeAndFromHandler { | ||
return func(ctx sdk.Context, tx sdk.Tx) (fee sdk.Coins, isEvm bool, from string, to string, err error) { | ||
if evmTx, ok := tx.(*evmtypes.MsgEthereumTx); ok { | ||
isEvm = true | ||
err = evmTx.VerifySig(evmTx.ChainID(), ctx.BlockHeight()) | ||
if err != nil { | ||
return | ||
} | ||
fee = evmTx.GetFee() | ||
from = evmTx.BaseTx.From | ||
if len(from) > 2 { | ||
from = strings.ToLower(from[2:]) | ||
} | ||
if evmTx.To() != nil { | ||
to = strings.ToLower(evmTx.To().String()[2:]) | ||
} | ||
} else if feeTx, ok := tx.(authante.FeeTx); ok { | ||
fee = feeTx.GetFee() | ||
feePayer := feeTx.FeePayer(ctx) | ||
feePayerAcc := ak.GetAccount(ctx, feePayer) | ||
from = hex.EncodeToString(feePayerAcc.GetAddress()) | ||
} | ||
|
||
return | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.