Skip to content
This repository was archived by the owner on Apr 11, 2021. It is now read-only.
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions core/state_processor.go
Original file line number Diff line number Diff line change
Expand Up @@ -97,6 +97,9 @@ func ApplyTransaction(config *params.ChainConfig, bc ChainContext, author *commo
}
// Create a new context to be used in the EVM environment
context := NewEVMContext(msg, header, bc, author)
if vm.UsingOVM {
context.BlockNumber = msg.L1BlockNumber()
}
// Create a new environment which holds all relevant information
// about the transaction and calling mechanisms.
vmenv := vm.NewEVM(context, statedb, config, cfg)
Expand Down
16 changes: 8 additions & 8 deletions core/state_transition_ovm.go
Original file line number Diff line number Diff line change
Expand Up @@ -13,19 +13,19 @@ import (
var ZeroAddress = common.HexToAddress("0x0000000000000000000000000000000000000000")

type ovmTransaction struct {
Timestamp *big.Int "json:\"timestamp\""
BlockNumber *big.Int "json:\"blockNumber\""
L1QueueOrigin uint8 "json:\"l1QueueOrigin\""
L1TxOrigin common.Address "json:\"l1TxOrigin\""
Entrypoint common.Address "json:\"entrypoint\""
GasLimit *big.Int "json:\"gasLimit\""
Data []uint8 "json:\"data\""
Timestamp *big.Int `json:"timestamp"`
BlockNumber *big.Int `json:"blockNumber"`
L1QueueOrigin uint8 `json:"l1QueueOrigin"`
L1TxOrigin common.Address `json:"l1TxOrigin"`
Entrypoint common.Address `json:"entrypoint"`
GasLimit *big.Int `json:"gasLimit"`
Data []uint8 `json:"data"`
}

func toExecutionManagerRun(evm *vm.EVM, msg Message) (Message, error) {
tx := ovmTransaction{
evm.Context.Time,
evm.Context.BlockNumber, // TODO (what's the correct block number?)
msg.L1BlockNumber(),
uint8(msg.QueueOrigin().Uint64()),
*msg.L1MessageSender(),
*msg.To(),
Expand Down