From be5ed30749aa8509936f85ceac6f33ecc1e85588 Mon Sep 17 00:00:00 2001 From: philip-morlier Date: Thu, 16 Feb 2023 13:37:00 -0800 Subject: [PATCH 1/3] type and dependency adjustments to match geth v1.11.0 --- core/interface.go | 5 ++--- go.mod | 4 ++-- go.sum | 8 ++++---- 3 files changed, 8 insertions(+), 9 deletions(-) diff --git a/core/interface.go b/core/interface.go index 77450fb..c070df3 100644 --- a/core/interface.go +++ b/core/interface.go @@ -3,7 +3,6 @@ package core import ( "context" "math/big" - "time" "github.com/holiman/uint256" ) @@ -74,7 +73,7 @@ type TracerResult interface { CaptureStart(from Address, to Address, create bool, input []byte, gas uint64, value *big.Int) CaptureState(pc uint64, op OpCode, gas, cost uint64, scope ScopeContext, rData []byte, depth int, err error) CaptureFault(pc uint64, op OpCode, gas, cost uint64, scope ScopeContext, depth int, err error) - CaptureEnd(output []byte, gasUsed uint64, t time.Duration, err error) + CaptureEnd(output []byte, gasUsed uint64, err error) CaptureEnter(typ OpCode, from Address, to Address, input []byte, gas uint64, value *big.Int) CaptureExit(output []byte, gasUsed uint64, err error) Result() (interface{}, error) @@ -210,7 +209,7 @@ type BlockContext struct { Coinbase Address GasLimit uint64 BlockNumber *big.Int - Time *big.Int + Time uint64 Difficulty *big.Int BaseFee *big.Int } diff --git a/go.mod b/go.mod index c1bc7ff..2c8816b 100644 --- a/go.mod +++ b/go.mod @@ -9,8 +9,8 @@ require ( github.com/holiman/uint256 v1.2.0 github.com/jedisct1/go-minisign v0.0.0-20190909160543-45766022959e github.com/stretchr/testify v1.7.2 - golang.org/x/crypto v0.0.0-20210921155107-089bfa567519 - golang.org/x/sys v0.0.0-20220520151302-bc2c85ada10a + golang.org/x/crypto v0.1.0 + golang.org/x/sys v0.5.0 ) require ( diff --git a/go.sum b/go.sum index 3ba88be..981f65c 100644 --- a/go.sum +++ b/go.sum @@ -24,13 +24,13 @@ github.com/stretchr/testify v1.7.2 h1:4jaiDzPyXQvSd7D0EjG45355tLlV3VOECpq10pLC+8 github.com/stretchr/testify v1.7.2/go.mod h1:R6va5+xMeoiuVRoj+gSkQ7d3FALtqAAGI1FQKckRals= golang.org/x/crypto v0.0.0-20190308221718-c2843e01d9a2/go.mod h1:djNgcEr1/C05ACkg1iLfiJU5Ep61QUkGW8qpdssI0+w= golang.org/x/crypto v0.0.0-20190909091759-094676da4a83/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI= -golang.org/x/crypto v0.0.0-20210921155107-089bfa567519 h1:7I4JAnoQBe7ZtJcBaYHi5UtiO8tQHbUSXxL+pnGRANg= -golang.org/x/crypto v0.0.0-20210921155107-089bfa567519/go.mod h1:GvvjBRRGRdwPK5ydBHafDWAxML/pGHZbMvKqRZ5+Abc= +golang.org/x/crypto v0.1.0 h1:MDRAIl0xIo9Io2xV565hzXHw3zVseKrJKodhohM5CjU= +golang.org/x/crypto v0.1.0/go.mod h1:RecgLatLF4+eUMCP1PoPZQb+cVrJcOPbHkTkbkB9sbw= golang.org/x/net v0.0.0-20190404232315-eb5bcb51f2a3/go.mod h1:t9HGtf8HONx5eT2rtn7q6eTqICYqUVnKs3thJo3Qplg= golang.org/x/sys v0.0.0-20190215142949-d0b11bdaac8a/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= golang.org/x/sys v0.0.0-20190412213103-97732733099d/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20220520151302-bc2c85ada10a h1:dGzPydgVsqGcTRVwiLJ1jVbufYwmzD3LfVPLKsKg+0k= -golang.org/x/sys v0.0.0-20220520151302-bc2c85ada10a/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= +golang.org/x/sys v0.5.0 h1:MUK/U/4lj1t1oPg0HfuXDN/Z1wv31ZJ/YcPiGccS4DU= +golang.org/x/sys v0.5.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/text v0.3.0/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= gopkg.in/check.v1 v1.0.0-20180628173108-788fd7840127 h1:qIbj1fsPNlZgppZ+VLlY7N33q108Sa+fhmuc+sWQYwY= From 80b7d5ab5714f3daa36066dea340cce601e913b1 Mon Sep 17 00:00:00 2001 From: philip-morlier Date: Mon, 20 Feb 2023 10:53:26 -0800 Subject: [PATCH 2/3] Tracer interface restored to previous implementation to preserve tracer plugins. --- core/interface.go | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/core/interface.go b/core/interface.go index c070df3..0dc6266 100644 --- a/core/interface.go +++ b/core/interface.go @@ -3,6 +3,7 @@ package core import ( "context" "math/big" + "time" "github.com/holiman/uint256" ) @@ -69,11 +70,13 @@ type BlockTracer interface { PostProcessBlock(block Hash) } +// The implementation of CaptureEnd below diverges from foundation Geth, we pass dummy variables in PluGeth +// in order to preserve the implementation of the tracing plugins in Plugeth-Plugins. type TracerResult interface { CaptureStart(from Address, to Address, create bool, input []byte, gas uint64, value *big.Int) CaptureState(pc uint64, op OpCode, gas, cost uint64, scope ScopeContext, rData []byte, depth int, err error) CaptureFault(pc uint64, op OpCode, gas, cost uint64, scope ScopeContext, depth int, err error) - CaptureEnd(output []byte, gasUsed uint64, err error) + CaptureEnd(output []byte, gasUsed uint64, t time.Duration, err error) CaptureEnter(typ OpCode, from Address, to Address, input []byte, gas uint64, value *big.Int) CaptureExit(output []byte, gasUsed uint64, err error) Result() (interface{}, error) From 0a85922a7abbb5cd75ba35d721e69f06ac6d5633 Mon Sep 17 00:00:00 2001 From: philip-morlier Date: Mon, 20 Feb 2023 12:09:44 -0800 Subject: [PATCH 3/3] reverted BlockContext.Time to big.Int to preserve downstream plugins --- core/interface.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/core/interface.go b/core/interface.go index 0dc6266..48eb7e9 100644 --- a/core/interface.go +++ b/core/interface.go @@ -212,7 +212,7 @@ type BlockContext struct { Coinbase Address GasLimit uint64 BlockNumber *big.Int - Time uint64 + Time *big.Int Difficulty *big.Int BaseFee *big.Int }