Compare commits

..

14 Commits

Author SHA1 Message Date
6ea035f208 Update c-kzg-4844
Prevents conflict in dependent packages
2024-04-23 18:29:58 +08:00
b748b08558 Fix rlp package 2024-03-28 17:53:19 +08:00
2bd23e1f3c Merge remote-tracking branch 'upstream/master' into statediff-additions 2024-03-28 17:27:14 +08:00
AusIV
07f17cdd7e
Merge pull request #34 from openrelayxyz/hardfork/cancun
Hardfork/cancun
2024-01-22 14:46:08 -06:00
cd41de354c Fix various build errors and bugs
- bug in hex decoding in bls12381 package
- correct interfaces
- missing test variables
2023-07-07 00:01:22 +08:00
068e70f417 go mod tidy 2023-06-22 15:37:31 +08:00
1d3da8ce80 add GetContractCode 2023-06-22 15:20:28 +08:00
d8d1347863 conditionally link against geth's libsecp256k1 2023-06-14 21:42:22 +08:00
47ca0cc89f update TrieHasher 2023-06-14 21:42:22 +08:00
a6ae549ce2 copy effectivegasprice changes (871861) 2023-06-14 21:42:20 +08:00
de5e13f848 port consensus receipt encoding PR 2023-06-14 21:42:18 +08:00
8d228c14f6 add path encoding funcs 2023-06-14 19:22:23 +08:00
c89f6309f8 add trie iterators 2023-06-14 19:22:23 +08:00
0aa866f534 copyedit docs 2023-06-14 19:22:23 +08:00
13 changed files with 45 additions and 13 deletions

2
go.mod
View File

@ -7,7 +7,7 @@ require (
github.com/consensys/gnark-crypto v0.12.1 github.com/consensys/gnark-crypto v0.12.1
github.com/crate-crypto/go-kzg-4844 v0.7.0 github.com/crate-crypto/go-kzg-4844 v0.7.0
github.com/davecgh/go-spew v1.1.1 github.com/davecgh/go-spew v1.1.1
github.com/ethereum/c-kzg-4844/bindings/go v0.0.0-20230126171313-363c7d7593b4 github.com/ethereum/c-kzg-4844 v0.4.0
github.com/google/gofuzz v1.2.0 github.com/google/gofuzz v1.2.0
github.com/holiman/uint256 v1.2.4 github.com/holiman/uint256 v1.2.4
github.com/jedisct1/go-minisign v0.0.0-20230811132847-661be99b8267 github.com/jedisct1/go-minisign v0.0.0-20230811132847-661be99b8267

4
go.sum
View File

@ -18,8 +18,8 @@ github.com/decred/dcrd/crypto/blake256 v1.0.0 h1:/8DMNYp9SGi5f0w7uCm6d6M4OU2rGFK
github.com/decred/dcrd/crypto/blake256 v1.0.0/go.mod h1:sQl2p6Y26YV+ZOcSTP6thNdn47hh8kt6rqSlvmrXFAc= github.com/decred/dcrd/crypto/blake256 v1.0.0/go.mod h1:sQl2p6Y26YV+ZOcSTP6thNdn47hh8kt6rqSlvmrXFAc=
github.com/decred/dcrd/dcrec/secp256k1/v4 v4.0.1 h1:YLtO71vCjJRCBcrPMtQ9nqBsqpA1m5sE92cU+pd5Mcc= github.com/decred/dcrd/dcrec/secp256k1/v4 v4.0.1 h1:YLtO71vCjJRCBcrPMtQ9nqBsqpA1m5sE92cU+pd5Mcc=
github.com/decred/dcrd/dcrec/secp256k1/v4 v4.0.1/go.mod h1:hyedUtir6IdtD/7lIxGeCxkaw7y45JueMRL4DIyJDKs= github.com/decred/dcrd/dcrec/secp256k1/v4 v4.0.1/go.mod h1:hyedUtir6IdtD/7lIxGeCxkaw7y45JueMRL4DIyJDKs=
github.com/ethereum/c-kzg-4844/bindings/go v0.0.0-20230126171313-363c7d7593b4 h1:B2mpK+MNqgPqk2/KNi1LbqwtZDy5F7iy0mynQiBr8VA= github.com/ethereum/c-kzg-4844 v0.4.0 h1:3MS1s4JtA868KpJxroZoepdV0ZKBp3u/O5HcZ7R3nlY=
github.com/ethereum/c-kzg-4844/bindings/go v0.0.0-20230126171313-363c7d7593b4/go.mod h1:y4GA2JbAUama1S4QwYjC2hefgGLU8Ul0GMtL/ADMF1c= github.com/ethereum/c-kzg-4844 v0.4.0/go.mod h1:VewdlzQmpT5QSrVhbBuGoCdFJkpaJlO1aQputP83wc0=
github.com/go-stack/stack v1.8.1/go.mod h1:dcoOX6HbPZSZptuspn9bctJ+N/CnF5gGygcUP3XYfe4= github.com/go-stack/stack v1.8.1/go.mod h1:dcoOX6HbPZSZptuspn9bctJ+N/CnF5gGygcUP3XYfe4=
github.com/google/gofuzz v1.2.0 h1:xRy4A+RhZaiKjJ1bPfwQ8sedCA+YS2YcCHW6ec7JMi0= github.com/google/gofuzz v1.2.0 h1:xRy4A+RhZaiKjJ1bPfwQ8sedCA+YS2YcCHW6ec7JMi0=
github.com/google/gofuzz v1.2.0/go.mod h1:dBl0BpW6vV/+mYPU4Po3pmUjxk6FQPldtuIdl/M65Eg= github.com/google/gofuzz v1.2.0/go.mod h1:dBl0BpW6vV/+mYPU4Po3pmUjxk6FQPldtuIdl/M65Eg=

View File

@ -0,0 +1,31 @@
// Copyright 2014 The go-ethereum Authors
// This file is part of the go-ethereum library.
//
// The go-ethereum library is free software: you can redistribute it and/or modify
// it under the terms of the GNU Lesser General Public License as published by
// the Free Software Foundation, either version 3 of the License, or
// (at your option) any later version.
//
// The go-ethereum library is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU Lesser General Public License for more details.
//
// You should have received a copy of the GNU Lesser General Public License
// along with the go-ethereum library. If not, see <http://www.gnu.org/licenses/>.
package rlp
import (
"encoding/hex"
"fmt"
"strings"
)
func unhex(str string) []byte {
b, err := hex.DecodeString(strings.ReplaceAll(str, " ", ""))
if err != nil {
panic(fmt.Sprintf("invalid hex string: %q", str))
}
return b
}

View File

@ -27,7 +27,7 @@ import (
"golang.org/x/tools/go/packages" "golang.org/x/tools/go/packages"
) )
const pathOfPackageRLP = "github.com/ethereum/go-ethereum/rlp" const pathOfPackageRLP = "github.com/openrelayxyz/plugeth-utils/restricted/rlp"
func main() { func main() {
var ( var (

View File

@ -1,6 +1,6 @@
package test package test
import "github.com/ethereum/go-ethereum/rlp" import "github.com/openrelayxyz/plugeth-utils/restricted/rlp"
import "io" import "io"
func (obj *Test) EncodeRLP(_w io.Writer) error { func (obj *Test) EncodeRLP(_w io.Writer) error {

View File

@ -1,6 +1,6 @@
package test package test
import "github.com/ethereum/go-ethereum/rlp" import "github.com/openrelayxyz/plugeth-utils/restricted/rlp"
import "io" import "io"
func (obj *Test) EncodeRLP(_w io.Writer) error { func (obj *Test) EncodeRLP(_w io.Writer) error {

View File

@ -1,6 +1,6 @@
package test package test
import "github.com/ethereum/go-ethereum/rlp" import "github.com/openrelayxyz/plugeth-utils/restricted/rlp"
import "io" import "io"
func (obj *Test) EncodeRLP(_w io.Writer) error { func (obj *Test) EncodeRLP(_w io.Writer) error {

View File

@ -2,7 +2,7 @@
package test package test
import "github.com/ethereum/go-ethereum/rlp" import "github.com/openrelayxyz/plugeth-utils/restricted/rlp"
type Test struct { type Test struct {
RawValue rlp.RawValue RawValue rlp.RawValue

View File

@ -1,6 +1,6 @@
package test package test
import "github.com/ethereum/go-ethereum/rlp" import "github.com/openrelayxyz/plugeth-utils/restricted/rlp"
import "io" import "io"
func (obj *Test) EncodeRLP(_w io.Writer) error { func (obj *Test) EncodeRLP(_w io.Writer) error {

View File

@ -1,7 +1,7 @@
package test package test
import "github.com/ethereum/go-ethereum/rlp"
import "github.com/holiman/uint256" import "github.com/holiman/uint256"
import "github.com/openrelayxyz/plugeth-utils/restricted/rlp"
import "io" import "io"
func (obj *Test) EncodeRLP(_w io.Writer) error { func (obj *Test) EncodeRLP(_w io.Writer) error {

View File

@ -1,6 +1,6 @@
package test package test
import "github.com/ethereum/go-ethereum/rlp" import "github.com/openrelayxyz/plugeth-utils/restricted/rlp"
import "io" import "io"
func (obj *Test) EncodeRLP(_w io.Writer) error { func (obj *Test) EncodeRLP(_w io.Writer) error {

View File

@ -64,7 +64,7 @@ func prefixedRlpHash(prefix byte, x interface{}) (h core.Hash) {
// This is internal, do not use. // This is internal, do not use.
type TrieHasher interface { type TrieHasher interface {
Reset() Reset()
Update([]byte, []byte) Update([]byte, []byte) error
Hash() core.Hash Hash() core.Hash
} }

View File

@ -136,9 +136,10 @@ func (d *hashToHumanReadable) Reset() {
d.data = make([]byte, 0) d.data = make([]byte, 0)
} }
func (d *hashToHumanReadable) Update(i []byte, i2 []byte) { func (d *hashToHumanReadable) Update(i []byte, i2 []byte) error {
l := fmt.Sprintf("%x %x\n", i, i2) l := fmt.Sprintf("%x %x\n", i, i2)
d.data = append(d.data, []byte(l)...) d.data = append(d.data, []byte(l)...)
return nil
} }
func (d *hashToHumanReadable) Hash() core.Hash { func (d *hashToHumanReadable) Hash() core.Hash {