Skip to content

Commit

Permalink
Deneb Support (#324)
Browse files Browse the repository at this point in the history
* Add beacon block option in consensus data

* Update Attestation and fastssz. Generate new ssz [skip ci]

* Add KZGCommitment SSZ

* Add unused generated import just to show in the FastSSZ issue

* Remove unused import using the goimports tool

* Add Deneb beacon node for testing

* Add beacon node testing util

* Add DataVersion due to change of default value

* Add type ssz tests

* Remove Bellatrix objects and use Deneb [skip ci]

* Generate new tests

* Revert ZGCommitments SSZ

* Drop comment about issue

* Drop unused test variables

* Drop unused Transactions function. Catch error.

* deneb block contents adjustments

* return block signing root

* Update SSZ-Max sizes [skip ci]

* Generate ssz encoding with new max values [skip ci]

* Add different BeaconBroadcastedRoot for blinded proposal [skip ci]

* Generate tests

* Revert "Add different BeaconBroadcastedRoot for blinded proposal [skip ci]"

This reverts commit 7dff441.

* fix deneb signed beacon block

* fix submitting signed deneb block

* add deneb tests

* fixed typo

* update json

* remove bellatrix

* Revert "remove bellatrix"

This reverts commit 3f10eea.

* Compare BlockContents root in tests [skip ci]

* SSZ-max adjustment

* Use fixed capellaBlock const

* Generate tests

* revert to bellatrix

* wrong duty type fix

* re generate json tests

* revert sync committee contribution version to bellatrix

* regenerate tests

* Fix testing signed blinded block

* Update ssz-max. Add python code

* Use correct prater fork epoch for deneb

* Adjust szz-max size

---------

Co-authored-by: olegshmuelov <[email protected]>
Co-authored-by: Gal Rogozinski <[email protected]>
  • Loading branch information
3 people authored Jan 21, 2024
1 parent 0af3f69 commit f2d5899
Show file tree
Hide file tree
Showing 636 changed files with 61,367 additions and 94,645 deletions.
8 changes: 4 additions & 4 deletions go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,10 @@ module github.com/bloxapp/ssv-spec
go 1.19

require (
github.com/attestantio/go-eth2-client v0.16.3 // if version is changed, types/generate.go needs adjustment
github.com/attestantio/go-eth2-client v0.19.7 // if version is changed, types/generate.go needs adjustment
github.com/decred/dcrd/dcrec/secp256k1/v4 v4.2.0
github.com/ethereum/go-ethereum v1.12.0
github.com/ferranbt/fastssz v0.1.2
github.com/ferranbt/fastssz v0.1.3
github.com/goccy/go-yaml v1.11.0
github.com/herumi/bls-eth-go-binary v1.29.1
github.com/libp2p/go-libp2p v0.27.4
Expand Down Expand Up @@ -47,8 +47,8 @@ require (
go.uber.org/atomic v1.10.0 // indirect
go.uber.org/multierr v1.11.0 // indirect
go.uber.org/zap v1.24.0 // indirect
golang.org/x/crypto v0.7.0 // indirect
golang.org/x/sys v0.7.0 // indirect
golang.org/x/crypto v0.10.0 // indirect
golang.org/x/sys v0.9.0 // indirect
golang.org/x/xerrors v0.0.0-20220907171357-04be3eba64a2 // indirect
google.golang.org/protobuf v1.30.0 // indirect
gopkg.in/yaml.v2 v2.4.0 // indirect
Expand Down
14 changes: 14 additions & 0 deletions go.sum
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
github.com/attestantio/go-eth2-client v0.16.3 h1:D6LLwswDlHbUwsAqfBKaKXjWdBzRlNQRXUoC+5vFsDw=
github.com/attestantio/go-eth2-client v0.16.3/go.mod h1:Om16oH+H34E2JHoOY8hLWg+64twlO+AjAE7kkK3f1Xc=
github.com/attestantio/go-eth2-client v0.19.7 h1:1cX2rYz9tMZGhXTCe5Ax3C9fmHx1igih21+MU1eO5ls=
github.com/attestantio/go-eth2-client v0.19.7/go.mod h1:mZve1kV9Ctj0I1HH9gdg+MnI8lZ+Cb2EktEtOYrBlsM=
github.com/benbjohnson/clock v1.1.0/go.mod h1:J11/hYXuz8f4ySSvYwY0FKfm+ezbsZBKZxNJlLklBHA=
github.com/benbjohnson/clock v1.3.0 h1:ip6w0uFQkncKQ979AypyG0ER7mqUSBdKLOgAle/AT8A=
github.com/beorn7/perks v1.0.1 h1:VlbKKnNfV8bJzeqoa4cOKqO6bYr3WgKZxO8Z16+hsOM=
Expand All @@ -25,10 +27,15 @@ github.com/fatih/color v1.13.0 h1:8LOYc1KYPPmyKMuN8QV2DNRWNbLo6LZ0iLs8+mlH53w=
github.com/fatih/color v1.13.0/go.mod h1:kLAiJbzzSOZDVNGyDpeOxJ47H46qBXwg5ILebYFFOfk=
github.com/ferranbt/fastssz v0.1.2 h1:Dky6dXlngF6Qjc+EfDipAkE83N5I5DE68bY6O0VLNPk=
github.com/ferranbt/fastssz v0.1.2/go.mod h1:X5UPrE2u1UJjxHA8X54u04SBwdAQjG2sFtWs39YxyWs=
github.com/ferranbt/fastssz v0.1.3 h1:ZI+z3JH05h4kgmFXdHuR1aWYsgrg7o+Fw7/NCzM16Mo=
github.com/ferranbt/fastssz v0.1.3/go.mod h1:0Y9TEd/9XuFlh7mskMPfXiI2Dkw4Ddg9EyXt1W7MRvE=
github.com/francoispqt/gojay v1.2.13 h1:d2m3sFjloqoIUQU3TsHBgj6qg/BVGlTBeHDUmyJnXKk=
github.com/go-playground/locales v0.13.0 h1:HyWk6mgj5qFqCT5fjGBuRArbVDfE4hi8+e8ceBS/t7Q=
github.com/go-playground/locales v0.13.0/go.mod h1:taPMhCMXrRLJO55olJkUXHZBHCxTMfnGwq/HNwmWNS8=
github.com/go-playground/universal-translator v0.17.0 h1:icxd5fm+REJzpZx7ZfpaD876Lmtgy7VtROAbHHXk8no=
github.com/go-playground/universal-translator v0.17.0/go.mod h1:UkSxE5sNxxRwHyU+Scu5vgOQjsIJAF8j9muTVoKLVtA=
github.com/go-playground/validator/v10 v10.4.1 h1:pH2c5ADXtd66mxoE0Zm9SUhxE20r7aM3F26W0hOn+GE=
github.com/go-playground/validator/v10 v10.4.1/go.mod h1:nlOn6nFhuKACm19sB/8EGNn9GlaMV7XkbRSipzJ0Ii4=
github.com/go-task/slim-sprig v0.0.0-20230315185526-52ccab3ef572 h1:tfuBGBXKqDEevZMzYi5KSi8KkcZtzBcTgAUUtapy0OI=
github.com/goccy/go-yaml v1.11.0 h1:n7Z+zx8S9f9KgzG6KtQKf+kwqXZlLNR2F6018Dgau54=
github.com/goccy/go-yaml v1.11.0/go.mod h1:H+mJrWtjPTJAHvRbV09MCK9xYwODM+wRTVFFTWckfng=
Expand Down Expand Up @@ -68,6 +75,7 @@ github.com/kr/pty v1.1.1/go.mod h1:pFQYn66WHrOpPYNljwOMqo10TkYh1fy3cYio2l3bCsQ=
github.com/kr/text v0.1.0/go.mod h1:4Jbv+DJW3UT/LiOwJeYQe1efqtUx/iVham/4vfdArNI=
github.com/kr/text v0.2.0 h1:5Nx0Ya0ZqY2ygV366QzturHI13Jq95ApcVaJBhpS+AY=
github.com/leodido/go-urn v1.2.0 h1:hpXL4XnriNwQ/ABnpepYM/1vCLWNDfUNts8dX3xTG6Y=
github.com/leodido/go-urn v1.2.0/go.mod h1:+8+nEpDfqqsY+g338gtMEUOtuK+4dEMhiQEgxpxOKII=
github.com/libp2p/go-buffer-pool v0.1.0 h1:oK4mSFcQz7cTQIfqbe4MIj9gLW+mnanjyFtc6cdF0Y8=
github.com/libp2p/go-buffer-pool v0.1.0/go.mod h1:N+vh8gMqimBzdKkSMVuydVDq+UV5QTWy5HSiZacSbPg=
github.com/libp2p/go-flow-metrics v0.1.0 h1:0iPhMI8PskQwzh57jB9WxIuIOQ0r+15PChFGkx3Q3WM=
Expand All @@ -94,6 +102,7 @@ github.com/matttproud/golang_protobuf_extensions v1.0.4 h1:mmDVorXM7PCGKw94cs5zk
github.com/miekg/dns v1.1.53 h1:ZBkuHr5dxHtB1caEOlZTLPo7D3L3TWckgUUs/RHfDxw=
github.com/mikioh/tcpinfo v0.0.0-20190314235526-30a79bb1804b h1:z78hV3sbSMAUoyUMM0I83AUIT6Hu17AWfgjzIbtrYFc=
github.com/mikioh/tcpopt v0.0.0-20190314235656-172688c1accc h1:PTfri+PuQmWDqERdnNMiD9ZejrlswWrCpBEZgWOiTrc=
github.com/minio/blake2b-simd v0.0.0-20160723061019-3f5f724cb5b1/go.mod h1:pD8RvIylQ358TN4wwqatJ8rNavkEINozVn9DtGI3dfQ=
github.com/minio/sha256-simd v1.0.0 h1:v1ta+49hkWZyvaKwrQB8elexRqm6Y0aMLjCNsrYxo6g=
github.com/minio/sha256-simd v1.0.0/go.mod h1:OuYzVNI5vcoYIAmbIvHPl3N3jUzVedXbKy5RFepssQM=
github.com/mitchellh/mapstructure v1.5.0 h1:jeMsZIYE/09sWLaz43PL7Gy6RuMjD2eJVyuac5Z2hdY=
Expand Down Expand Up @@ -141,6 +150,7 @@ github.com/rogpeppe/go-internal v1.9.0 h1:73kH8U+JUqXU8lRuOHeVHaa/SZPifC7BkcraZV
github.com/spaolacci/murmur3 v1.1.0 h1:7c1g84S4BPRrfL5Xrdp6fOJ206sU9y293DDHaoy0bLI=
github.com/spaolacci/murmur3 v1.1.0/go.mod h1:JwIasOWyU6f++ZhiEuf87xNszmSA2myDM2Kzu9HwQUA=
github.com/stretchr/objx v0.1.0/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+wExME=
github.com/stretchr/objx v0.5.0/go.mod h1:Yh+to48EsGEfYuaHDzXPcE3xhTkx73EhmCGUpEOglKo=
github.com/stretchr/testify v1.3.0/go.mod h1:M5WIy9Dh21IEIfnGCwXGc5bZfKNJtfHm1UVUgZn+9EI=
github.com/stretchr/testify v1.7.0/go.mod h1:6Fq8oRcR53rry900zMqJjRRixrwX3KX962/h/Wwjteg=
github.com/stretchr/testify v1.8.4 h1:CcVxjf3Q8PM0mHUKJCdn+eZZtm5yQwehR5yeSVQQcUk=
Expand All @@ -164,6 +174,8 @@ golang.org/x/crypto v0.0.0-20191011191535-87dc89f01550/go.mod h1:yigFU9vqHzYiE8U
golang.org/x/crypto v0.0.0-20200622213623-75b288015ac9/go.mod h1:LzIPMQfyMNhhGPhUkYOs5KpL4U8rLKemX1yGLhDgUto=
golang.org/x/crypto v0.7.0 h1:AvwMYaRytfdeVt3u6mLaxYtErKYjxA2OXjJ1HHq6t3A=
golang.org/x/crypto v0.7.0/go.mod h1:pYwdfH91IfpZVANVyUOhSIPZaFoJGxTFbZhFTx+dXZU=
golang.org/x/crypto v0.10.0 h1:LKqV2xt9+kDzSTfOhx4FrkEBcMrAgHSYgzywV9zcGmM=
golang.org/x/crypto v0.10.0/go.mod h1:o4eNf7Ede1fv+hwOwZsTHl9EsPFO6q6ZvYR8vYfY45I=
golang.org/x/exp v0.0.0-20230321023759-10a507213a29 h1:ooxPy7fPvB4kwsA2h+iBNHkAbp/4JxTSwCmvdjEYmug=
golang.org/x/lint v0.0.0-20190930215403-16217165b5de/go.mod h1:6SW0HCj/g11FgYtHlgUYUwCkIfeOF89ocIRzGO/8vkc=
golang.org/x/mod v0.2.0/go.mod h1:s0Qsj1ACt9ePp/hMypM3fl4fZqREWJwdYDEqhRiZZUA=
Expand Down Expand Up @@ -196,6 +208,8 @@ golang.org/x/sys v0.0.0-20220811171246-fbc7d0a398ab/go.mod h1:oPkhp1MJrh7nUepCBc
golang.org/x/sys v0.6.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
golang.org/x/sys v0.7.0 h1:3jlCCIQZPdOYu1h8BkNvLz8Kgwtae2cagcG/VamtZRU=
golang.org/x/sys v0.7.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
golang.org/x/sys v0.9.0 h1:KS/R3tvhPqvJvwcKfnBHJwwthS11LRhmM5D59eEXa0s=
golang.org/x/sys v0.9.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
golang.org/x/term v0.0.0-20201126162022-7de9c90e9dd1/go.mod h1:bj7SfCRtBDWHUb9snDiAeCFNEtKQo2Wmx5Cou7ajbmo=
golang.org/x/text v0.3.0/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ=
golang.org/x/text v0.3.3/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ=
Expand Down
5 changes: 3 additions & 2 deletions qbft/messages.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ package qbft
import (
"bytes"
"crypto/sha256"

"github.com/bloxapp/ssv-spec/types"
"github.com/pkg/errors"
)
Expand Down Expand Up @@ -140,8 +141,8 @@ type SignedMessage struct {
// = 852088 ~= 2^20
Message Message // message for which this signature is for

// Full data max value is ConsensusData max value ~= 2^22 + 2^16
FullData []byte `ssz-max:"4259840"`
// Full data max value is ConsensusData max value ~= 2^8 + 8 + 2^20 + 2^22 = 5243144
FullData []byte `ssz-max:"5243144"`
}

func (signedMsg *SignedMessage) GetSignature() types.Signature {
Expand Down
18 changes: 9 additions & 9 deletions qbft/messages_encoding.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion qbft/spectest/generate/tests.json

Large diffs are not rendered by default.

Original file line number Diff line number Diff line change
Expand Up @@ -91,58 +91,9 @@
"DecidedValue": null,
"StartingDuty": {
"Type": 1,
"PubKey": [
142,
128,
6,
101,
81,
168,
27,
49,
130,
88,
112,
158,
218,
247,
221,
31,
99,
205,
104,
106,
14,
77,
184,
178,
155,
187,
122,
207,
230,
86,
8,
103,
122,
245,
165,
39,
217,
68,
142,
228,
120,
53,
72,
94,
2,
181,
11,
192
],
"Slot": 12,
"ValidatorIndex": 1,
"PubKey": "0x8e80066551a81b318258709edaf7dd1f63cd686a0e4db8b29bbb7acfe65608677af5a527d9448ee47835485e02b50bc0",
"Slot": "12",
"ValidatorIndex": "1",
"CommitteeIndex": 22,
"CommitteeLength": 128,
"CommitteesAtSlot": 36,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -91,58 +91,9 @@
"DecidedValue": null,
"StartingDuty": {
"Type": 0,
"PubKey": [
142,
128,
6,
101,
81,
168,
27,
49,
130,
88,
112,
158,
218,
247,
221,
31,
99,
205,
104,
106,
14,
77,
184,
178,
155,
187,
122,
207,
230,
86,
8,
103,
122,
245,
165,
39,
217,
68,
142,
228,
120,
53,
72,
94,
2,
181,
11,
192
],
"Slot": 12,
"ValidatorIndex": 1,
"PubKey": "0x8e80066551a81b318258709edaf7dd1f63cd686a0e4db8b29bbb7acfe65608677af5a527d9448ee47835485e02b50bc0",
"Slot": "12",
"ValidatorIndex": "1",
"CommitteeIndex": 3,
"CommitteeLength": 128,
"CommitteesAtSlot": 36,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,7 @@
},
"ID": "AAADAY6ABmVRqBsxglhwntr33R9jzWhqDk24spu7es/mVghnevWlJ9lEjuR4NUheArULwAIAAAA=",
"Round": 1,
"Height": 12,
"Height": 7413760,
"LastPreparedRound": 0,
"LastPreparedValue": null,
"ProposalAcceptedForCurrentRound": null,
Expand All @@ -91,58 +91,9 @@
"DecidedValue": null,
"StartingDuty": {
"Type": 2,
"PubKey": [
142,
128,
6,
101,
81,
168,
27,
49,
130,
88,
112,
158,
218,
247,
221,
31,
99,
205,
104,
106,
14,
77,
184,
178,
155,
187,
122,
207,
230,
86,
8,
103,
122,
245,
165,
39,
217,
68,
142,
228,
120,
53,
72,
94,
2,
181,
11,
192
],
"Slot": 12,
"ValidatorIndex": 1,
"PubKey": "0x8e80066551a81b318258709edaf7dd1f63cd686a0e4db8b29bbb7acfe65608677af5a527d9448ee47835485e02b50bc0",
"Slot": "7413760",
"ValidatorIndex": "1",
"CommitteeIndex": 3,
"CommitteeLength": 128,
"CommitteesAtSlot": 36,
Expand Down Expand Up @@ -207,7 +158,7 @@
},
"QBFTController": {
"Identifier": "AAADAY6ABmVRqBsxglhwntr33R9jzWhqDk24spu7es/mVghnevWlJ9lEjuR4NUheArULwAIAAAA=",
"Height": 12,
"Height": 7413760,
"StoredInstances": [
{
"State": {
Expand Down Expand Up @@ -267,7 +218,7 @@
},
"ID": "AAADAY6ABmVRqBsxglhwntr33R9jzWhqDk24spu7es/mVghnevWlJ9lEjuR4NUheArULwAIAAAA=",
"Round": 1,
"Height": 12,
"Height": 7413760,
"LastPreparedRound": 0,
"LastPreparedValue": null,
"ProposalAcceptedForCurrentRound": null,
Expand Down
Loading

0 comments on commit f2d5899

Please sign in to comment.