Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Support Dencun consensus upgrade #981

Merged
merged 63 commits into from
Jan 19, 2024
Merged
Show file tree
Hide file tree
Changes from 8 commits
Commits
Show all changes
63 commits
Select commit Hold shift + click to select a range
387e085
Update for Dencun
yrong Sep 21, 2023
846065a
build geth&lodestar from source
yrong Sep 25, 2023
65272d4
Fix makeTrie
yrong Sep 25, 2023
d2f0d66
Merge branch 'main' into ron/dencun
yrong Nov 21, 2023
63b0f07
Update go ethereum to v1.13.5
yrong Nov 21, 2023
faf5d01
Update packages & Speedup e2e setup
yrong Nov 21, 2023
c179311
Update lodestar to v1.12.0
yrong Nov 21, 2023
d728f48
Remove unused
yrong Nov 21, 2023
28f23dd
Remove unrelated changes
yrong Nov 21, 2023
cce7714
Ignore build geth when binary exist
yrong Nov 21, 2023
48cc44f
Cleanup for deprecated ethashproof
yrong Nov 22, 2023
fe1e191
Update with VersionedExecutionPayloadHeader
yrong Nov 22, 2023
d37a736
Fix breaking tests
yrong Nov 22, 2023
1aa5a0a
Merge branch 'main' into ron/dencun
yrong Dec 1, 2023
545e267
Update node package
yrong Dec 1, 2023
1c5b33d
Update git modules
yrong Dec 1, 2023
647f57e
Sync packages with nix
yrong Dec 1, 2023
40daff1
Merge branch 'main' of https://github.com/Snowfork/snowbridge into ro…
yrong Dec 4, 2023
565cd83
Update sdk
yrong Dec 4, 2023
7414746
Update contract binding
yrong Dec 5, 2023
70d017b
More cleanup
yrong Dec 5, 2023
585dc78
For deneb(1)
yrong Dec 5, 2023
ba67bf3
For deneb(2)
yrong Dec 5, 2023
f9f7458
Update sdk
yrong Dec 5, 2023
d542799
For deneb(3)
yrong Dec 5, 2023
904e97a
Update sdk
yrong Dec 5, 2023
99c0304
For deneb(4)
yrong Dec 5, 2023
8a50ced
Enable deneb for local setup
yrong Dec 5, 2023
e5c2381
Fix tests
yrong Dec 5, 2023
29a2afe
Fix BeaconStateDeneb & more tests
yrong Dec 6, 2023
3f6cb38
Merge branch 'main' into ron/dencun
yrong Dec 6, 2023
4aae19a
Generate test fixture for Deneb and more tests accordingly
yrong Dec 7, 2023
79e79dd
Merge branch 'main' into ron/dencun
yrong Dec 7, 2023
ed69a35
Fix parse empty field
yrong Dec 7, 2023
1c1ca20
Setup for switchover test
yrong Dec 7, 2023
8f95e8a
Test workflow specific for deneb
yrong Dec 7, 2023
ba5957e
Ignore change detect building polkadot binary
yrong Dec 11, 2023
9673b21
Encode with error handling
yrong Dec 11, 2023
e767e6e
Fix format
yrong Dec 11, 2023
e5120e8
Merge branch 'main' into ron/dencun
yrong Dec 13, 2023
6a38f79
Update lodestar
yrong Dec 14, 2023
c246f70
Improve scripts setting up nodes for production
yrong Dec 14, 2023
6892678
Merge branch 'main' into ron/dencun
yrong Dec 27, 2023
bdec747
Merge branch 'main' into ron/dencun
yrong Jan 11, 2024
99f5a6d
Fix import
yrong Jan 11, 2024
3580c4d
Reorganize deneb primitives
yrong Jan 11, 2024
d1a5b86
Update go mod
yrong Jan 12, 2024
ad65ebd
Fix format
yrong Jan 12, 2024
53e4fa6
Remove obsolete
yrong Jan 12, 2024
d069f97
Fix import
yrong Jan 12, 2024
da3d338
Merge branch 'main' into ron/dencun
yrong Jan 12, 2024
58a28bd
Merge branch 'main' into ron/dencun
yrong Jan 17, 2024
61dadc9
Fix the deneb ForkVersion
yrong Jan 17, 2024
328d541
Upgrade geth and lodestar
yrong Jan 17, 2024
d37ee40
Download geth release to replace the nix default
yrong Jan 18, 2024
d4bc62b
Naming consistently
yrong Jan 18, 2024
0c14e49
Update lodestar with the mock hack
yrong Jan 18, 2024
0ed243a
Fix generate mainnet fixture
yrong Jan 18, 2024
765d765
Remove build geth
yrong Jan 18, 2024
fb5366f
Improve the script
yrong Jan 18, 2024
dc59f22
Merge branch 'main' into ron/dencun
yrong Jan 19, 2024
1460d55
Enable deneb from genesis
yrong Jan 19, 2024
8e392c3
Update sdk
yrong Jan 19, 2024
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
26 changes: 16 additions & 10 deletions .gitmodules
Original file line number Diff line number Diff line change
@@ -1,15 +1,21 @@
[submodule "polkadot-sdk"]
path = polkadot-sdk
url = https://github.com/Snowfork/polkadot-sdk.git
path = polkadot-sdk
url = https://github.com/Snowfork/polkadot-sdk.git
[submodule "contracts/lib/forge-std"]
path = contracts/lib/forge-std
url = https://github.com/foundry-rs/forge-std
path = contracts/lib/forge-std
url = https://github.com/foundry-rs/forge-std
[submodule "contracts/lib/openzeppelin-contracts"]
path = contracts/lib/openzeppelin-contracts
url = https://github.com/OpenZeppelin/openzeppelin-contracts
path = contracts/lib/openzeppelin-contracts
url = https://github.com/OpenZeppelin/openzeppelin-contracts
[submodule "contracts/lib/ds-test"]
path = contracts/lib/ds-test
url = https://github.com/dapphub/ds-test
path = contracts/lib/ds-test
url = https://github.com/dapphub/ds-test
[submodule "contracts/lib/canonical-weth"]
path = contracts/lib/canonical-weth
url = https://github.com/Snowfork/canonical-weth
path = contracts/lib/canonical-weth
url = https://github.com/Snowfork/canonical-weth
[submodule "lodestar"]
vgeddes marked this conversation as resolved.
Show resolved Hide resolved
path = lodestar
url = https://github.com/ChainSafe/lodestar
[submodule "go-ethereum"]
path = go-ethereum
url = https://github.com/ethereum/go-ethereum
4 changes: 4 additions & 0 deletions _typos.toml
Original file line number Diff line number Diff line change
Expand Up @@ -10,4 +10,8 @@ extend-exclude = [
"polkadot-sdk/**",
"smoketest/src/parachains",
"smoketest/src/contracts",
"polkadot-sdk",
"lodestar",
"go-ethereum",
"go.work.sum",
]
1 change: 1 addition & 0 deletions go-ethereum
Submodule go-ethereum added at 916d6a
7 changes: 5 additions & 2 deletions go.work
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
go 1.20
go 1.21

use ./relayer
use (
./go-ethereum
yrong marked this conversation as resolved.
Show resolved Hide resolved
./relayer
)
1,378 changes: 1,358 additions & 20 deletions go.work.sum

Large diffs are not rendered by default.

1 change: 1 addition & 0 deletions lodestar
Submodule lodestar added at 700047
2 changes: 1 addition & 1 deletion relayer/chain/ethereum/message.go
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ func MakeMessageFromEvent(event *etypes.Log, receiptsTrie *etrie.Trie) (*paracha
}

proof := parachain.NewProofData()
err = receiptsTrie.Prove(receiptKey, 0, proof)
err = receiptsTrie.Prove(receiptKey, proof)
if err != nil {
return nil, err
}
Expand Down
4 changes: 3 additions & 1 deletion relayer/chain/ethereum/trie.go
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,8 @@ import (
"bytes"
"sync"

"github.com/ethereum/go-ethereum/core/rawdb"

"github.com/ethereum/go-ethereum/common"
"github.com/ethereum/go-ethereum/core/types"
"github.com/ethereum/go-ethereum/rlp"
Expand All @@ -12,7 +14,7 @@ import (

func MakeTrie(items types.Receipts) (*trie.Trie, error) {

trie := new(trie.Trie)
trie := trie.NewEmpty(trie.NewDatabase(rawdb.NewMemoryDatabase(), nil))
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why this change?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I guess because of the go-ethereum upgrade?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Exactly.


receiptTrie := CreateTrie(types.Receipts(items), trie)

Expand Down
4 changes: 2 additions & 2 deletions relayer/crypto/sr25519/sr25519.go
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ type Keypair struct {
keyringPair *signature.KeyringPair
}

func GenerateKeypair(network uint8) (*Keypair, error) {
func GenerateKeypair(network uint16) (*Keypair, error) {
yrong marked this conversation as resolved.
Show resolved Hide resolved
data := make([]byte, 32)
_, err := rand.Read(data)
if err != nil {
Expand All @@ -27,7 +27,7 @@ func GenerateKeypair(network uint8) (*Keypair, error) {
return NewKeypairFromSeed("//"+hexutil.Encode(data), network)
}

func NewKeypairFromSeed(seed string, network uint8) (*Keypair, error) {
func NewKeypairFromSeed(seed string, network uint16) (*Keypair, error) {
yrong marked this conversation as resolved.
Show resolved Hide resolved
kp, err := signature.KeyringPairFromSecret(seed, network)
return &Keypair{&kp}, err
}
Expand Down
140 changes: 91 additions & 49 deletions relayer/go.mod
Original file line number Diff line number Diff line change
@@ -1,82 +1,124 @@
module github.com/snowfork/snowbridge/relayer

go 1.20
go 1.21

require (
github.com/cbroglie/mustache v1.4.0
github.com/ethereum/go-ethereum v1.10.26
github.com/ethereum/go-ethereum v1.13.5
github.com/ferranbt/fastssz v0.1.3
github.com/magefile/mage v1.13.0
github.com/sirupsen/logrus v1.8.1
github.com/magefile/mage v1.15.0
github.com/mitchellh/mapstructure v1.5.0
github.com/sirupsen/logrus v1.9.3
github.com/snowfork/ethashproof v0.0.0-20210729080250-93b61cd82454
github.com/snowfork/go-substrate-rpc-client/v4 v4.0.1-0.20231109131025-3ece5b994f03
github.com/spf13/cobra v1.4.0
github.com/spf13/viper v1.12.0
github.com/stretchr/testify v1.8.1
golang.org/x/sync v0.1.0
github.com/snowfork/go-substrate-rpc-client/v4 v4.0.1-0.20231121061734-ca84646423f3
github.com/spf13/cobra v1.8.0
github.com/spf13/viper v1.17.0
github.com/stretchr/testify v1.8.4
github.com/vedhavyas/go-subkey v1.0.4
golang.org/x/sync v0.5.0
)

require (
github.com/ChainSafe/go-schnorrkel v1.0.0 // indirect
github.com/VictoriaMetrics/fastcache v1.10.0 // indirect
github.com/ChainSafe/go-schnorrkel v1.1.0 // indirect
github.com/DataDog/zstd v1.5.5 // indirect
github.com/Microsoft/go-winio v0.6.1 // indirect
github.com/VictoriaMetrics/fastcache v1.12.1 // indirect
github.com/allegro/bigcache v1.2.1 // indirect
github.com/btcsuite/btcd/btcec/v2 v2.2.0 // indirect
github.com/beorn7/perks v1.0.1 // indirect
github.com/bits-and-blooms/bitset v1.11.0 // indirect
github.com/btcsuite/btcd/btcec/v2 v2.3.2 // indirect
github.com/btcsuite/btcd/chaincfg/chainhash v1.0.2 // indirect
github.com/cespare/xxhash/v2 v2.2.0 // indirect
github.com/cockroachdb/errors v1.11.1 // indirect
github.com/cockroachdb/logtags v0.0.0-20230118201751-21c54148d20b // indirect
github.com/cockroachdb/pebble v0.0.0-20231121020551-407f86066c04 // indirect
github.com/cockroachdb/redact v1.1.5 // indirect
github.com/cockroachdb/tokenbucket v0.0.0-20230807174530-cc333fc44b06 // indirect
github.com/consensys/bavard v0.1.13 // indirect
github.com/consensys/gnark-crypto v0.12.1 // indirect
github.com/cosmos/go-bip39 v1.0.0 // indirect
github.com/davecgh/go-spew v1.1.1 // indirect
github.com/crate-crypto/go-kzg-4844 v0.7.0 // indirect
github.com/davecgh/go-spew v1.1.2-0.20180830191138-d8f796af33cc // indirect
github.com/deckarep/golang-set v1.8.0 // indirect
github.com/decred/base58 v1.0.4 // indirect
github.com/decred/dcrd/crypto/blake256 v1.0.0 // indirect
github.com/decred/dcrd/dcrec/secp256k1/v4 v4.1.0 // indirect
github.com/deckarep/golang-set/v2 v2.3.1 // indirect
github.com/decred/base58 v1.0.5 // indirect
github.com/decred/dcrd/crypto/blake256 v1.0.1 // indirect
github.com/decred/dcrd/dcrec/secp256k1/v4 v4.2.0 // indirect
github.com/edsrzf/mmap-go v1.1.0 // indirect
github.com/fsnotify/fsnotify v1.5.4 // indirect
github.com/go-logfmt/logfmt v0.5.1 // indirect
github.com/go-ole/go-ole v1.2.6 // indirect
github.com/ethereum/c-kzg-4844 v0.4.0 // indirect
github.com/fsnotify/fsnotify v1.7.0 // indirect
github.com/getsentry/sentry-go v0.25.0 // indirect
github.com/go-ole/go-ole v1.3.0 // indirect
github.com/go-stack/stack v1.8.1 // indirect
github.com/golang/snappy v0.0.4 // indirect
github.com/google/uuid v1.3.0 // indirect
github.com/gorilla/websocket v1.5.0 // indirect
github.com/gofrs/flock v0.8.1 // indirect
github.com/gogo/protobuf v1.3.2 // indirect
github.com/golang/protobuf v1.5.3 // indirect
github.com/golang/snappy v0.0.5-0.20220116011046-fa5810519dcb // indirect
github.com/google/uuid v1.4.0 // indirect
github.com/gorilla/websocket v1.5.1 // indirect
github.com/gtank/merlin v0.1.1 // indirect
github.com/gtank/ristretto255 v0.1.2 // indirect
github.com/hashicorp/golang-lru v0.5.5-0.20210104140557-80c98217689d // indirect
github.com/hashicorp/golang-lru v1.0.2 // indirect
github.com/hashicorp/hcl v1.0.0 // indirect
github.com/holiman/bloomfilter/v2 v2.0.3 // indirect
github.com/holiman/uint256 v1.2.0 // indirect
github.com/inconshreveable/mousetrap v1.0.0 // indirect
github.com/klauspost/cpuid/v2 v2.2.1 // indirect
github.com/magiconair/properties v1.8.6 // indirect
github.com/mattn/go-runewidth v0.0.13 // indirect
github.com/holiman/uint256 v1.2.3 // indirect
github.com/inconshreveable/mousetrap v1.1.0 // indirect
github.com/klauspost/compress v1.17.3 // indirect
github.com/klauspost/cpuid/v2 v2.2.6 // indirect
github.com/kr/pretty v0.3.1 // indirect
github.com/kr/text v0.2.0 // indirect
github.com/magiconair/properties v1.8.7 // indirect
github.com/mattn/go-runewidth v0.0.15 // indirect
github.com/matttproud/golang_protobuf_extensions v1.0.4 // indirect
github.com/matttproud/golang_protobuf_extensions/v2 v2.0.0 // indirect
github.com/mimoo/StrobeGo v0.0.0-20220103164710-9a04d6ca976b // indirect
github.com/minio/sha256-simd v1.0.0 // indirect
github.com/mitchellh/mapstructure v1.5.0 // indirect
github.com/minio/sha256-simd v1.0.1 // indirect
github.com/mmcloughlin/addchain v0.4.0 // indirect
github.com/olekukonko/tablewriter v0.0.5 // indirect
github.com/pelletier/go-toml v1.9.5 // indirect
github.com/pelletier/go-toml/v2 v2.0.1 // indirect
github.com/pelletier/go-toml/v2 v2.1.0 // indirect
github.com/pierrec/xxHash v0.1.5 // indirect
github.com/pkg/errors v0.9.1 // indirect
github.com/pmezard/go-difflib v1.0.0 // indirect
github.com/prometheus/tsdb v0.10.0 // indirect
github.com/rivo/uniseg v0.3.4 // indirect
github.com/rjeczalik/notify v0.9.2 // indirect
github.com/rs/cors v1.8.2 // indirect
github.com/pmezard/go-difflib v1.0.1-0.20181226105442-5d4384ee4fb2 // indirect
github.com/prometheus/client_golang v1.17.0 // indirect
github.com/prometheus/client_model v0.5.0 // indirect
github.com/prometheus/common v0.45.0 // indirect
github.com/prometheus/procfs v0.12.0 // indirect
github.com/rivo/uniseg v0.4.4 // indirect
github.com/rogpeppe/go-internal v1.11.0 // indirect
github.com/rs/cors v1.10.1 // indirect
github.com/sagikazarmark/locafero v0.3.0 // indirect
github.com/sagikazarmark/slog-shim v0.1.0 // indirect
github.com/shirou/gopsutil v3.21.11+incompatible // indirect
github.com/spf13/afero v1.8.2 // indirect
github.com/spf13/cast v1.5.0 // indirect
github.com/sourcegraph/conc v0.3.0 // indirect
github.com/spf13/afero v1.10.0 // indirect
github.com/spf13/cast v1.5.1 // indirect
github.com/spf13/jwalterweatherman v1.1.0 // indirect
github.com/spf13/pflag v1.0.5 // indirect
github.com/stretchr/objx v0.5.0 // indirect
github.com/subosito/gotenv v1.4.0 // indirect
github.com/stretchr/objx v0.5.1 // indirect
github.com/subosito/gotenv v1.6.0 // indirect
github.com/supranational/blst v0.3.11 // indirect
github.com/syndtr/goleveldb v1.0.1-0.20220721030215-126854af5e6d // indirect
github.com/tklauser/go-sysconf v0.3.10 // indirect
github.com/tklauser/numcpus v0.5.0 // indirect
github.com/vedhavyas/go-subkey v1.0.3 // indirect
github.com/yusufpapurcu/wmi v1.2.2 // indirect
golang.org/x/crypto v0.3.0 // indirect
golang.org/x/net v0.3.0 // indirect
golang.org/x/sys v0.3.0 // indirect
golang.org/x/text v0.5.0 // indirect
gopkg.in/ini.v1 v1.66.6 // indirect
github.com/tklauser/go-sysconf v0.3.12 // indirect
github.com/tklauser/numcpus v0.6.1 // indirect
github.com/yusufpapurcu/wmi v1.2.3 // indirect
go.uber.org/atomic v1.11.0 // indirect
go.uber.org/multierr v1.11.0 // indirect
golang.org/x/crypto v0.15.0 // indirect
golang.org/x/exp v0.0.0-20231110203233-9a3e6036ecaa // indirect
golang.org/x/mod v0.14.0 // indirect
golang.org/x/net v0.18.0 // indirect
golang.org/x/sys v0.14.0 // indirect
golang.org/x/text v0.14.0 // indirect
golang.org/x/tools v0.15.0 // indirect
google.golang.org/protobuf v1.31.0 // indirect
gopkg.in/ini.v1 v1.67.0 // indirect
gopkg.in/natefinch/npipe.v2 v2.0.0-20160621034901-c1b8fa8bdcce // indirect
gopkg.in/yaml.v2 v2.4.0 // indirect
gopkg.in/yaml.v3 v3.0.1 // indirect
rsc.io/tmplfunc v0.0.3 // indirect
claravanstaden marked this conversation as resolved.
Show resolved Hide resolved
)

replace github.com/tranvictor/ethutils => github.com/Snowfork/ethutils v0.0.0-20231121055358-90d4f9fa98fd

replace github.com/snowfork/ethashproof => github.com/yrong/ethashproof v0.0.0-20231121055841-7e61e22d5099
yrong marked this conversation as resolved.
Show resolved Hide resolved
Loading