forked from evmos/ethermint
-
Notifications
You must be signed in to change notification settings - Fork 44
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Problem: transient store usage not compatible with parallel tx execut…
…ion (#450) * Problem: transient store usage not compatible with parallel tx execution Currently we use shared transient store keys to accumulate some states, which cause issues when developing parallel tx execution Solution: - remove some transient stores. - the others are used in a per-tx fasion. Update CHANGELOG.md Signed-off-by: yihuang <[email protected]> cleanup fix test * fix * cleanup
- Loading branch information
Showing
20 changed files
with
175 additions
and
139 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
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,21 @@ | ||
package app | ||
|
||
import ( | ||
"context" | ||
|
||
storetypes "cosmossdk.io/store/types" | ||
abci "github.com/cometbft/cometbft/abci/types" | ||
evmtypes "github.com/evmos/ethermint/x/evm/types" | ||
) | ||
|
||
func DefaultTxExecutor(_ context.Context, | ||
blockSize int, | ||
ms storetypes.MultiStore, | ||
deliverTxWithMultiStore func(int, storetypes.MultiStore) *abci.ExecTxResult, | ||
) ([]*abci.ExecTxResult, error) { | ||
results := make([]*abci.ExecTxResult, blockSize) | ||
for i := 0; i < blockSize; i++ { | ||
results[i] = deliverTxWithMultiStore(i, ms) | ||
} | ||
return evmtypes.PatchTxResponses(results), nil | ||
} |
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,27 @@ | ||
package keeper | ||
|
||
import ( | ||
"math/big" | ||
|
||
"cosmossdk.io/store/prefix" | ||
sdk "github.com/cosmos/cosmos-sdk/types" | ||
"github.com/evmos/ethermint/x/evm/types" | ||
) | ||
|
||
func (k Keeper) SetTxBloom(ctx sdk.Context, bloom []byte) { | ||
store := ctx.KVStore(k.transientKey) | ||
store.Set(types.TransientBloomKey(ctx.TxIndex(), ctx.MsgIndex()), bloom) | ||
} | ||
|
||
func (k Keeper) CollectTxBloom(ctx sdk.Context) { | ||
store := prefix.NewStore(ctx.KVStore(k.transientKey), types.KeyPrefixTransientBloom) | ||
it := store.Iterator(nil, nil) | ||
defer it.Close() | ||
|
||
bloom := new(big.Int) | ||
for ; it.Valid(); it.Next() { | ||
bloom.Or(bloom, big.NewInt(0).SetBytes(it.Value())) | ||
} | ||
|
||
k.EmitBlockBloomEvent(ctx, bloom.Bytes()) | ||
} |
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.