Skip to content
This repository has been archived by the owner on Apr 4, 2024. It is now read-only.

stateDB txlog store enhancement #461

Merged
merged 18 commits into from
Aug 31, 2021
Prev Previous commit
Next Next commit
handle the logs length in SetLogs
JayT106 committed Aug 30, 2021
commit e65384b13081590f3be95008a9334cca56dc41db
7 changes: 6 additions & 1 deletion x/evm/keeper/keeper.go
Original file line number Diff line number Diff line change
@@ -301,7 +301,12 @@ func (k Keeper) SetLogs(txHash common.Hash, logs []*ethtypes.Log) {
len := len(logs)

if len > 65535 {
//TODO: to log a warning, but still allows to store the logs?
k.Logger(k.Ctx()).Error(
"cannot store more than 65535 logs in a transaction",
"txhash", txHash.String(),
"log-length", len,
)
return
} else if len > 0 {
s := prefix.NewStore(k.Ctx().KVStore(k.storeKey), types.KeyPrefixTxLogCount)