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/cobra"
|
||||||
"github.com/spf13/viper"
|
"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
|
// validateTrieCmd represents the validateTrie command
|
||||||
|
|||||||
@@ -18,7 +18,7 @@ package main
|
|||||||
import (
|
import (
|
||||||
"github.com/sirupsen/logrus"
|
"github.com/sirupsen/logrus"
|
||||||
|
|
||||||
"github.com/vulcanize/eth-ipfs-state-validator/v4/cmd"
|
"github.com/vulcanize/eth-ipfs-state-validator/v3/cmd"
|
||||||
)
|
)
|
||||||
|
|
||||||
func main() {
|
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
|
// 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)
|
c, err := RawdataToCid(codec, raw, mh)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return "", err
|
return "", err
|
||||||
}
|
}
|
||||||
dbKey := dshelp.MultihashToDsKey(c.Hash())
|
dbKey := dshelp.MultihashToDsKey(c.Hash())
|
||||||
prefixedKey := blockstore.BlockPrefix.String() + dbKey.String()
|
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
|
return c.String(), err
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
+2
-2
@@ -28,8 +28,8 @@ import (
|
|||||||
"github.com/jmoiron/sqlx"
|
"github.com/jmoiron/sqlx"
|
||||||
"github.com/mailgun/groupcache/v2"
|
"github.com/mailgun/groupcache/v2"
|
||||||
|
|
||||||
ipfsethdb "github.com/vulcanize/ipfs-ethdb/v4"
|
ipfsethdb "github.com/vulcanize/ipfs-ethdb/v3"
|
||||||
pgipfsethdb "github.com/vulcanize/ipfs-ethdb/v4/postgres"
|
pgipfsethdb "github.com/vulcanize/ipfs-ethdb/v3/postgres"
|
||||||
)
|
)
|
||||||
|
|
||||||
// Validator is used for validating Ethereum state and storage tries on PG-IPFS
|
// 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/ginkgo"
|
||||||
. "github.com/onsi/gomega"
|
. "github.com/onsi/gomega"
|
||||||
|
|
||||||
validator "github.com/vulcanize/eth-ipfs-state-validator/v4/pkg"
|
validator "github.com/vulcanize/eth-ipfs-state-validator/v3/pkg"
|
||||||
pgipfsethdb "github.com/vulcanize/ipfs-ethdb/v4/postgres"
|
pgipfsethdb "github.com/vulcanize/ipfs-ethdb/v3/postgres"
|
||||||
)
|
)
|
||||||
|
|
||||||
var (
|
var (
|
||||||
blockNumber = uint64(1)
|
|
||||||
contractAddr = common.HexToAddress("0xaE9BEa628c4Ce503DcFD7E305CaB4e29E7476592")
|
contractAddr = common.HexToAddress("0xaE9BEa628c4Ce503DcFD7E305CaB4e29E7476592")
|
||||||
slot0StorageValue = common.Hex2Bytes("94703c4b2bd70c169f5717101caee543299fc946c7")
|
slot0StorageValue = common.Hex2Bytes("94703c4b2bd70c169f5717101caee543299fc946c7")
|
||||||
slot1StorageValue = common.Hex2Bytes("01")
|
slot1StorageValue = common.Hex2Bytes("01")
|
||||||
@@ -303,11 +302,11 @@ func loadTrie(stateNodes, storageNodes [][]byte) {
|
|||||||
tx, err := db.Beginx()
|
tx, err := db.Beginx()
|
||||||
Expect(err).ToNot(HaveOccurred())
|
Expect(err).ToNot(HaveOccurred())
|
||||||
for _, node := range stateNodes {
|
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())
|
Expect(err).ToNot(HaveOccurred())
|
||||||
}
|
}
|
||||||
for _, node := range storageNodes {
|
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())
|
Expect(err).ToNot(HaveOccurred())
|
||||||
}
|
}
|
||||||
err = tx.Commit()
|
err = tx.Commit()
|
||||||
|
|||||||
Reference in New Issue
Block a user