Compare commits

...
Author SHA1 Message Date
i-norden 04ab6b6cfd bump go version 2023-03-30 16:50:34 -05:00
i-norden 288210a68c use stock v1.11.5 geth 2023-03-30 16:24:43 -05:00
Michael 92f55b9712 Merge pull request #54 from cerc-io/rebase-1.11-4-wip
version updates for 1.11.4 statediffing 4.3.8
2023-03-17 09:34:56 -04:00
Michael Shaw f25575e5cb version updates for 1.11.4 statediffing 4.3.8 2023-03-17 09:32:46 -04:00
Michael 6c59c0d1f1 Merge pull request #53 from cerc-io/rebase_1.11.2_wip
updated for geth v1.11.2-statediff-4.3.7-alpha
2023-03-10 12:18:47 -05:00
Michael Shaw 86e51e9518 updated for geth v1.11.2-statediff-4.3.7-alpha 2023-03-10 11:55:20 -05:00
Michael 68a24ab952 Merge pull request #48 from cerc-io/v4.0.10-alpha-wip
dependency updates for 1.10.26 geth release
2022-11-07 10:52:20 -05:00
Michael Shaw 806f5bbe26 dependency updates for 1.10.26 geth release 2022-11-07 10:25:21 -05:00
Michael Shaw 99cbb3b0c1 missed 23->25 change 2022-09-23 13:33:11 -04:00
Michael Shaw e3e8b2fbc1 dependency updates for geth-statediff 1.10.25 2022-09-23 13:26:57 -04:00
Michael 13c752b90e Merge pull request #47 from cerc-io/cerc_refactor
cerc github refactor
2022-09-14 13:54:28 -04:00
Michael Shaw f62c828c86 cerc github refactor 2022-09-14 01:03:07 -04:00
Michael b34f7e0564 Merge pull request #46 from vulcanize/rebase-1.10.23-wip
version update for statediffing geth 1.10.23
2022-09-01 16:11:49 -04:00
Michael Shaw 32edf85e5d version update for statediffing geth 1.10.23 2022-09-01 15:58:38 -04:00
prathamesh0 fd19af396d Log key on db misses (#45) 2022-08-23 12:14:42 +05:30
Michael b706c596c5 Merge pull request #44 from vulcanize/geth1.10.21-update-wip
Exchange.Interface no longer IsOnline and other updates for blockserv…
2022-08-01 17:06:21 -04:00
Michael Shaw 845d37cacf Exchange.Interface no longer IsOnline and other updates for blockservice version update 2022-08-01 17:05:18 -04:00
Michael 963053f23e Merge pull request #43 from vulcanize/geth1.10.21-update-wip
updating go.mod to depend on vulcanize fork of geth to avoid divergin…
2022-08-01 16:15:37 -04:00
Michael Shaw f1c3dfccd3 updating go.mod to depend on vulcanize fork of geth to avoid diverging dependencies that are needed higher up the stack 2022-08-01 15:59:24 -04:00
Michael 4a40d2b14e Merge pull request #42 from vulcanize/geth1.10.21-update-wip
go mod and sum updated for geth 1.10.21
2022-07-29 15:01:21 -04:00
Michael Shaw 77cc282a82 go mod and sum updated for geth 1.10.21 2022-07-29 14:57:24 -04:00
Abdul Rabbani f3de4233b7 Merge pull request #40 from vulcanize/feature/update-geth-1.10.19
Update and test
2022-06-17 08:16:51 -04:00
Abdul Rabbani 23177c8dff Update and test
```
08:09:45:~/GitHub/cerc/ipfs-ethdb go test ./... -v
=== RUN   TestIPFSETHDB
Running Suite: IPFS ethdb test
==============================
Random Seed: 1655467793
Will run 9 of 9 specs

•••••••••
Ran 9 of 9 Specs in 0.000 seconds
SUCCESS! -- 9 Passed | 0 Failed | 0 Pending | 0 Skipped
--- PASS: TestIPFSETHDB (0.00s)
PASS
ok      github.com/vulcanize/ipfs-ethdb/v4      0.177s
=== RUN   TestPGIPFSETHDB
Running Suite: PG-IPFS ethdb test
=================================
Random Seed: 1655467793
Will run 9 of 9 specs

•••••••••
Ran 9 of 9 Specs in 0.922 seconds
SUCCESS! -- 9 Passed | 0 Failed | 0 Pending | 0 Skipped
--- PASS: TestPGIPFSETHDB (0.92s)
PASS
ok      github.com/vulcanize/ipfs-ethdb/v4/postgres     1.157s
```
2022-06-17 08:10:46 -04:00
Abdul Rabbani 1c90257717 Merge pull request #39 from vulcanize/feature/update-go-version-sharding
Feature/update go version sharding
2022-05-31 13:03:11 -04:00
Abdul Rabbani 86b530c3a3 Merge branch 'master' into feature/update-go-version-sharding 2022-05-31 13:02:06 -04:00
Abdul Rabbani 0069033d39 Merge pull request #38 from vulcanize/feature/update-go-version
Use v1.18 go
2022-05-31 12:59:01 -04:00
Abdul Rabbani d22e0f70e2 Use v1.18 go 2022-05-31 12:58:33 -04:00
Abdul Rabbani b220685662 Merge pull request #37 from vulcanize/release-v3.0.2
Update Go version and Fix Interface
2022-05-31 07:35:26 -04:00
Abdul Rabbani 950fb0802d Update Go version and Fix Interface 2022-05-27 13:50:59 -04:00
10 changed files with 215 additions and 687 deletions
+3 -2
View File
@@ -17,6 +17,7 @@
package ipfsethdb package ipfsethdb
import ( import (
"context"
"errors" "errors"
"github.com/ethereum/go-ethereum/common" "github.com/ethereum/go-ethereum/common"
@@ -103,7 +104,7 @@ func (b *Batch) Write() error {
} }
puts[i] = b puts[i] = b
} }
if err := b.blockService.AddBlocks(puts); err != nil { if err := b.blockService.AddBlocks(context.Background(), puts); err != nil {
return err return err
} }
for _, key := range b.deleteCache.Keys() { for _, key := range b.deleteCache.Keys() {
@@ -112,7 +113,7 @@ func (b *Batch) Write() error {
if err != nil { if err != nil {
return err return err
} }
if err := b.blockService.DeleteBlock(c); err != nil { if err := b.blockService.DeleteBlock(context.Background(), c); err != nil {
return err return err
} }
} }
+1 -1
View File
@@ -25,7 +25,7 @@ import (
. "github.com/onsi/ginkgo" . "github.com/onsi/ginkgo"
. "github.com/onsi/gomega" . "github.com/onsi/gomega"
ipfsethdb "github.com/vulcanize/ipfs-ethdb/v4" ipfsethdb "github.com/cerc-io/ipfs-ethdb/v4"
) )
var ( var (
+9 -8
View File
@@ -20,7 +20,6 @@ import (
"context" "context"
"errors" "errors"
"fmt" "fmt"
"strconv"
"strings" "strings"
"github.com/ethereum/go-ethereum/ethdb" "github.com/ethereum/go-ethereum/ethdb"
@@ -69,7 +68,7 @@ func (d *Database) Has(key []byte) (bool, error) {
if err != nil { if err != nil {
return false, err return false, err
} }
return d.blockService.Blockstore().Has(c) return d.blockService.Blockstore().Has(context.Background(), c)
} }
// Get satisfies the ethdb.KeyValueReader interface // Get satisfies the ethdb.KeyValueReader interface
@@ -95,7 +94,7 @@ func (d *Database) Put(key []byte, value []byte) error {
if err != nil { if err != nil {
return err return err
} }
return d.blockService.AddBlock(b) return d.blockService.AddBlock(context.Background(), b)
} }
// Delete satisfies the ethdb.KeyValueWriter interface // Delete satisfies the ethdb.KeyValueWriter interface
@@ -106,7 +105,7 @@ func (d *Database) Delete(key []byte) error {
if err != nil { if err != nil {
return err return err
} }
return d.blockService.DeleteBlock(c) return d.blockService.DeleteBlock(context.Background(), c)
} }
// DatabaseProperty enum type // DatabaseProperty enum type
@@ -135,9 +134,6 @@ func (d *Database) Stat(property string) (string, error) {
return "", err return "", err
} }
switch prop { switch prop {
case ExchangeOnline:
online := d.blockService.Exchange().IsOnline()
return strconv.FormatBool(online), nil
default: default:
return "", fmt.Errorf("unhandled database property") return "", fmt.Errorf("unhandled database property")
} }
@@ -227,7 +223,7 @@ func (d *Database) AncientRange(kind string, start, count, maxBytes uint64) ([][
} }
// ReadAncients applies the provided AncientReader function // ReadAncients applies the provided AncientReader function
func (d *Database) ReadAncients(fn func(ethdb.AncientReader) error) (err error) { func (d *Database) ReadAncients(fn func(ethdb.AncientReaderOp) error) (err error) {
return errNotSupported return errNotSupported
} }
@@ -260,3 +256,8 @@ func (d *Database) MigrateTable(string, func([]byte) ([]byte, error)) error {
func (d *Database) NewSnapshot() (ethdb.Snapshot, error) { func (d *Database) NewSnapshot() (ethdb.Snapshot, error) {
return nil, errNotSupported return nil, errNotSupported
} }
// AncientDatadir returns an error as we don't have a backing chain freezer.
func (d *Database) AncientDatadir() (string, error) {
return "", errNotSupported
}
+1 -1
View File
@@ -26,7 +26,7 @@ import (
. "github.com/onsi/ginkgo" . "github.com/onsi/ginkgo"
. "github.com/onsi/gomega" . "github.com/onsi/gomega"
ipfsethdb "github.com/vulcanize/ipfs-ethdb/v4" ipfsethdb "github.com/cerc-io/ipfs-ethdb/v4"
) )
var ( var (
+60 -11
View File
@@ -1,22 +1,71 @@
module github.com/vulcanize/ipfs-ethdb/v4 module github.com/cerc-io/ipfs-ethdb/v4
go 1.15 go 1.19
require ( require (
github.com/btcsuite/btcd v0.22.1 // indirect github.com/ethereum/go-ethereum v1.11.5
github.com/btcsuite/btcd/btcec/v2 v2.2.0 // indirect
github.com/ethereum/go-ethereum v1.10.17
github.com/hashicorp/golang-lru v0.5.5-0.20210104140557-80c98217689d github.com/hashicorp/golang-lru v0.5.5-0.20210104140557-80c98217689d
github.com/ipfs/go-block-format v0.0.3 github.com/ipfs/go-block-format v0.0.3
github.com/ipfs/go-blockservice v0.1.3 github.com/ipfs/go-blockservice v0.4.0
github.com/ipfs/go-cid v0.0.7 github.com/ipfs/go-cid v0.2.0
github.com/ipfs/go-ipfs-blockstore v1.0.1 github.com/ipfs/go-ipfs-blockstore v1.2.0
github.com/ipfs/go-ipfs-ds-help v1.0.0 github.com/ipfs/go-ipfs-ds-help v1.1.0
github.com/ipfs/go-ipfs-exchange-interface v0.0.1 github.com/ipfs/go-ipfs-exchange-interface v0.2.0
github.com/jmoiron/sqlx v1.3.5 github.com/jmoiron/sqlx v1.3.5
github.com/lib/pq v1.10.5 github.com/lib/pq v1.10.7
github.com/mailgun/groupcache/v2 v2.3.0 github.com/mailgun/groupcache/v2 v2.3.0
github.com/multiformats/go-multihash v0.1.0 github.com/multiformats/go-multihash v0.1.0
github.com/onsi/ginkgo v1.16.5 github.com/onsi/ginkgo v1.16.5
github.com/onsi/gomega v1.19.0 github.com/onsi/gomega v1.19.0
github.com/sirupsen/logrus v1.6.0
)
require github.com/btcsuite/btcd/btcec/v2 v2.2.0 // indirect
require (
github.com/btcsuite/btcd v0.22.0-beta // indirect
github.com/decred/dcrd/dcrec/secp256k1/v4 v4.0.1 // indirect
github.com/fsnotify/fsnotify v1.6.0 // indirect
github.com/go-logr/logr v1.2.3 // indirect
github.com/go-logr/stdr v1.2.2 // indirect
github.com/gogo/protobuf v1.3.2 // indirect
github.com/golang/protobuf v1.5.2 // indirect
github.com/google/uuid v1.3.0 // indirect
github.com/holiman/uint256 v1.2.0 // indirect
github.com/ipfs/bbloom v0.0.4 // indirect
github.com/ipfs/go-datastore v0.5.0 // indirect
github.com/ipfs/go-ipfs-util v0.0.2 // indirect
github.com/ipfs/go-ipld-format v0.4.0 // indirect
github.com/ipfs/go-log v1.0.5 // indirect
github.com/ipfs/go-log/v2 v2.3.0 // indirect
github.com/ipfs/go-metrics-interface v0.0.1 // indirect
github.com/ipfs/go-verifcid v0.0.1 // indirect
github.com/jbenet/goprocess v0.1.4 // indirect
github.com/klauspost/cpuid/v2 v2.0.9 // indirect
github.com/konsorten/go-windows-terminal-sequences v1.0.3 // indirect
github.com/mattn/go-isatty v0.0.16 // indirect
github.com/minio/blake2b-simd v0.0.0-20160723061019-3f5f724cb5b1 // indirect
github.com/minio/sha256-simd v1.0.0 // indirect
github.com/mr-tron/base58 v1.2.0 // indirect
github.com/multiformats/go-base32 v0.0.3 // indirect
github.com/multiformats/go-base36 v0.1.0 // indirect
github.com/multiformats/go-multibase v0.0.3 // indirect
github.com/multiformats/go-varint v0.0.6 // indirect
github.com/nxadm/tail v1.4.8 // indirect
github.com/opentracing/opentracing-go v1.2.0 // indirect
github.com/segmentio/fasthash v1.0.3 // indirect
github.com/spaolacci/murmur3 v1.1.0 // indirect
go.opentelemetry.io/otel v1.7.0 // indirect
go.opentelemetry.io/otel/trace v1.7.0 // indirect
go.uber.org/atomic v1.7.0 // indirect
go.uber.org/multierr v1.6.0 // indirect
go.uber.org/zap v1.16.0 // indirect
golang.org/x/crypto v0.6.0 // indirect
golang.org/x/net v0.6.0 // indirect
golang.org/x/sys v0.5.0 // indirect
golang.org/x/text v0.7.0 // indirect
google.golang.org/protobuf v1.28.1 // indirect
gopkg.in/tomb.v1 v1.0.0-20141024135613-dd632973f1e7 // indirect
gopkg.in/yaml.v2 v2.4.0 // indirect
lukechampine.com/blake3 v1.1.6 // indirect
) )
+111 -646
View File
File diff suppressed because it is too large Load Diff
+14 -14
View File
@@ -52,27 +52,27 @@ func (mbs *MockBlockservice) Exchange() exchange.Interface {
panic("Exchange: implement me") panic("Exchange: implement me")
} }
func (mbs *MockBlockservice) AddBlock(b blocks.Block) error { func (mbs *MockBlockservice) AddBlock(ctx context.Context, b blocks.Block) error {
return mbs.blockStore.Put(b) return mbs.blockStore.Put(ctx, b)
} }
func (mbs *MockBlockservice) AddBlocks(bs []blocks.Block) error { func (mbs *MockBlockservice) AddBlocks(ctx context.Context, bs []blocks.Block) error {
return mbs.blockStore.PutMany(bs) return mbs.blockStore.PutMany(ctx, bs)
} }
func (mbs *MockBlockservice) DeleteBlock(c cid.Cid) error { func (mbs *MockBlockservice) DeleteBlock(ctx context.Context, c cid.Cid) error {
return mbs.blockStore.DeleteBlock(c) return mbs.blockStore.DeleteBlock(ctx, c)
} }
func (mbs *MockBlockservice) GetBlock(ctx context.Context, c cid.Cid) (blocks.Block, error) { func (mbs *MockBlockservice) GetBlock(ctx context.Context, c cid.Cid) (blocks.Block, error) {
return mbs.blockStore.Get(c) return mbs.blockStore.Get(ctx, c)
} }
func (mbs *MockBlockservice) GetBlocks(ctx context.Context, cs []cid.Cid) <-chan blocks.Block { func (mbs *MockBlockservice) GetBlocks(ctx context.Context, cs []cid.Cid) <-chan blocks.Block {
blockChan := make(chan blocks.Block) blockChan := make(chan blocks.Block)
go func() { go func() {
for _, c := range cs { for _, c := range cs {
if b, err := mbs.blockStore.Get(c); err == nil { if b, err := mbs.blockStore.Get(ctx, c); err == nil {
blockChan <- b blockChan <- b
} }
} }
@@ -93,17 +93,17 @@ type MockBlockstore struct {
err error err error
} }
func (mbs *MockBlockstore) DeleteBlock(c cid.Cid) error { func (mbs *MockBlockstore) DeleteBlock(ctx context.Context, c cid.Cid) error {
delete(mbs.blocks, c.String()) delete(mbs.blocks, c.String())
return mbs.err return mbs.err
} }
func (mbs *MockBlockstore) Has(c cid.Cid) (bool, error) { func (mbs *MockBlockstore) Has(ctx context.Context, c cid.Cid) (bool, error) {
_, ok := mbs.blocks[c.String()] _, ok := mbs.blocks[c.String()]
return ok, mbs.err return ok, mbs.err
} }
func (mbs *MockBlockstore) Get(c cid.Cid) (blocks.Block, error) { func (mbs *MockBlockstore) Get(ctx context.Context, c cid.Cid) (blocks.Block, error) {
obj, ok := mbs.blocks[c.String()] obj, ok := mbs.blocks[c.String()]
if !ok { if !ok {
return nil, blockNotFoundErr return nil, blockNotFoundErr
@@ -111,7 +111,7 @@ func (mbs *MockBlockstore) Get(c cid.Cid) (blocks.Block, error) {
return obj, mbs.err return obj, mbs.err
} }
func (mbs *MockBlockstore) GetSize(c cid.Cid) (int, error) { func (mbs *MockBlockstore) GetSize(ctx context.Context, c cid.Cid) (int, error) {
obj, ok := mbs.blocks[c.String()] obj, ok := mbs.blocks[c.String()]
if !ok { if !ok {
return 0, blockNotFoundErr return 0, blockNotFoundErr
@@ -119,12 +119,12 @@ func (mbs *MockBlockstore) GetSize(c cid.Cid) (int, error) {
return len(obj.RawData()), mbs.err return len(obj.RawData()), mbs.err
} }
func (mbs *MockBlockstore) Put(b blocks.Block) error { func (mbs *MockBlockstore) Put(ctx context.Context, b blocks.Block) error {
mbs.blocks[b.Cid().String()] = b mbs.blocks[b.Cid().String()] = b
return mbs.err return mbs.err
} }
func (mbs *MockBlockstore) PutMany(bs []blocks.Block) error { func (mbs *MockBlockstore) PutMany(ctx context.Context, bs []blocks.Block) error {
for _, b := range bs { for _, b := range bs {
mbs.blocks[b.Cid().String()] = b mbs.blocks[b.Cid().String()] = b
} }
+1 -1
View File
@@ -27,7 +27,7 @@ import (
. "github.com/onsi/ginkgo" . "github.com/onsi/ginkgo"
. "github.com/onsi/gomega" . "github.com/onsi/gomega"
pgipfsethdb "github.com/vulcanize/ipfs-ethdb/v4/postgres" pgipfsethdb "github.com/cerc-io/ipfs-ethdb/v4/postgres"
) )
var ( var (
+14 -2
View File
@@ -18,6 +18,7 @@ package pgipfsethdb
import ( import (
"context" "context"
"database/sql"
"errors" "errors"
"fmt" "fmt"
"math/big" "math/big"
@@ -28,6 +29,7 @@ import (
"github.com/ethereum/go-ethereum/ethdb" "github.com/ethereum/go-ethereum/ethdb"
"github.com/jmoiron/sqlx" "github.com/jmoiron/sqlx"
"github.com/mailgun/groupcache/v2" "github.com/mailgun/groupcache/v2"
log "github.com/sirupsen/logrus"
) )
var errNotSupported = errors.New("this operation is not supported") var errNotSupported = errors.New("this operation is not supported")
@@ -113,7 +115,12 @@ func (d *Database) Has(key []byte) (bool, error) {
// Get retrieves the given key if it's present in the key-value data store // Get retrieves the given key if it's present in the key-value data store
func (d *Database) dbGet(key string) ([]byte, error) { func (d *Database) dbGet(key string) ([]byte, error) {
var data []byte var data []byte
return data, d.db.Get(&data, getPgStr, key) err := d.db.Get(&data, getPgStr, key)
if err == sql.ErrNoRows {
log.Warn("Database miss for key", key)
}
return data, err
} }
// Get satisfies the ethdb.KeyValueReader interface // Get satisfies the ethdb.KeyValueReader interface
@@ -314,7 +321,7 @@ func (d *Database) AncientRange(kind string, start, count, maxBytes uint64) ([][
} }
// ReadAncients applies the provided AncientReader function // ReadAncients applies the provided AncientReader function
func (d *Database) ReadAncients(fn func(ethdb.AncientReader) error) (err error) { func (d *Database) ReadAncients(fn func(ethdb.AncientReaderOp) error) (err error) {
return errNotSupported return errNotSupported
} }
@@ -347,3 +354,8 @@ func (d *Database) MigrateTable(string, func([]byte) ([]byte, error)) error {
func (d *Database) NewSnapshot() (ethdb.Snapshot, error) { func (d *Database) NewSnapshot() (ethdb.Snapshot, error) {
return nil, errNotSupported return nil, errNotSupported
} }
// AncientDatadir returns an error as we don't have a backing chain freezer.
func (d *Database) AncientDatadir() (string, error) {
return "", errNotSupported
}
+1 -1
View File
@@ -28,7 +28,7 @@ import (
. "github.com/onsi/ginkgo" . "github.com/onsi/ginkgo"
. "github.com/onsi/gomega" . "github.com/onsi/gomega"
pgipfsethdb "github.com/vulcanize/ipfs-ethdb/v4/postgres" pgipfsethdb "github.com/cerc-io/ipfs-ethdb/v4/postgres"
) )
var ( var (