Skip to content

Commit

Permalink
docs: expand documentation
Browse files Browse the repository at this point in the history
Signed-off-by: Francisco de Borja Aranda Castillejo <borja@zetachain.com>
  • Loading branch information
Francisco de Borja Aranda Castillejo committed Jul 23, 2024
1 parent a5a3c14 commit 66c665b
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 2 deletions.
8 changes: 6 additions & 2 deletions x/evm/keeper/state_transition.go
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,11 @@ func (k *Keeper) NewEVM(
}

vmConfig := k.VMConfig(ctx, msg, cfg, tracer)

// rules are used to determine the active precompiles for the current block height.
// i.e rules.IsByzantium, rules.IsConstantinople, etc.
rules := cfg.ChainConfig.Rules(big.NewInt(ctx.BlockHeight()), cfg.ChainConfig.MergeNetsplitBlock != nil)

contracts := make(map[common.Address]vm.PrecompiledContract)
active := make([]common.Address, 0)

Expand Down Expand Up @@ -101,8 +105,8 @@ func (k *Keeper) NewEVM(
evm := vm.NewEVM(blockCtx, txCtx, stateDB, cfg.ChainConfig, vmConfig)

// Set the precompiled contracts:
// - contracts contains all the contracts.
// - active contains the addresses of the active contracts.
// - contracts contains all the precompiled contracts.
// - active contains *only* the addresses of the active precompiled contracts.
evm.WithPrecompiles(contracts, active)

return evm
Expand Down
2 changes: 2 additions & 0 deletions x/evm/statedb/native.go
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,8 @@ import (

var _ JournalEntry = nativeChange{}

// nativeChange represents a state change originated by an action executed by the EVM.
// It has to implement JournalEntry interface, so it can be appended to the chain journal.
type nativeChange struct {
snapshot types.MultiStore
events int
Expand Down

0 comments on commit 66c665b

Please sign in to comment.