Skip to content

Commit

Permalink
Merge branch 'development' into eclesio/stmt-distr-design
Browse files Browse the repository at this point in the history
  • Loading branch information
P1sar authored Dec 16, 2024
2 parents 45932bb + fd5af5d commit 55a2856
Show file tree
Hide file tree
Showing 13 changed files with 327 additions and 59 deletions.
2 changes: 1 addition & 1 deletion docs/docs/design/availability-subsystems.md
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ Availability is handled by these subsystems:
- Requests chunks from backing validators to put them in their local Availability Store.
- Validator with index i gets chunk with the same index.

## Bitfield Signing subsystem
## [Bitfield Signing subsystem](./bitfield-signing.md)

- For each fresh leaf, wait a fixed period of time for availability distribution to make candidate available.
- Validator with index i gets a chunk with the same index.
Expand Down
9 changes: 3 additions & 6 deletions docs/docs/design/bitfield-distribution.md
Original file line number Diff line number Diff line change
Expand Up @@ -28,16 +28,13 @@ network message as part of the message handling code.
subsystem.)

```go
package bitfielddistribution
package parachaintypes

import (
parachaintypes "github.com/ChainSafe/gossamer/dot/parachain/types"
"github.com/ChainSafe/gossamer/lib/common"
)
import "github.com/ChainSafe/gossamer/lib/common"

type DistributeBitfield struct {
RelayParent common.Hash
Bitfield parachaintypes.UncheckedSignedAvailabilityBitfield
Bitfield UncheckedSignedAvailabilityBitfield
}
```

Expand Down
100 changes: 100 additions & 0 deletions docs/docs/design/bitfield-signing.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,100 @@
---
layout: default
title: Bitfield Signing Subsystem
permalink: /design/bitfield-signing/
---

# Bitfield Signing Subsystem

[The bitfield signing subsystem](https://paritytech.github.io/polkadot-sdk/book/node/availability/bitfield-signing.html)
is responsible for producing signed availability bitfields and passing them to
[the bitfield distribution subsystem](./bitfield-distribution.md). It only does that when running on a validator.

## Subsystem Structure

The implementation must conform to the `Subsystem` interface defined in the `parachaintypes` package. It should live in
a package named `bitfieldsigning` under `dot/parachain/bitfield-signing`.

### Messages Received

The subsystem must be registered with the overseer. It only handles `parachaintypes.ActiveLeavesUpdateSignal`. The
overseer must be modified to forward this message to the subsystem.

### Messages Sent

1. [`DistributeBitfield`](https://github.com/paritytech/polkadot-sdk/blob/1e3b8e1639c1cf784eabf0a9afcab1f3987e0ca4/polkadot/node/subsystem-types/src/messages.rs#L522)

```go
package parachaintypes

import "github.com/ChainSafe/gossamer/lib/common"

type DistributeBitfield struct {
RelayParent common.Hash
Bitfield UncheckedSignedAvailabilityBitfield
}
```

As mentioned in [bitfield distribution](./bitfield-distribution.md), it makes sense to duplicate the type
`UncheckedSignedAvailabilityBitfield` as `CheckedSignedAvailabilityBitfield` or just `SignedAvailabilityBitfield` and
use it in `DistributeBitfield`.

2. [`AvailabilityStore::QueryChunkAvailability(CandidateHash, ValidatorIndex, response_channel)`](https://github.com/paritytech/polkadot-sdk/blob/1e3b8e1639c1cf784eabf0a9afcab1f3987e0ca4/polkadot/node/subsystem-types/src/messages.rs#L556)

This message is sent once for each occupied core, whenever the subsystem is notified of a new active leaf.

The type is already defined as `availabilitystore.QueryChunkAvailability` in
`dot/parachain/availability-store/messages.go`.

## Subsystem State

The subsystem needs access to the parachain session keys for signing bitfields. The appropriate `Keystore` should be
passed to the subsystem constructor as a dependency to facilitate testing. Since each new active leave results in a
goroutine being spawned, the subsystem needs to maintain state to receive data from them and to cancel them when
appropriate.

```go
package bitfieldsigning

import (
"context"

"github.com/ChainSafe/gossamer/lib/common"
"github.com/ChainSafe/gossamer/lib/keystore"
)

type signingTask struct {
ctx context.Context
response <-chan parachaintypes.UncheckedSignedAvailabilityBitfield
}

type BitfieldSigning struct {
keystore keystore.Keystore
tasks map[common.Hash]*signingTask
}
```

Ideally the implementation should avoid lock contention around the keystore. Since the signing key remains the same for
the duration of the signing task, the subsystem could pass in the key pair or just the private key. The implementer
should double-check that this approach is thread-safe.

Again, this should probably use a (to be created) type `CheckedSignedAvailabilityBitfield`.

## Message Handling Logic

### `parachaintypes.ActiveLeavesUpdateSignal`

For all leaves that have been deactivated, cancel the signing tasks associated with them.

For all activated leaves, spawn a new signing task. The task needs to perform the following steps:

1. Wait a while to let the availability store get populated with information about erasure chunks. In the Parity node,
this delay is currently set to [1500ms](https://github.com/paritytech/polkadot-sdk/blob/1e3b8e1639c1cf784eabf0a9afcab1f3987e0ca4/polkadot/node/core/bitfield-signing/src/lib.rs#L49).

2. Query the set of [availability cores](https://paritytech.github.io/polkadot-sdk/book/runtime-api/availability-cores.html)
for the given leaf from the runtime.

3. For each core, concurrently check whether the core is occupied and if so, query the availability store using
`QueryChunkAvailability`.

4. Collect the results of the queries into a bitfield, sign it and send a `DistributeBitfield` message to the overseer.
29 changes: 10 additions & 19 deletions dot/sync/block_importer.go
Original file line number Diff line number Diff line change
Expand Up @@ -104,20 +104,7 @@ func (b *blockImporter) importBlock(bd *types.BlockData, origin BlockOrigin) (im
// or the index of the block data that errored on failure.
func (b *blockImporter) processBlockData(blockData types.BlockData, origin BlockOrigin) error {
if blockData.Header != nil {
var (
hasJustification = blockData.Justification != nil && len(*blockData.Justification) > 0
round uint64
setID uint64
)

if hasJustification {
var err error
round, setID, err = b.finalityGadget.VerifyBlockJustification(
blockData.Header.Hash(), blockData.Header.Number, *blockData.Justification)
if err != nil {
return fmt.Errorf("verifying justification: %w", err)
}
}
header := blockData.Header

if blockData.Body != nil {
err := b.processBlockDataWithHeaderAndBody(blockData, origin)
Expand All @@ -126,18 +113,22 @@ func (b *blockImporter) processBlockData(blockData types.BlockData, origin Block
}
}

if hasJustification {
header := blockData.Header
err := b.blockState.SetFinalisedHash(header.Hash(), round, setID)
if blockData.Justification != nil && len(*blockData.Justification) > 0 {
round, setID, err := b.finalityGadget.VerifyBlockJustification(
header.Hash(), header.Number, *blockData.Justification)
if err != nil {
return fmt.Errorf("verifying justification for block %s: %w", header.Hash().String(), err)
}

err = b.blockState.SetFinalisedHash(header.Hash(), round, setID)
if err != nil {
return fmt.Errorf("setting finalised hash: %w", err)
}

err = b.blockState.SetJustification(header.Hash(), *blockData.Justification)
if err != nil {
return fmt.Errorf("setting justification for block number %d: %w", header.Number, err)
}

return nil
}
}
err := b.blockState.CompareAndSetBlockData(&blockData)
Expand Down
2 changes: 1 addition & 1 deletion dot/types/digest.go
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ type DigestItemValues interface {

func newDigestItem[Value DigestItemValues](value Value) DigestItem {
item := DigestItem{}
setDigestItem[Value](&item, value)
setDigestItem(&item, value)
return item
}

Expand Down
4 changes: 2 additions & 2 deletions go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ require (
github.com/cockroachdb/pebble v1.1.2
github.com/cosmos/go-bip39 v1.0.0
github.com/dgraph-io/badger/v4 v4.5.0
github.com/dgraph-io/ristretto/v2 v2.0.0
github.com/dgraph-io/ristretto/v2 v2.0.1
github.com/disiqueira/gotree v1.0.0
github.com/ethereum/go-ethereum v1.14.12
github.com/fatih/color v1.18.0
Expand Down Expand Up @@ -42,7 +42,7 @@ require (
github.com/tidwall/btree v1.7.0
github.com/tyler-smith/go-bip39 v1.1.0
go.uber.org/mock v0.5.0
golang.org/x/crypto v0.30.0
golang.org/x/crypto v0.31.0
golang.org/x/exp v0.0.0-20240719175910-8a7402abbf56
golang.org/x/term v0.27.0
google.golang.org/protobuf v1.35.2
Expand Down
8 changes: 4 additions & 4 deletions go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -115,8 +115,8 @@ github.com/decred/dcrd/dcrec/secp256k1/v4 v4.3.0/go.mod h1:v57UDF4pDQJcEfFUCRop3
github.com/decred/dcrd/lru v1.0.0/go.mod h1:mxKOwFd7lFjN2GZYsiz/ecgqR6kkYAl+0pz0tEMk218=
github.com/dgraph-io/badger/v4 v4.5.0 h1:TeJE3I1pIWLBjYhIYCA1+uxrjWEoJXImFBMEBVSm16g=
github.com/dgraph-io/badger/v4 v4.5.0/go.mod h1:ysgYmIeG8dS/E8kwxT7xHyc7MkmwNYLRoYnFbr7387A=
github.com/dgraph-io/ristretto/v2 v2.0.0 h1:l0yiSOtlJvc0otkqyMaDNysg8E9/F/TYZwMbxscNOAQ=
github.com/dgraph-io/ristretto/v2 v2.0.0/go.mod h1:FVFokF2dRqXyPyeMnK1YDy8Fc6aTe0IKgbcd03CYeEk=
github.com/dgraph-io/ristretto/v2 v2.0.1 h1:7W0LfEP+USCmtrUjJsk+Jv2jbhJmb72N4yRI7GrLdMI=
github.com/dgraph-io/ristretto/v2 v2.0.1/go.mod h1:K7caLeufSdxm+ITp1n/73U+VbFVAHrexfLbz4n14hpo=
github.com/dgryski/go-farm v0.0.0-20200201041132-a6ae2369ad13 h1:fAjc9m62+UWV/WAFKLNi6ZS0675eEUC9y3AlwSbQu1Y=
github.com/dgryski/go-farm v0.0.0-20200201041132-a6ae2369ad13/go.mod h1:SqUrOPUnsFjfmXRMNPybcSiG0BgUW2AuFH8PAnS2iTw=
github.com/disiqueira/gotree v1.0.0 h1:en5wk87n7/Jyk6gVME3cx3xN9KmUCstJ1IjHr4Se4To=
Expand Down Expand Up @@ -698,8 +698,8 @@ golang.org/x/crypto v0.0.0-20210921155107-089bfa567519/go.mod h1:GvvjBRRGRdwPK5y
golang.org/x/crypto v0.8.0/go.mod h1:mRqEX+O9/h5TFCrQhkgjo2yKi0yYA+9ecGkdQoHrywE=
golang.org/x/crypto v0.12.0/go.mod h1:NF0Gs7EO5K4qLn+Ylc+fih8BSTeIjAP05siRnAh98yw=
golang.org/x/crypto v0.18.0/go.mod h1:R0j02AL6hcrfOiy9T4ZYp/rcWeMxM3L6QYxlOuEG1mg=
golang.org/x/crypto v0.30.0 h1:RwoQn3GkWiMkzlX562cLB7OxWvjH1L8xutO2WoJcRoY=
golang.org/x/crypto v0.30.0/go.mod h1:kDsLvtWBEx7MV9tJOj9bnXsPbxwJQ6csT/x4KIN4Ssk=
golang.org/x/crypto v0.31.0 h1:ihbySMvVjLAeSH1IbfcRTkD/iNscyz8rGzjF/E5hV6U=
golang.org/x/crypto v0.31.0/go.mod h1:kDsLvtWBEx7MV9tJOj9bnXsPbxwJQ6csT/x4KIN4Ssk=
golang.org/x/exp v0.0.0-20190121172915-509febef88a4/go.mod h1:CJ0aWSM057203Lf6IL+f9T1iT9GByDxfZKAQTCR3kQA=
golang.org/x/exp v0.0.0-20240719175910-8a7402abbf56 h1:2dVuKD2vS7b0QIHQbpyTISPd0LeHDbnYEryqj5Q1ug8=
golang.org/x/exp v0.0.0-20240719175910-8a7402abbf56/go.mod h1:M4RDyNAINzryxdtnbRXRL/OHtkFuWGRjvuhBJpk2IlY=
Expand Down
11 changes: 11 additions & 0 deletions internal/client/consensus/grandpa/justification_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -81,6 +81,17 @@ func TestJustificationEncoding(t *testing.T) {
require.Equal(t, expected, justification.Justification)
}

func TestDecodeJustificationFromWestendBlock2323464(t *testing.T) {
//nolint:lll
encodedJustification := []byte{
101, 9, 0, 0, 0, 0, 0, 0, 160, 39, 234, 163, 193, 179, 177, 30, 36, 107, 194, 191, 221, 25, 90, 49, 196, 99, 44, 212, 88, 240, 35, 236, 228, 218, 193, 52, 63, 124, 13, 205, 8, 116, 35, 0, 44, 61, 255, 19, 108, 231, 232, 166, 4, 100, 186, 92, 153, 57, 80, 3, 56, 96, 6, 5, 68, 151, 191, 177, 72, 88, 198, 80, 161, 92, 202, 155, 243, 9, 116, 35, 0, 198, 201, 2, 183, 193, 46, 175, 3, 86, 192, 71, 8, 140, 159, 134, 111, 60, 19, 179, 232, 166, 52, 13, 83, 131, 67, 154, 255, 169, 77, 46, 164, 243, 101, 198, 120, 44, 34, 193, 252, 78, 116, 191, 19, 234, 3, 12, 73, 160, 191, 117, 195, 117, 189, 255, 154, 245, 228, 244, 56, 186, 175, 62, 5, 7, 217, 82, 218, 242, 208, 226, 97, 110, 83, 68, 166, 207, 249, 137, 163, 252, 197, 167, 154, 87, 153, 25, 140, 21, 255, 28, 6, 197, 26, 18, 128, 160, 39, 234, 163, 193, 179, 177, 30, 36, 107, 194, 191, 221, 25, 90, 49, 196, 99, 44, 212, 88, 240, 35, 236, 228, 218, 193, 52, 63, 124, 13, 205, 8, 116, 35, 0, 176, 249, 251, 175, 109, 52, 88, 104, 18, 58, 131, 78, 60, 254, 31, 223, 108, 15, 5, 172, 89, 74, 87, 71, 224, 95, 205, 14, 140, 187, 209, 168, 191, 202, 222, 118, 236, 59, 136, 204, 25, 155, 54, 195, 41, 185, 185, 25, 220, 59, 102, 243, 78, 196, 207, 151, 235, 88, 18, 254, 235, 223, 213, 10, 22, 157, 169, 111, 232, 137, 254, 25, 242, 233, 70, 60, 76, 183, 48, 179, 52, 115, 165, 97, 240, 161, 93, 85, 129, 202, 124, 82, 54, 42, 37, 45, 160, 39, 234, 163, 193, 179, 177, 30, 36, 107, 194, 191, 221, 25, 90, 49, 196, 99, 44, 212, 88, 240, 35, 236, 228, 218, 193, 52, 63, 124, 13, 205, 8, 116, 35, 0, 99, 120, 106, 150, 120, 143, 157, 182, 211, 188, 22, 39, 229, 213, 243, 215, 167, 136, 65, 250, 142, 19, 253, 68, 145, 41, 107, 23, 75, 214, 26, 218, 250, 117, 61, 126, 142, 16, 100, 37, 91, 52, 80, 139, 174, 188, 9, 16, 164, 118, 236, 64, 25, 60, 149, 184, 41, 98, 22, 130, 153, 247, 130, 14, 38, 165, 0, 130, 236, 99, 74, 108, 27, 250, 196, 212, 157, 16, 5, 85, 237, 246, 19, 223, 112, 61, 138, 10, 206, 62, 76, 149, 116, 94, 166, 153, 61, 255, 19, 108, 231, 232, 166, 4, 100, 186, 92, 153, 57, 80, 3, 56, 96, 6, 5, 68, 151, 191, 177, 72, 88, 198, 80, 161, 92, 202, 155, 243, 9, 116, 35, 0, 213, 174, 223, 48, 80, 151, 122, 6, 20, 150, 237, 141, 18, 241, 40, 29, 108, 125, 140, 66, 118, 219, 205, 152, 120, 254, 234, 104, 178, 115, 48, 11, 203, 253, 199, 30, 145, 96, 190, 248, 119, 153, 70, 212, 109, 128, 253, 128, 218, 102, 237, 172, 20, 67, 150, 223, 33, 18, 180, 177, 236, 90, 246, 8, 49, 218, 231, 151, 187, 172, 14, 39, 185, 1, 53, 92, 201, 4, 70, 54, 157, 205, 21, 216, 249, 101, 147, 59, 87, 114, 62, 227, 137, 103, 13, 85, 160, 39, 234, 163, 193, 179, 177, 30, 36, 107, 194, 191, 221, 25, 90, 49, 196, 99, 44, 212, 88, 240, 35, 236, 228, 218, 193, 52, 63, 124, 13, 205, 8, 116, 35, 0, 152, 158, 83, 232, 15, 138, 209, 77, 64, 107, 167, 37, 241, 208, 225, 167, 139, 4, 11, 198, 31, 54, 199, 4, 9, 37, 83, 81, 181, 3, 137, 105, 106, 8, 122, 244, 145, 242, 86, 170, 97, 164, 75, 149, 40, 184, 255, 144, 175, 167, 34, 239, 142, 209, 188, 254, 254, 172, 98, 151, 204, 104, 195, 3, 64, 75, 49, 166, 102, 51, 68, 198, 140, 126, 124, 42, 28, 244, 167, 103, 245, 58, 82, 95, 224, 34, 248, 13, 162, 131, 210, 200, 187, 19, 104, 109, 61, 255, 19, 108, 231, 232, 166, 4, 100, 186, 92, 153, 57, 80, 3, 56, 96, 6, 5, 68, 151, 191, 177, 72, 88, 198, 80, 161, 92, 202, 155, 243, 9, 116, 35, 0, 125, 196, 88, 9, 14, 244, 127, 43, 91, 8, 3, 111, 60, 100, 68, 214, 232, 192, 227, 100, 3, 85, 96, 123, 39, 218, 144, 8, 105, 89, 91, 81, 247, 144, 105, 157, 52, 137, 232, 1, 147, 140, 235, 159, 111, 171, 42, 118, 132, 34, 246, 112, 201, 39, 14, 11, 246, 240, 61, 96, 179, 74, 214, 13, 90, 240, 22, 123, 223, 44, 19, 81, 145, 248, 255, 177, 85, 199, 95, 9, 123, 133, 115, 69, 104, 121, 209, 216, 156, 81, 148, 80, 144, 230, 69, 231, 160, 39, 234, 163, 193, 179, 177, 30, 36, 107, 194, 191, 221, 25, 90, 49, 196, 99, 44, 212, 88, 240, 35, 236, 228, 218, 193, 52, 63, 124, 13, 205, 8, 116, 35, 0, 24, 143, 150, 165, 148, 107, 121, 215, 2, 248, 43, 157, 205, 237, 232, 215, 38, 4, 255, 171, 250, 235, 168, 112, 179, 227, 162, 65, 57, 103, 181, 78, 62, 138, 122, 170, 209, 197, 249, 15, 58, 60, 127, 131, 148, 23, 73, 104, 154, 68, 110, 187, 187, 81, 35, 7, 112, 40, 131, 72, 252, 159, 21, 0, 93, 5, 197, 56, 70, 126, 210, 89, 242, 82, 11, 86, 244, 159, 245, 136, 50, 204, 196, 64, 138, 105, 178, 138, 18, 187, 39, 63, 59, 65, 159, 44, 61, 255, 19, 108, 231, 232, 166, 4, 100, 186, 92, 153, 57, 80, 3, 56, 96, 6, 5, 68, 151, 191, 177, 72, 88, 198, 80, 161, 92, 202, 155, 243, 9, 116, 35, 0, 8, 223, 196, 18, 152, 147, 171, 52, 220, 14, 7, 73, 92, 31, 114, 102, 49, 225, 193, 77, 208, 80, 122, 181, 225, 249, 241, 231, 111, 108, 168, 32, 195, 46, 167, 253, 161, 55, 210, 186, 77, 178, 44, 110, 183, 255, 177, 239, 51, 54, 7, 210, 244, 140, 118, 238, 166, 204, 115, 22, 91, 40, 200, 12, 198, 220, 66, 100, 134, 46, 17, 156, 132, 171, 46, 163, 191, 78, 170, 157, 123, 225, 4, 216, 141, 127, 62, 224, 142, 9, 139, 224, 1, 181, 171, 248, 160, 39, 234, 163, 193, 179, 177, 30, 36, 107, 194, 191, 221, 25, 90, 49, 196, 99, 44, 212, 88, 240, 35, 236, 228, 218, 193, 52, 63, 124, 13, 205, 8, 116, 35, 0, 242, 86, 164, 127, 87, 169, 203, 130, 87, 220, 232, 163, 152, 74, 168, 1, 148, 28, 130, 172, 224, 187, 175, 110, 168, 210, 32, 192, 13, 239, 253, 128, 242, 61, 11, 147, 177, 71, 167, 232, 9, 164, 5, 55, 201, 23, 241, 38, 11, 183, 108, 222, 31, 205, 143, 241, 250, 113, 150, 153, 233, 157, 177, 2, 202, 111, 218, 104, 65, 158, 55, 67, 81, 194, 252, 131, 20, 178, 177, 182, 54, 147, 35, 144, 162, 50, 36, 210, 60, 48, 25, 122, 32, 236, 76, 178, 61, 255, 19, 108, 231, 232, 166, 4, 100, 186, 92, 153, 57, 80, 3, 56, 96, 6, 5, 68, 151, 191, 177, 72, 88, 198, 80, 161, 92, 202, 155, 243, 9, 116, 35, 0, 92, 247, 208, 78, 40, 206, 67, 51, 161, 33, 242, 20, 96, 34, 29, 153, 173, 107, 81, 107, 174, 81, 70, 243, 152, 34, 56, 210, 233, 60, 104, 208, 249, 218, 76, 246, 143, 141, 145, 59, 93, 208, 11, 89, 238, 251, 144, 58, 21, 242, 241, 146, 191, 53, 87, 152, 2, 72, 147, 31, 112, 116, 86, 15, 203, 185, 105, 7, 239, 188, 63, 248, 237, 145, 209, 113, 202, 38, 101, 138, 44, 57, 5, 137, 2, 117, 55, 94, 218, 147, 126, 180, 86, 129, 98, 126, 61, 255, 19, 108, 231, 232, 166, 4, 100, 186, 92, 153, 57, 80, 3, 56, 96, 6, 5, 68, 151, 191, 177, 72, 88, 198, 80, 161, 92, 202, 155, 243, 9, 116, 35, 0, 204, 187, 70, 137, 74, 136, 59, 59, 152, 243, 175, 33, 2, 120, 172, 158, 205, 10, 95, 114, 45, 98, 202, 56, 6, 164, 248, 213, 112, 43, 254, 76, 1, 145, 133, 70, 249, 18, 164, 216, 44, 65, 107, 2, 252, 250, 196, 133, 81, 133, 128, 94, 88, 14, 82, 34, 40, 21, 53, 173, 146, 129, 123, 9, 207, 44, 219, 247, 170, 156, 134, 196, 172, 58, 196, 93, 17, 2, 49, 213, 206, 34, 254, 84, 173, 21, 246, 247, 139, 134, 102, 195, 145, 222, 62, 120, 4, 160, 39, 234, 163, 193, 179, 177, 30, 36, 107, 194, 191, 221, 25, 90, 49, 196, 99, 44, 212, 88, 240, 35, 236, 228, 218, 193, 52, 63, 124, 13, 205, 38, 208, 141, 0, 141, 209, 83, 5, 194, 62, 249, 11, 242, 116, 184, 9, 131, 144, 52, 213, 192, 28, 99, 214, 166, 50, 99, 255, 194, 162, 132, 89, 224, 209, 215, 18, 175, 115, 178, 154, 62, 213, 23, 253, 41, 157, 129, 228, 37, 15, 202, 20, 16, 146, 91, 190, 175, 232, 194, 152, 111, 207, 21, 204, 183, 86, 44, 6, 8, 6, 66, 65, 66, 69, 52, 2, 4, 0, 0, 0, 208, 224, 230, 15, 0, 0, 0, 0, 5, 66, 65, 66, 69, 1, 1, 50, 255, 71, 85, 126, 223, 168, 216, 206, 184, 250, 72, 32, 198, 203, 75, 199, 72, 221, 129, 46, 148, 138, 198, 131, 87, 171, 222, 179, 77, 17, 67, 253, 235, 143, 215, 161, 94, 64, 52, 22, 176, 169, 99, 87, 111, 63, 212, 235, 51, 27, 29, 171, 103, 11, 175, 236, 95, 31, 146, 12, 171, 224, 136,
}

justification, err := DecodeJustification[hash.H256, uint32, runtime.BlakeTwo256](encodedJustification)
require.NoError(t, err)
require.Equal(t, uint32(2323464), justification.Target().Number)
}

func TestDecodeGrandpaJustificationVerifyFinalizes(t *testing.T) {
var a hash.H256 = "a\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" //nolint:lll

Expand Down
Loading

0 comments on commit 55a2856

Please sign in to comment.