Skip to content

Commit

Permalink
Merge pull request #38 from Tenderly/nu/update-geth
Browse files Browse the repository at this point in the history
Update go-ethereum
  • Loading branch information
nebojsa94 authored Sep 8, 2021
2 parents 6a8f2cc + 6519a1f commit c2c13e6
Show file tree
Hide file tree
Showing 6 changed files with 79 additions and 84 deletions.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -209,7 +209,7 @@ exports: # running tenderly export will export local transaction to the provided
petersburg_block: 0 # (default 0)
istanbul_block: 0 # (default 0)
berlin_block: 0 # (default 0)
london_block: 0 # (default null)
london_block: 0 # (default 0)

my-company-network:
project_slug: company-account/my-other-project
Expand Down
24 changes: 17 additions & 7 deletions commands/evm/chain.go
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,7 @@ func newChain(header *types.Header, client *ethereum.Client, cachedHeaders map[i
Extra: header.Extra,
MixDigest: header.MixDigest,
Nonce: header.Nonce,
BaseFee: header.BaseFee,
}
if engine != nil {
h.Coinbase, _ = engine.Author(header)
Expand Down Expand Up @@ -78,13 +79,22 @@ func (c *Chain) GetHeader(hash common.Hash, number uint64) *types.Header {
}

header := &types.Header{
ParentHash: blockHeader.ParentHash(),
Root: blockHeader.StateRoot(),
Number: blockHeader.Number().Big(),
Time: blockHeader.Time().ToInt().Uint64(),
Difficulty: blockHeader.Difficulty().ToInt(),
GasLimit: blockHeader.GasLimit().ToInt().Uint64(),
Coinbase: blockHeader.Coinbase(),
ParentHash: blockHeader.ParentHash(),
UncleHash: blockHeader.UncleHash(),
Root: blockHeader.StateRoot(),
TxHash: blockHeader.TxHash(),
ReceiptHash: blockHeader.ReceiptHash(),
Bloom: blockHeader.Bloom(),
Number: blockHeader.Number().Big(),
Time: blockHeader.Time().ToInt().Uint64(),
Difficulty: blockHeader.Difficulty().ToInt(),
GasLimit: blockHeader.GasLimit().ToInt().Uint64(),
GasUsed: blockHeader.GasUsed().ToInt().Uint64(),
Coinbase: blockHeader.Coinbase(),
Extra: blockHeader.ExtraData(),
MixDigest: blockHeader.MixDigest(),
Nonce: blockHeader.Nonce(),
BaseFee: blockHeader.BaseFeePerGas().ToInt(),
}

if c.engine != nil {
Expand Down
8 changes: 8 additions & 0 deletions commands/evm/processor.go
Original file line number Diff line number Diff line change
Expand Up @@ -77,6 +77,13 @@ func (p *Processor) processTransactions(ethBlock tenderlyTypes.Block, ti int64,
author = &coinbase
}

if p.chainConfig.IsLondon(ethBlock.Number().Big()) && blockHeader.BaseFeePerGas() == nil {
return nil, userError.NewUserError(
errors.Wrap(err, "missing block base fee"),
fmt.Sprintf("Missing block base fee parameter for block %d, london hard fork is probabbly not activated.", ethBlock.Number().Big()),
)
}

header := types.Header{
Number: blockHeader.Number().Big(),
ParentHash: blockHeader.ParentHash(),
Expand All @@ -93,6 +100,7 @@ func (p *Processor) processTransactions(ethBlock tenderlyTypes.Block, ti int64,
Extra: blockHeader.ExtraData(),
MixDigest: blockHeader.MixDigest(),
Nonce: blockHeader.Nonce(),
BaseFee: blockHeader.BaseFeePerGas().ToInt(),
}

return p.applyTransactions(ethBlock.Hash(), ethBlock.Transactions()[:ti+1], stateDB, header, author, force)
Expand Down
2 changes: 1 addition & 1 deletion config/config.go
Original file line number Diff line number Diff line change
Expand Up @@ -100,7 +100,7 @@ var DefaultChainConfig = &ChainConfig{
PetersburgBlock: 0,
IstanbulBlock: 0,
BerlinBlock: 0,
//LondonBlock: 0,
LondonBlock: 0,
}

func (c *ChainConfig) Config() (*params.ChainConfig, error) {
Expand Down
19 changes: 3 additions & 16 deletions go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -7,36 +7,23 @@ require (
github.com/badoux/checkmail v0.0.0-20181210160741-9661bd69e9ad
github.com/briandowns/spinner v1.6.1
github.com/btcsuite/btcd v0.22.0-beta // indirect
github.com/coreos/bbolt v1.3.2 // indirect
github.com/coreos/etcd v3.3.13+incompatible // indirect
github.com/coreos/go-systemd v0.0.0-20190321100706-95778dfbb74e // indirect
github.com/coreos/pkg v0.0.0-20180928190104-399ea9e2e55f // indirect
github.com/deckarep/golang-set v1.7.1 // indirect
github.com/ethereum/go-ethereum v1.10.6
github.com/ethereum/go-ethereum v1.10.8
github.com/go-kit/kit v0.9.0 // indirect
github.com/gorilla/websocket v1.4.2
github.com/grpc-ecosystem/go-grpc-middleware v1.0.0 // indirect
github.com/grpc-ecosystem/go-grpc-prometheus v1.2.0 // indirect
github.com/hashicorp/go-version v1.2.0
github.com/jonboulle/clockwork v0.1.0 // indirect
github.com/juju/ansiterm v0.0.0-20180109212912-720a0952cc2a // indirect
github.com/konsorten/go-windows-terminal-sequences v1.0.3 // indirect
github.com/kr/pretty v0.2.0 // indirect
github.com/logrusorgru/aurora v0.0.0-20190803045625-94edacc10f9b
github.com/lunixbochs/vtclean v1.0.0 // indirect
github.com/manifoldco/promptui v0.3.0
github.com/mitchellh/go-homedir v1.1.0 // indirect
github.com/pkg/errors v0.9.1
github.com/sirupsen/logrus v1.4.2
github.com/soheilhy/cmux v0.1.4 // indirect
github.com/spf13/cobra v1.2.1
github.com/spf13/viper v1.8.1
github.com/tmc/grpc-websocket-proxy v0.0.0-20190109142713-0ad062ec5ee5 // indirect
github.com/xiang90/probing v0.0.0-20190116061207-43a291ad63a2 // indirect
go.etcd.io/bbolt v1.3.2 // indirect
golang.org/x/crypto v0.0.0-20210711020723-a769d52b0f97 // indirect
golang.org/x/sys v0.0.0-20210630005230-0f9fa26af87c // indirect
golang.org/x/crypto v0.0.0-20210817164053-32db794688a5 // indirect
golang.org/x/sys v0.0.0-20210906170528-6f6e22806c34 // indirect
gopkg.in/check.v1 v1.0.0-20190902080502-41f04d3bba15 // indirect
gopkg.in/resty.v1 v1.12.0 // indirect
gopkg.in/yaml.v3 v3.0.0-20210107192922-496545a6307b
)
Loading

0 comments on commit c2c13e6

Please sign in to comment.