This repository has been archived by the owner on Nov 30, 2021. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 160
evm: module specification #538
Merged
Merged
Changes from 1 commit
Commits
Show all changes
25 commits
Select commit
Hold shift + click to select a range
cfa4578
evm: module specification
fedekunze 7fb39ff
params and events
fedekunze 0d6501f
readme and messages
fedekunze d7f9b5b
minor updates
fedekunze fbfef66
Merge branch 'development' of github.com:ChainSafe/ethermint into fed…
fedekunze e9eb6d8
concepts
fedekunze 4bbe0ed
genesis state concept
fedekunze 66f8a12
begin and end block
fedekunze 66a30cc
Merge branch 'development' into fedekunze/evm-spec
fedekunze 21a4a77
merge develop
fedekunze 32c0f79
Merge branch 'development' into fedekunze/evm-spec
fedekunze 626f33a
Merge branch 'development' into fedekunze/evm-spec
fedekunze 2189e71
update parameters and genesis
fedekunze f7a00c4
state objects
fedekunze 79e574f
state table
fedekunze ef16558
use permalink
fedekunze 4305780
Merge branch 'development' into fedekunze/evm-spec
fedekunze ff6eaec
init and export genesis
fedekunze 14e56a5
Merge branch 'fedekunze/evm-spec' of https://github.com/cosmos/etherm…
fedekunze 1885e4b
update abci
fedekunze e26df43
extra eips param
fedekunze fecb670
Merge branch 'development' into fedekunze/evm-spec
fedekunze 285db3f
review comments
fedekunze ba8bff9
precision
fedekunze cce210a
link to photon doc
fedekunze File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
update abci
- Loading branch information
commit 1885e4bf0f87e162c83a933c13789a624f839c27
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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -7,9 +7,8 @@ import ( | |
|
||
sdk "github.com/cosmos/cosmos-sdk/types" | ||
|
||
"github.com/ethereum/go-ethereum/common" | ||
ethtypes "github.com/ethereum/go-ethereum/core/types" | ||
|
||
"github.com/cosmos/ethermint/x/evm/types" | ||
) | ||
|
||
// BeginBlock sets the block hash -> block height map for the previous block height | ||
|
@@ -22,7 +21,12 @@ func (k *Keeper) BeginBlock(ctx sdk.Context, req abci.RequestBeginBlock) { | |
// Gas costs are handled within msg handler so costs should be ignored | ||
ctx = ctx.WithGasMeter(sdk.NewInfiniteGasMeter()) | ||
|
||
k.SetBlockHash(ctx, req.Header.LastBlockId.GetHash(), req.Header.GetHeight()-1) | ||
// Set the hash -> height and height -> hash mapping. | ||
hash := req.Header.LastBlockId.GetHash() | ||
height := req.Header.GetHeight() - 1 | ||
|
||
k.SetHeightHash(ctx, uint64(height), common.BytesToHash(hash)) | ||
k.SetBlockHash(ctx, hash, height) | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Why not combine SetHeightHash and SetBlockHash into one function? |
||
|
||
// reset counters that are used on CommitStateDB.Prepare | ||
k.Bloom = big.NewInt(0) | ||
|
@@ -37,13 +41,6 @@ func (k Keeper) EndBlock(ctx sdk.Context, req abci.RequestEndBlock) []abci.Valid | |
// Gas costs are handled within msg handler so costs should be ignored | ||
ctx = ctx.WithGasMeter(sdk.NewInfiniteGasMeter()) | ||
|
||
// Set the hash for the current height. | ||
// NOTE: we set the hash here instead of on BeginBlock in order to set the final block prior to | ||
// an upgrade. If we set it on BeginBlock the last block from prior to the upgrade wouldn't be | ||
// included on the store. | ||
hash := types.HashFromContext(ctx) | ||
k.SetHeightHash(ctx, uint64(ctx.BlockHeight()), hash) | ||
|
||
// Update account balances before committing other parts of state | ||
k.UpdateAccounts(ctx) | ||
|
||
|
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
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
why is this no longer in
EndBlock
?There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
because the values won't be exported so there's no need to add it on the end block