Compare commits
3
Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
ff87375f94 | ||
|
|
8d88f1bceb | ||
|
|
94640a8c78 |
@@ -0,0 +1,29 @@
|
||||
name: Notion Sync
|
||||
|
||||
on:
|
||||
workflow_dispatch:
|
||||
issues:
|
||||
types:
|
||||
[
|
||||
opened,
|
||||
edited,
|
||||
labeled,
|
||||
unlabeled,
|
||||
assigned,
|
||||
unassigned,
|
||||
milestoned,
|
||||
demilestoned,
|
||||
reopened,
|
||||
closed,
|
||||
]
|
||||
|
||||
jobs:
|
||||
notion_job:
|
||||
runs-on: ubuntu-latest
|
||||
name: Add GitHub Issues to Notion
|
||||
steps:
|
||||
- name: Add GitHub Issues to Notion
|
||||
uses: vulcanize/notion-github-action@v1.2.4-issueid
|
||||
with:
|
||||
notion-token: ${{ secrets.NOTION_TOKEN }}
|
||||
notion-db: ${{ secrets.NOTION_DATABASE }}
|
||||
+1
-1
@@ -24,7 +24,7 @@ import (
|
||||
"github.com/spf13/cobra"
|
||||
"github.com/spf13/viper"
|
||||
|
||||
validator "github.com/vulcanize/eth-ipfs-state-validator/v4/pkg"
|
||||
validator "github.com/vulcanize/eth-ipfs-state-validator/v3/pkg"
|
||||
)
|
||||
|
||||
// validateTrieCmd represents the validateTrie command
|
||||
|
||||
@@ -3,7 +3,7 @@ module github.com/vulcanize/eth-ipfs-state-validator/v4
|
||||
go 1.18
|
||||
|
||||
require (
|
||||
github.com/ethereum/go-ethereum v1.10.19
|
||||
github.com/ethereum/go-ethereum v1.10.20
|
||||
github.com/ipfs/go-blockservice v0.1.7
|
||||
github.com/ipfs/go-cid v0.0.7
|
||||
github.com/ipfs/go-ipfs v0.10.0
|
||||
@@ -18,7 +18,7 @@ require (
|
||||
github.com/sirupsen/logrus v1.8.1
|
||||
github.com/spf13/cobra v1.4.0
|
||||
github.com/spf13/viper v1.11.0
|
||||
github.com/vulcanize/ipfs-ethdb/v4 v4.0.2-alpha
|
||||
github.com/vulcanize/ipfs-ethdb/v4 v4.0.3-alpha
|
||||
)
|
||||
|
||||
require (
|
||||
@@ -42,7 +42,7 @@ require (
|
||||
github.com/facebookgo/atomicfile v0.0.0-20151019160806-2de1f203e7d5 // indirect
|
||||
github.com/flynn/noise v1.0.0 // indirect
|
||||
github.com/francoispqt/gojay v1.2.13 // indirect
|
||||
github.com/fsnotify/fsnotify v1.5.1 // indirect
|
||||
github.com/fsnotify/fsnotify v1.5.4 // indirect
|
||||
github.com/go-ole/go-ole v1.2.1 // indirect
|
||||
github.com/go-stack/stack v1.8.0 // indirect
|
||||
github.com/go-task/slim-sprig v0.0.0-20210107165309-348f09dbbbc0 // indirect
|
||||
@@ -201,7 +201,7 @@ require (
|
||||
github.com/spf13/jwalterweatherman v1.1.0 // indirect
|
||||
github.com/spf13/pflag v1.0.5 // indirect
|
||||
github.com/subosito/gotenv v1.2.0 // indirect
|
||||
github.com/syndtr/goleveldb v1.0.1-0.20210819022825-2ae1ddf74ef7 // indirect
|
||||
github.com/syndtr/goleveldb v1.0.1-0.20220614013038-64ee5596c38a // indirect
|
||||
github.com/tklauser/go-sysconf v0.3.5 // indirect
|
||||
github.com/tklauser/numcpus v0.2.2 // indirect
|
||||
github.com/whyrusleeping/base32 v0.0.0-20170828182744-c30ac30633cc // indirect
|
||||
@@ -223,16 +223,16 @@ require (
|
||||
go4.org v0.0.0-20200411211856-f5505b9728dd // indirect
|
||||
golang.org/x/crypto v0.0.0-20220411220226-7b82a4e95df4 // indirect
|
||||
golang.org/x/mod v0.6.0-dev.0.20211013180041-c96bc1413d57 // indirect
|
||||
golang.org/x/net v0.0.0-20220412020605-290c469a71a5 // indirect
|
||||
golang.org/x/net v0.0.0-20220607020251-c690dde0001d // indirect
|
||||
golang.org/x/sync v0.0.0-20210220032951-036812b2e83c // indirect
|
||||
golang.org/x/sys v0.0.0-20220412211240-33da011f77ad // indirect
|
||||
golang.org/x/sys v0.0.0-20220520151302-bc2c85ada10a // indirect
|
||||
golang.org/x/text v0.3.7 // indirect
|
||||
golang.org/x/tools v0.1.8-0.20211029000441-d6a9af8af023 // indirect
|
||||
golang.org/x/xerrors v0.0.0-20220411194840-2f41105eb62f // indirect
|
||||
golang.org/x/xerrors v0.0.0-20220517211312-f3a8303e98df // indirect
|
||||
google.golang.org/protobuf v1.28.0 // indirect
|
||||
gopkg.in/ini.v1 v1.66.4 // indirect
|
||||
gopkg.in/tomb.v1 v1.0.0-20141024135613-dd632973f1e7 // indirect
|
||||
gopkg.in/yaml.v2 v2.4.0 // indirect
|
||||
gopkg.in/yaml.v3 v3.0.0-20210107192922-496545a6307b // indirect
|
||||
gopkg.in/yaml.v3 v3.0.1 // indirect
|
||||
lukechampine.com/blake3 v1.1.6 // indirect
|
||||
)
|
||||
|
||||
@@ -18,7 +18,7 @@ package main
|
||||
import (
|
||||
"github.com/sirupsen/logrus"
|
||||
|
||||
"github.com/vulcanize/eth-ipfs-state-validator/v4/cmd"
|
||||
"github.com/vulcanize/eth-ipfs-state-validator/v3/cmd"
|
||||
)
|
||||
|
||||
func main() {
|
||||
|
||||
+2
-2
@@ -29,14 +29,14 @@ import (
|
||||
)
|
||||
|
||||
// PublishRaw derives a cid from raw bytes and provided codec and multihash type, and writes it to the db tx
|
||||
func PublishRaw(tx *sqlx.Tx, codec, mh uint64, raw []byte, blockNumber uint64) (string, error) {
|
||||
func PublishRaw(tx *sqlx.Tx, codec, mh uint64, raw []byte) (string, error) {
|
||||
c, err := RawdataToCid(codec, raw, mh)
|
||||
if err != nil {
|
||||
return "", err
|
||||
}
|
||||
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 public.blocks (key, data) VALUES ($1, $2) ON CONFLICT (key) DO NOTHING`, prefixedKey, raw)
|
||||
return c.String(), err
|
||||
}
|
||||
|
||||
|
||||
+2
-2
@@ -28,8 +28,8 @@ import (
|
||||
"github.com/jmoiron/sqlx"
|
||||
"github.com/mailgun/groupcache/v2"
|
||||
|
||||
ipfsethdb "github.com/vulcanize/ipfs-ethdb/v4"
|
||||
pgipfsethdb "github.com/vulcanize/ipfs-ethdb/v4/postgres"
|
||||
ipfsethdb "github.com/vulcanize/ipfs-ethdb/v3"
|
||||
pgipfsethdb "github.com/vulcanize/ipfs-ethdb/v3/postgres"
|
||||
)
|
||||
|
||||
// Validator is used for validating Ethereum state and storage tries on PG-IPFS
|
||||
|
||||
@@ -30,12 +30,11 @@ import (
|
||||
. "github.com/onsi/ginkgo"
|
||||
. "github.com/onsi/gomega"
|
||||
|
||||
validator "github.com/vulcanize/eth-ipfs-state-validator/v4/pkg"
|
||||
pgipfsethdb "github.com/vulcanize/ipfs-ethdb/v4/postgres"
|
||||
validator "github.com/vulcanize/eth-ipfs-state-validator/v3/pkg"
|
||||
pgipfsethdb "github.com/vulcanize/ipfs-ethdb/v3/postgres"
|
||||
)
|
||||
|
||||
var (
|
||||
blockNumber = uint64(1)
|
||||
contractAddr = common.HexToAddress("0xaE9BEa628c4Ce503DcFD7E305CaB4e29E7476592")
|
||||
slot0StorageValue = common.Hex2Bytes("94703c4b2bd70c169f5717101caee543299fc946c7")
|
||||
slot1StorageValue = common.Hex2Bytes("01")
|
||||
@@ -303,11 +302,11 @@ func loadTrie(stateNodes, storageNodes [][]byte) {
|
||||
tx, err := db.Beginx()
|
||||
Expect(err).ToNot(HaveOccurred())
|
||||
for _, node := range stateNodes {
|
||||
_, err := validator.PublishRaw(tx, cid.EthStateTrie, multihash.KECCAK_256, node, blockNumber)
|
||||
_, err := validator.PublishRaw(tx, cid.EthStateTrie, multihash.KECCAK_256, node)
|
||||
Expect(err).ToNot(HaveOccurred())
|
||||
}
|
||||
for _, node := range storageNodes {
|
||||
_, err := validator.PublishRaw(tx, cid.EthStorageTrie, multihash.KECCAK_256, node, blockNumber)
|
||||
_, err := validator.PublishRaw(tx, cid.EthStorageTrie, multihash.KECCAK_256, node)
|
||||
Expect(err).ToNot(HaveOccurred())
|
||||
}
|
||||
err = tx.Commit()
|
||||
|
||||
Reference in New Issue
Block a user