Skip to content

Commit

Permalink
Update to v5 schema
Browse files Browse the repository at this point in the history
  • Loading branch information
roysc committed Apr 12, 2023
1 parent cc53aa0 commit 08c9e62
Show file tree
Hide file tree
Showing 7 changed files with 27 additions and 53 deletions.
2 changes: 1 addition & 1 deletion cmd/validateTrie.go
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ import (
"github.com/spf13/cobra"
"github.com/spf13/viper"

validator "github.com/cerc-io/eth-ipfs-state-validator/v4/pkg"
validator "github.com/cerc-io/eth-ipfs-state-validator/v5/pkg"
)

// validateTrieCmd represents the validateTrie command
Expand Down
11 changes: 6 additions & 5 deletions go.mod
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
module github.com/cerc-io/eth-ipfs-state-validator/v4
module github.com/cerc-io/eth-ipfs-state-validator/v5

go 1.18

require (
github.com/cerc-io/ipfs-ethdb/v4 v4.0.13-alpha
github.com/cerc-io/ipfs-ethdb/v5 v5.0.0-alpha
github.com/ethereum/go-ethereum v1.11.5
github.com/ipfs/go-blockservice v0.5.0
github.com/ipfs/go-cid v0.3.2
Expand Down Expand Up @@ -31,6 +31,7 @@ require (
github.com/beorn7/perks v1.0.1 // indirect
github.com/blang/semver/v4 v4.0.0 // indirect
github.com/btcsuite/btcd/btcec/v2 v2.2.0 // indirect
github.com/btcsuite/btcd/chaincfg/chainhash v1.0.2 // indirect
github.com/cenkalti/backoff v2.2.1+incompatible // indirect
github.com/cenkalti/backoff/v4 v4.1.3 // indirect
github.com/cespare/xxhash/v2 v2.2.0 // indirect
Expand All @@ -52,7 +53,7 @@ require (
github.com/flynn/noise v1.0.0 // indirect
github.com/francoispqt/gojay v1.2.13 // indirect
github.com/fsnotify/fsnotify v1.6.0 // indirect
github.com/getsentry/sentry-go v0.17.0 // indirect
github.com/getsentry/sentry-go v0.18.0 // indirect
github.com/go-logr/logr v1.2.3 // indirect
github.com/go-logr/stdr v1.2.2 // indirect
github.com/go-ole/go-ole v1.2.6 // indirect
Expand Down Expand Up @@ -190,7 +191,7 @@ require (
github.com/polydawn/refmt v0.0.0-20201211092308-30ac6d18308e // indirect
github.com/prometheus/client_golang v1.14.0 // indirect
github.com/prometheus/client_model v0.3.0 // indirect
github.com/prometheus/common v0.37.1 // indirect
github.com/prometheus/common v0.39.0 // indirect
github.com/prometheus/procfs v0.9.0 // indirect
github.com/raulk/go-watchdog v1.3.0 // indirect
github.com/rogpeppe/go-internal v1.9.0 // indirect
Expand Down Expand Up @@ -238,4 +239,4 @@ require (
lukechampine.com/blake3 v1.1.7 // indirect
)

replace github.com/ethereum/go-ethereum v1.11.5 => github.com/cerc-io/go-ethereum v1.11.5-statediff-4.3.9-alpha
replace github.com/ethereum/go-ethereum v1.11.5 => github.com/cerc-io/go-ethereum v1.11.5-statediff-5.0.1-alpha
53 changes: 13 additions & 40 deletions go.sum

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion main.go
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ package main
import (
"github.com/sirupsen/logrus"

"github.com/cerc-io/eth-ipfs-state-validator/v4/cmd"
"github.com/cerc-io/eth-ipfs-state-validator/v5/cmd"
)

func main() {
Expand Down
6 changes: 3 additions & 3 deletions pkg/util_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ func PublishRaw(tx *sqlx.Tx, codec, mh uint64, raw []byte, blockNumber uint64) (
}
dbKey := dshelp.MultihashToDsKey(c.Hash())
prefixedKey := blockstore.BlockPrefix.String() + dbKey.String()
_, err = tx.Exec(`INSERT INTO public.blocks (key, data, block_number) VALUES ($1, $2, $3) ON CONFLICT DO NOTHING`, prefixedKey, raw, blockNumber)
_, err = tx.Exec(`INSERT INTO ipld.blocks (key, data, block_number) VALUES ($1, $2, $3) ON CONFLICT DO NOTHING`, prefixedKey, raw, blockNumber)
return c.String(), err
}

Expand All @@ -34,8 +34,8 @@ func RawdataToCid(codec uint64, rawdata []byte, multiHash uint64) (cid.Cid, erro
return c, nil
}

// ResetTestDB drops all rows in the test db public.blocks table
// ResetTestDB truncates all used tables from the test DB
func ResetTestDB(db *sqlx.DB) error {
_, err := db.Exec("DELETE FROM public.blocks")
_, err := db.Exec("TRUNCATE ipld.blocks")
return err
}
4 changes: 2 additions & 2 deletions pkg/validator.go
Original file line number Diff line number Diff line change
Expand Up @@ -37,8 +37,8 @@ import (
log "github.com/sirupsen/logrus"
"golang.org/x/sync/errgroup"

ipfsethdb "github.com/cerc-io/ipfs-ethdb/v4"
pgipfsethdb "github.com/cerc-io/ipfs-ethdb/v4/postgres"
ipfsethdb "github.com/cerc-io/ipfs-ethdb/v5"
pgipfsethdb "github.com/cerc-io/ipfs-ethdb/v5/postgres/v1"
nodeiter "github.com/ethereum/go-ethereum/trie/concurrent_iterator"
"github.com/ethereum/go-ethereum/trie/concurrent_iterator/tracker"
)
Expand Down
2 changes: 1 addition & 1 deletion pkg/validator_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ import (
. "github.com/onsi/ginkgo"
. "github.com/onsi/gomega"

validator "github.com/cerc-io/eth-ipfs-state-validator/v4/pkg"
validator "github.com/cerc-io/eth-ipfs-state-validator/v5/pkg"
)

var (
Expand Down

0 comments on commit 08c9e62

Please sign in to comment.