-
Notifications
You must be signed in to change notification settings - Fork 857
Flatten BeginBlock and remove nested logics #2522
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,61 @@ | ||
| package legacyabci | ||
|
|
||
| import ( | ||
| "time" | ||
|
|
||
| "github.com/cosmos/cosmos-sdk/telemetry" | ||
| sdk "github.com/cosmos/cosmos-sdk/types" | ||
| "github.com/cosmos/cosmos-sdk/x/capability" | ||
| capabilitykeeper "github.com/cosmos/cosmos-sdk/x/capability/keeper" | ||
| abci "github.com/tendermint/tendermint/abci/types" | ||
|
|
||
| "github.com/cosmos/cosmos-sdk/x/distribution" | ||
| distrkeeper "github.com/cosmos/cosmos-sdk/x/distribution/keeper" | ||
|
|
||
| "github.com/cosmos/cosmos-sdk/x/evidence" | ||
| evidencekeeper "github.com/cosmos/cosmos-sdk/x/evidence/keeper" | ||
| "github.com/cosmos/cosmos-sdk/x/slashing" | ||
| slashingkeeper "github.com/cosmos/cosmos-sdk/x/slashing/keeper" | ||
|
|
||
| "github.com/cosmos/cosmos-sdk/x/staking" | ||
| stakingkeeper "github.com/cosmos/cosmos-sdk/x/staking/keeper" | ||
| "github.com/cosmos/cosmos-sdk/x/upgrade" | ||
| upgradekeeper "github.com/cosmos/cosmos-sdk/x/upgrade/keeper" | ||
|
|
||
| ibcclient "github.com/cosmos/ibc-go/v3/modules/core/02-client" | ||
| ibckeeper "github.com/cosmos/ibc-go/v3/modules/core/keeper" | ||
| epochmodulekeeper "github.com/sei-protocol/sei-chain/x/epoch/keeper" | ||
| evmkeeper "github.com/sei-protocol/sei-chain/x/evm/keeper" | ||
| ) | ||
|
|
||
| type BeginBlockKeepers struct { | ||
| EpochKeeper *epochmodulekeeper.Keeper | ||
| UpgradeKeeper *upgradekeeper.Keeper | ||
| CapabilityKeeper *capabilitykeeper.Keeper | ||
| DistrKeeper *distrkeeper.Keeper | ||
| SlashingKeeper *slashingkeeper.Keeper | ||
| EvidenceKeeper *evidencekeeper.Keeper | ||
| StakingKeeper *stakingkeeper.Keeper | ||
| IBCKeeper *ibckeeper.Keeper | ||
| EvmKeeper *evmkeeper.Keeper | ||
| } | ||
|
|
||
| func BeginBlock( | ||
| ctx sdk.Context, | ||
| height int64, | ||
| votes []abci.VoteInfo, | ||
| byzantineValidators []abci.Misbehavior, | ||
| keepers BeginBlockKeepers, | ||
| ) { | ||
| defer telemetry.MeasureSince(time.Now(), "module", "total_begin_block") | ||
|
|
||
| keepers.EpochKeeper.BeginBlock(ctx) | ||
Check warningCode scanning / CodeQL Panic in BeginBock or EndBlock consensus methods Warning
path flow from Begin/EndBlock to a panic call
path flow from Begin/EndBlock to a panic call path flow from Begin/EndBlock to a panic call path flow from Begin/EndBlock to a panic call path flow from Begin/EndBlock to a panic call |
||
| upgrade.BeginBlocker(*keepers.UpgradeKeeper, ctx) | ||
Check warningCode scanning / CodeQL Panic in BeginBock or EndBlock consensus methods Warning
path flow from Begin/EndBlock to a panic call
path flow from Begin/EndBlock to a panic call path flow from Begin/EndBlock to a panic call path flow from Begin/EndBlock to a panic call path flow from Begin/EndBlock to a panic call |
||
| capability.BeginBlocker(ctx, *keepers.CapabilityKeeper) | ||
Check warningCode scanning / CodeQL Panic in BeginBock or EndBlock consensus methods Warning
path flow from Begin/EndBlock to a panic call
path flow from Begin/EndBlock to a panic call path flow from Begin/EndBlock to a panic call path flow from Begin/EndBlock to a panic call path flow from Begin/EndBlock to a panic call |
||
| distribution.BeginBlocker(ctx, votes, *keepers.DistrKeeper) | ||
Check warningCode scanning / CodeQL Panic in BeginBock or EndBlock consensus methods Warning
path flow from Begin/EndBlock to a panic call
path flow from Begin/EndBlock to a panic call path flow from Begin/EndBlock to a panic call path flow from Begin/EndBlock to a panic call path flow from Begin/EndBlock to a panic call |
||
| slashing.BeginBlocker(ctx, votes, *keepers.SlashingKeeper) | ||
Check warningCode scanning / CodeQL Panic in BeginBock or EndBlock consensus methods Warning
path flow from Begin/EndBlock to a panic call
path flow from Begin/EndBlock to a panic call path flow from Begin/EndBlock to a panic call path flow from Begin/EndBlock to a panic call path flow from Begin/EndBlock to a panic call |
||
| evidence.BeginBlocker(ctx, byzantineValidators, *keepers.EvidenceKeeper) | ||
Check warningCode scanning / CodeQL Panic in BeginBock or EndBlock consensus methods Warning
path flow from Begin/EndBlock to a panic call
path flow from Begin/EndBlock to a panic call path flow from Begin/EndBlock to a panic call path flow from Begin/EndBlock to a panic call path flow from Begin/EndBlock to a panic call |
||
| staking.BeginBlocker(ctx, *keepers.StakingKeeper) | ||
Check warningCode scanning / CodeQL Panic in BeginBock or EndBlock consensus methods Warning
path flow from Begin/EndBlock to a panic call
path flow from Begin/EndBlock to a panic call path flow from Begin/EndBlock to a panic call path flow from Begin/EndBlock to a panic call path flow from Begin/EndBlock to a panic call |
||
| ibcclient.BeginBlocker(ctx, keepers.IBCKeeper.ClientKeeper) | ||
| keepers.EvmKeeper.BeginBlock(ctx) | ||
Check warningCode scanning / CodeQL Panic in BeginBock or EndBlock consensus methods Warning
path flow from Begin/EndBlock to a panic call
path flow from Begin/EndBlock to a panic call path flow from Begin/EndBlock to a panic call path flow from Begin/EndBlock to a panic call path flow from Begin/EndBlock to a panic call |
||
| } | ||
Uh oh!
There was an error while loading. Please reload this page.