From e1eecdeb8ff79a64431c6dbede90389eb3a874f9 Mon Sep 17 00:00:00 2001 From: Jordan Schalm Date: Thu, 23 Mar 2023 17:44:48 -0400 Subject: [PATCH 01/12] add existence checking for headers, snapshot creation --- state/protocol/badger/snapshot.go | 4 ++- state/protocol/badger/state.go | 32 ++++++++++++++++---- storage/badger/cache.go | 7 +++++ storage/badger/cache_test.go | 39 +++++++++++++++++++++++++ storage/badger/headers.go | 14 +++++++++ storage/badger/operation/common.go | 21 +++++++++++++ storage/badger/operation/common_test.go | 37 +++++++++++++++++++++++ storage/badger/operation/headers.go | 6 ++++ storage/headers.go | 4 +++ 9 files changed, 158 insertions(+), 6 deletions(-) create mode 100644 storage/badger/cache_test.go diff --git a/state/protocol/badger/snapshot.go b/state/protocol/badger/snapshot.go index 141a2e2f599..b7d7b428fbe 100644 --- a/state/protocol/badger/snapshot.go +++ b/state/protocol/badger/snapshot.go @@ -35,7 +35,9 @@ type Snapshot struct { var _ protocol.Snapshot = (*Snapshot)(nil) -func NewSnapshot(state *State, blockID flow.Identifier) *Snapshot { +// newSnapshotWithIncorporatedReferenceBlock creates a new state snapshot with the given reference block. +// CAUTION: This function does not check whether the reference block exists. +func newSnapshotWithIncorporatedReferenceBlock(state *State, blockID flow.Identifier) *Snapshot { return &Snapshot{ state: state, blockID: blockID, diff --git a/state/protocol/badger/state.go b/state/protocol/badger/state.go index db95326d142..c05e3b2a674 100644 --- a/state/protocol/badger/state.go +++ b/state/protocol/badger/state.go @@ -589,6 +589,8 @@ func (state *State) Params() protocol.Params { return Params{state: state} } +// Sealed returns a snapshot for the latest sealed block. A latest sealed block +// must always exist, so this function always returns a valid snapshot. func (state *State) Sealed() protocol.Snapshot { // retrieve the latest sealed height var sealed uint64 @@ -600,6 +602,8 @@ func (state *State) Sealed() protocol.Snapshot { return state.AtHeight(sealed) } +// Final returns a snapshot for the latest finalized block. A latest finalized +// block must always exist, so this function always returns a valid snapshot. func (state *State) Final() protocol.Snapshot { // retrieve the latest finalized height var finalized uint64 @@ -611,6 +615,12 @@ func (state *State) Final() protocol.Snapshot { return state.AtHeight(finalized) } +// AtHeight returns a snapshot for the finalized block at the given height. +// This function may return an invalid.Snapshot with: +// - state.ErrUnknownSnapshotReference: +// -> if no block with the given height has been finalized, even if it is incorporated +// -> if the given height is below the root height +// - exception for critical unexpected storage errors func (state *State) AtHeight(height uint64) protocol.Snapshot { // retrieve the block ID for the finalized height var blockID flow.Identifier @@ -622,18 +632,30 @@ func (state *State) AtHeight(height uint64) protocol.Snapshot { // critical storage error return invalid.NewSnapshotf("could not look up block by height: %w", err) } - return state.AtBlockID(blockID) + return newSnapshotWithIncorporatedReferenceBlock(state, blockID) } +// AtBlockID returns a snapshot for the block with the given ID. The block may be +// finalized or un-finalized. +// This function may return an invalid.Snapshot with: +// - state.ErrUnknownSnapshotReference: +// -> if no block with the given ID exists in the state +// - exception for critical unexpected storage errors func (state *State) AtBlockID(blockID flow.Identifier) protocol.Snapshot { - // TODO should return invalid.NewSnapshot(ErrUnknownSnapshotReference) if block doesn't exist - return NewSnapshot(state, blockID) + exists, err := state.headers.Exists(blockID) + if err != nil { + return invalid.NewSnapshotf("could not check existence of reference block") + } + if !exists { + return invalid.NewSnapshotf("unknown block %x: %w", blockID, statepkg.ErrUnknownSnapshotReference) + } + return newSnapshotWithIncorporatedReferenceBlock(state, blockID) } // newState initializes a new state backed by the provided a badger database, // mempools and service components. -// The parameter `expectedBootstrappedState` indicates whether or not the database -// is expected to contain a an already bootstrapped state or not +// The parameter `expectedBootstrappedState` indicates whether the database +// is expected to contain an already bootstrapped state or not func newState( metrics module.ComplianceMetrics, db *badger.DB, diff --git a/storage/badger/cache.go b/storage/badger/cache.go index d53cccb8131..17dd38f101f 100644 --- a/storage/badger/cache.go +++ b/storage/badger/cache.go @@ -79,6 +79,13 @@ func newCache(collector module.CacheMetrics, resourceName string, options ...fun return &c } +// Exists returns true if the key exists in the cache. It DOES NOT check +// whether the key exists in the underlying data store. +func (c *Cache) Exists(key any) bool { + exists := c.cache.Contains(key) + return exists +} + // Get will try to retrieve the resource from cache first, and then from the // injected. During normal operations, the following error returns are expected: // - `storage.ErrNotFound` if key is unknown. diff --git a/storage/badger/cache_test.go b/storage/badger/cache_test.go new file mode 100644 index 00000000000..fc41f2e85d9 --- /dev/null +++ b/storage/badger/cache_test.go @@ -0,0 +1,39 @@ +package badger + +import ( + "testing" + + "github.com/stretchr/testify/assert" + + "github.com/onflow/flow-go/module/metrics" + "github.com/onflow/flow-go/utils/unittest" +) + +// TestCache_Exists tests existence checking items in the cache. +func TestCache_Exists(t *testing.T) { + cache := newCache(metrics.NewNoopCollector(), "test") + + t.Run("non-existent", func(t *testing.T) { + key := unittest.IdentifierFixture() + exists := cache.Exists(key) + assert.False(t, exists) + }) + + t.Run("existent", func(t *testing.T) { + key := unittest.IdentifierFixture() + cache.Insert(key, unittest.RandomBytes(128)) + + exists := cache.Exists(key) + assert.True(t, exists) + }) + + t.Run("removed", func(t *testing.T) { + key := unittest.IdentifierFixture() + // insert, then remove the item + cache.Insert(key, unittest.RandomBytes(128)) + cache.Remove(key) + + exists := cache.Exists(key) + assert.False(t, exists) + }) +} diff --git a/storage/badger/headers.go b/storage/badger/headers.go index a7b9d8ed66a..8e832efb2a2 100644 --- a/storage/badger/headers.go +++ b/storage/badger/headers.go @@ -139,6 +139,20 @@ func (h *Headers) ByHeight(height uint64) (*flow.Header, error) { return h.retrieveTx(blockID)(tx) } +func (h *Headers) Exists(blockID flow.Identifier) (bool, error) { + // if the block is in the cache, return true + if ok := h.cache.Exists(blockID); ok { + return ok, nil + } + // otherwise, check badger store + var exists bool + err := h.db.View(operation.BlockExists(blockID, &exists)) + if err != nil { + return false, fmt.Errorf("could not check existence: %w", err) + } + return exists, nil +} + // BlockIDByHeight the block ID that is finalized at the given height. It is an optimized version // of `ByHeight` that skips retrieving the block. Expected errors during normal operations: // - `storage.ErrNotFound` if no finalized block is known at given height. diff --git a/storage/badger/operation/common.go b/storage/badger/operation/common.go index f2a57fe210b..52cd9c3a8a5 100644 --- a/storage/badger/operation/common.go +++ b/storage/badger/operation/common.go @@ -264,6 +264,27 @@ func retrieve(key []byte, entity interface{}) func(*badger.Txn) error { } } +// exists returns true if a key exists in the database. +// No errors are expected during normal operation. +func exists(key []byte, keyExists *bool) func(*badger.Txn) error { + return func(tx *badger.Txn) error { + _, err := tx.Get(key) + if err != nil { + // the key does not exist in the database + if errors.Is(err, badger.ErrKeyNotFound) { + *keyExists = false + return nil + } + // exception while checking for the key + return fmt.Errorf("could not load data: %w", err) + } + + // the key does exist in the database + *keyExists = true + return nil + } +} + // checkFunc is called during key iteration through the badger DB in order to // check whether we should process the given key-value pair. It can be used to // avoid loading the value if its not of interest, as well as storing the key diff --git a/storage/badger/operation/common_test.go b/storage/badger/operation/common_test.go index 592627b490f..27f7f468b18 100644 --- a/storage/badger/operation/common_test.go +++ b/storage/badger/operation/common_test.go @@ -274,6 +274,43 @@ func TestRetrieveUnencodeable(t *testing.T) { }) } +func TestExists(t *testing.T) { + unittest.RunWithBadgerDB(t, func(db *badger.DB) { + t.Run("non-existent key", func(t *testing.T) { + key := unittest.RandomBytes(32) + var _exists bool + err := db.View(exists(key, &_exists)) + require.NoError(t, err) + assert.False(t, _exists) + }) + + t.Run("existent key", func(t *testing.T) { + key := unittest.RandomBytes(32) + err := db.Update(insert(key, unittest.RandomBytes(256))) + require.NoError(t, err) + + var _exists bool + err = db.View(exists(key, &_exists)) + require.NoError(t, err) + assert.True(t, _exists) + }) + + t.Run("removed key", func(t *testing.T) { + key := unittest.RandomBytes(32) + // insert, then remove the key + err := db.Update(insert(key, unittest.RandomBytes(256))) + require.NoError(t, err) + err = db.Update(remove(key)) + require.NoError(t, err) + + var _exists bool + err = db.View(exists(key, &_exists)) + require.NoError(t, err) + assert.False(t, _exists) + }) + }) +} + func TestLookup(t *testing.T) { expected := []flow.Identifier{ {0x01}, diff --git a/storage/badger/operation/headers.go b/storage/badger/operation/headers.go index d8dfd7cb3f2..b031c801efa 100644 --- a/storage/badger/operation/headers.go +++ b/storage/badger/operation/headers.go @@ -27,6 +27,12 @@ func LookupBlockHeight(height uint64, blockID *flow.Identifier) func(*badger.Txn return retrieve(makePrefix(codeHeightToBlock, height), blockID) } +// BlockExists checks whether the block exists in the database. +// No errors are expected. +func BlockExists(blockID flow.Identifier, blockExists *bool) func(*badger.Txn) error { + return exists(makePrefix(codeHeader, blockID), blockExists) +} + func InsertExecutedBlock(blockID flow.Identifier) func(*badger.Txn) error { return insert(makePrefix(codeExecutedBlock), blockID) } diff --git a/storage/headers.go b/storage/headers.go index 9bf7ee9d15a..0035e12f2a0 100644 --- a/storage/headers.go +++ b/storage/headers.go @@ -20,6 +20,10 @@ type Headers interface { // ByHeight returns the block with the given number. It is only available for finalized blocks. ByHeight(height uint64) (*flow.Header, error) + // Exists returns true if a header with the given ID has been stored. + // No errors are expected during normal operation. + Exists(blockID flow.Identifier) (bool, error) + // BlockIDByHeight the block ID that is finalized at the given height. It is an optimized version // of `ByHeight` that skips retrieving the block. Expected errors during normal operations: // * `storage.ErrNotFound` if no finalized block is known at given height From 3d0bf2a55a1b25ca63617d1aaf2048d98c9d09b3 Mon Sep 17 00:00:00 2001 From: Jordan Schalm Date: Fri, 24 Mar 2023 10:09:23 -0400 Subject: [PATCH 02/12] adjust docs --- state/protocol/badger/snapshot.go | 4 ++-- storage/badger/cache.go | 6 +++--- storage/badger/cache_test.go | 6 +++--- storage/badger/headers.go | 4 +++- storage/badger/operation/headers.go | 2 +- 5 files changed, 12 insertions(+), 10 deletions(-) diff --git a/state/protocol/badger/snapshot.go b/state/protocol/badger/snapshot.go index b7d7b428fbe..03d89d9bbdc 100644 --- a/state/protocol/badger/snapshot.go +++ b/state/protocol/badger/snapshot.go @@ -36,7 +36,7 @@ type Snapshot struct { var _ protocol.Snapshot = (*Snapshot)(nil) // newSnapshotWithIncorporatedReferenceBlock creates a new state snapshot with the given reference block. -// CAUTION: This function does not check whether the reference block exists. +// CAUTION: The caller is responsible for ensuring that the reference block has been incorporated. func newSnapshotWithIncorporatedReferenceBlock(state *State, blockID flow.Identifier) *Snapshot { return &Snapshot{ state: state, @@ -86,7 +86,7 @@ func (s *Snapshot) Identities(selector flow.IdentityFilter) (flow.IdentityList, return nil, err } - // sort the identities so the 'Exists' binary search works + // sort the identities so the 'IsCached' binary search works identities := setup.Participants.Sort(order.Canonical) // get identities that are in either last/next epoch but NOT in the current epoch diff --git a/storage/badger/cache.go b/storage/badger/cache.go index 17dd38f101f..5af5d23f8b1 100644 --- a/storage/badger/cache.go +++ b/storage/badger/cache.go @@ -79,9 +79,9 @@ func newCache(collector module.CacheMetrics, resourceName string, options ...fun return &c } -// Exists returns true if the key exists in the cache. It DOES NOT check -// whether the key exists in the underlying data store. -func (c *Cache) Exists(key any) bool { +// IsCached returns true if the key exists in the cache. +// It DOES NOT check whether the key exists in the underlying data store. +func (c *Cache) IsCached(key any) bool { exists := c.cache.Contains(key) return exists } diff --git a/storage/badger/cache_test.go b/storage/badger/cache_test.go index fc41f2e85d9..fdc0e73dc51 100644 --- a/storage/badger/cache_test.go +++ b/storage/badger/cache_test.go @@ -15,7 +15,7 @@ func TestCache_Exists(t *testing.T) { t.Run("non-existent", func(t *testing.T) { key := unittest.IdentifierFixture() - exists := cache.Exists(key) + exists := cache.IsCached(key) assert.False(t, exists) }) @@ -23,7 +23,7 @@ func TestCache_Exists(t *testing.T) { key := unittest.IdentifierFixture() cache.Insert(key, unittest.RandomBytes(128)) - exists := cache.Exists(key) + exists := cache.IsCached(key) assert.True(t, exists) }) @@ -33,7 +33,7 @@ func TestCache_Exists(t *testing.T) { cache.Insert(key, unittest.RandomBytes(128)) cache.Remove(key) - exists := cache.Exists(key) + exists := cache.IsCached(key) assert.False(t, exists) }) } diff --git a/storage/badger/headers.go b/storage/badger/headers.go index 8e832efb2a2..90725af1c10 100644 --- a/storage/badger/headers.go +++ b/storage/badger/headers.go @@ -139,9 +139,11 @@ func (h *Headers) ByHeight(height uint64) (*flow.Header, error) { return h.retrieveTx(blockID)(tx) } +// Exists returns true if a header with the given ID has been stored. +// No errors are expected during normal operation. func (h *Headers) Exists(blockID flow.Identifier) (bool, error) { // if the block is in the cache, return true - if ok := h.cache.Exists(blockID); ok { + if ok := h.cache.IsCached(blockID); ok { return ok, nil } // otherwise, check badger store diff --git a/storage/badger/operation/headers.go b/storage/badger/operation/headers.go index b031c801efa..78af538801a 100644 --- a/storage/badger/operation/headers.go +++ b/storage/badger/operation/headers.go @@ -28,7 +28,7 @@ func LookupBlockHeight(height uint64, blockID *flow.Identifier) func(*badger.Txn } // BlockExists checks whether the block exists in the database. -// No errors are expected. +// No errors are expected during normal operation. func BlockExists(blockID flow.Identifier, blockExists *bool) func(*badger.Txn) error { return exists(makePrefix(codeHeader, blockID), blockExists) } From 22cd21a496ac9252dfa62f7c14ed8863b008fbc7 Mon Sep 17 00:00:00 2001 From: Jordan Schalm Date: Fri, 24 Mar 2023 10:15:30 -0400 Subject: [PATCH 03/12] denote exceptions in common storage methods --- storage/badger/operation/common.go | 53 ++++++++++++++++-------------- storage/badger/operation/max.go | 3 +- 2 files changed, 30 insertions(+), 26 deletions(-) diff --git a/storage/badger/operation/common.go b/storage/badger/operation/common.go index 52cd9c3a8a5..97dddb91d12 100644 --- a/storage/badger/operation/common.go +++ b/storage/badger/operation/common.go @@ -11,6 +11,7 @@ import ( "github.com/vmihailenco/msgpack/v4" "github.com/onflow/flow-go/model/flow" + "github.com/onflow/flow-go/module/irrecoverable" "github.com/onflow/flow-go/storage" ) @@ -33,13 +34,13 @@ func batchWrite(key []byte, entity interface{}) func(writeBatch *badger.WriteBat // serialize the entity data val, err := msgpack.Marshal(entity) if err != nil { - return fmt.Errorf("could not encode entity: %w", err) + return irrecoverable.NewExceptionf("could not encode entity: %w", err) } // persist the entity data into the DB err = writeBatch.Set(key, val) if err != nil { - return fmt.Errorf("could not store data: %w", err) + return irrecoverable.NewExceptionf("could not store data: %w", err) } return nil } @@ -71,19 +72,19 @@ func insert(key []byte, entity interface{}) func(*badger.Txn) error { } if !errors.Is(err, badger.ErrKeyNotFound) { - return fmt.Errorf("could not retrieve key: %w", err) + return irrecoverable.NewExceptionf("could not retrieve key: %w", err) } // serialize the entity data val, err := msgpack.Marshal(entity) if err != nil { - return fmt.Errorf("could not encode entity: %w", err) + return irrecoverable.NewExceptionf("could not encode entity: %w", err) } // persist the entity data into the DB err = tx.Set(key, val) if err != nil { - return fmt.Errorf("could not store data: %w", err) + return irrecoverable.NewExceptionf("could not store data: %w", err) } return nil } @@ -104,19 +105,19 @@ func update(key []byte, entity interface{}) func(*badger.Txn) error { return storage.ErrNotFound } if err != nil { - return fmt.Errorf("could not check key: %w", err) + return irrecoverable.NewExceptionf("could not check key: %w", err) } // serialize the entity data val, err := msgpack.Marshal(entity) if err != nil { - return fmt.Errorf("could not encode entity: %w", err) + return irrecoverable.NewExceptionf("could not encode entity: %w", err) } // persist the entity data into the DB err = tx.Set(key, val) if err != nil { - return fmt.Errorf("could not replace data: %w", err) + return irrecoverable.NewExceptionf("could not replace data: %w", err) } return nil @@ -139,13 +140,13 @@ func upsert(key []byte, entity interface{}) func(*badger.Txn) error { // serialize the entity data val, err := msgpack.Marshal(entity) if err != nil { - return fmt.Errorf("could not encode entity: %w", err) + return irrecoverable.NewExceptionf("could not encode entity: %w", err) } // persist the entity data into the DB err = tx.Set(key, val) if err != nil { - return fmt.Errorf("could not upsert data: %w", err) + return irrecoverable.NewExceptionf("could not upsert data: %w", err) } return nil @@ -161,15 +162,18 @@ func remove(key []byte) func(*badger.Txn) error { return func(tx *badger.Txn) error { // retrieve the item from the key-value store _, err := tx.Get(key) - if errors.Is(err, badger.ErrKeyNotFound) { - return storage.ErrNotFound - } if err != nil { - return fmt.Errorf("could not check key: %w", err) + if errors.Is(err, badger.ErrKeyNotFound) { + return storage.ErrNotFound + } + return irrecoverable.NewExceptionf("could not check key: %w", err) } err = tx.Delete(key) - return err + if err != nil { + return irrecoverable.NewExceptionf("could not delete item: %w", err) + } + return nil } } @@ -180,7 +184,7 @@ func batchRemove(key []byte) func(writeBatch *badger.WriteBatch) error { return func(writeBatch *badger.WriteBatch) error { err := writeBatch.Delete(key) if err != nil { - return fmt.Errorf("could not batch delete data: %w", err) + return irrecoverable.NewExceptionf("could not batch delete data: %w", err) } return nil } @@ -201,7 +205,7 @@ func removeByPrefix(prefix []byte) func(*badger.Txn) error { key := it.Item().KeyCopy(nil) err := tx.Delete(key) if err != nil { - return err + return irrecoverable.NewExceptionf("could not delete item with prefix: %w", err) } } @@ -225,7 +229,7 @@ func batchRemoveByPrefix(prefix []byte) func(tx *badger.Txn, writeBatch *badger. key := it.Item().KeyCopy(nil) err := writeBatch.Delete(key) if err != nil { - return err + return irrecoverable.NewExceptionf("could not delete item in batch: %w", err) } } return nil @@ -248,7 +252,7 @@ func retrieve(key []byte, entity interface{}) func(*badger.Txn) error { return storage.ErrNotFound } if err != nil { - return fmt.Errorf("could not load data: %w", err) + return irrecoverable.NewExceptionf("could not load data: %w", err) } // get the value from the item @@ -257,7 +261,7 @@ func retrieve(key []byte, entity interface{}) func(*badger.Txn) error { return err }) if err != nil { - return fmt.Errorf("could not decode entity: %w", err) + return irrecoverable.NewExceptionf("could not decode entity: %w", err) } return nil @@ -276,7 +280,7 @@ func exists(key []byte, keyExists *bool) func(*badger.Txn) error { return nil } // exception while checking for the key - return fmt.Errorf("could not load data: %w", err) + return irrecoverable.NewExceptionf("could not load data: %w", err) } // the key does exist in the database @@ -350,8 +354,7 @@ func withPrefetchValuesFalse(options *badger.IteratorOptions) { // On each iteration, it will call the iteration function to initialize // functions specific to processing the given key-value pair. // -// TODO: this function is unbounded – pass context.Context to this or calling -// functions to allow timing functions out. +// TODO: this function is unbounded – pass context.Context to this or calling functions to allow timing functions out. // No errors are expected during normal operation. Any errors returned by the // provided handleFunc will be propagated back to the caller of iterate. func iterate(start []byte, end []byte, iteration iterationFunc, opts ...func(*badger.IteratorOptions)) func(*badger.Txn) error { @@ -436,7 +439,7 @@ func iterate(start []byte, end []byte, iteration iterationFunc, opts ...func(*ba entity := create() err := msgpack.Unmarshal(val, entity) if err != nil { - return fmt.Errorf("could not decode entity: %w", err) + return irrecoverable.NewExceptionf("could not decode entity: %w", err) } // process the entity @@ -498,7 +501,7 @@ func traverse(prefix []byte, iteration iterationFunc) func(*badger.Txn) error { entity := create() err := msgpack.Unmarshal(val, entity) if err != nil { - return fmt.Errorf("could not decode entity: %w", err) + return irrecoverable.NewExceptionf("could not decode entity: %w", err) } // process the entity diff --git a/storage/badger/operation/max.go b/storage/badger/operation/max.go index ad1a2a84a17..754e2e9bcb7 100644 --- a/storage/badger/operation/max.go +++ b/storage/badger/operation/max.go @@ -7,6 +7,7 @@ import ( "github.com/dgraph-io/badger/v2" + "github.com/onflow/flow-go/module/irrecoverable" "github.com/onflow/flow-go/storage" ) @@ -50,7 +51,7 @@ func SetMax(tx storage.Transaction) error { binary.LittleEndian.PutUint32(val, max) err := tx.Set(key, val) if err != nil { - return fmt.Errorf("could not set max: %w", err) + return irrecoverable.NewExceptionf("could not set max: %w", err) } return nil } From 718cd42c9845439d02aff65035e19090483b9589 Mon Sep 17 00:00:00 2001 From: Jordan Schalm Date: Fri, 24 Mar 2023 11:11:04 -0400 Subject: [PATCH 04/12] add tests for unknown snapshot reference --- consensus/hotstuff/committee.go | 8 ++-- .../signature/block_signer_decoder.go | 2 + state/protocol/badger/snapshot_test.go | 46 +++++++++++++++++++ state/protocol/snapshot.go | 15 ++++-- 4 files changed, 64 insertions(+), 7 deletions(-) diff --git a/consensus/hotstuff/committee.go b/consensus/hotstuff/committee.go index 454d5c5ecea..47c62bad525 100644 --- a/consensus/hotstuff/committee.go +++ b/consensus/hotstuff/committee.go @@ -117,13 +117,15 @@ type DynamicCommittee interface { // * contains no duplicates. // The list of all legitimate HotStuff participants for the given epoch can be obtained by using `filter.Any` // - // No errors are expected during normal operation. + // ERROR conditions: + // * state.ErrUnknownSnapshotReference if the blockID is for an unknown block IdentitiesByBlock(blockID flow.Identifier) (flow.IdentityList, error) // IdentityByBlock returns the full Identity for specified HotStuff participant. // The node must be a legitimate HotStuff participant with NON-ZERO WEIGHT at the specified block. // ERROR conditions: // * model.InvalidSignerError if participantID does NOT correspond to an authorized HotStuff participant at the specified block. + // * state.ErrUnknownSnapshotReference if the blockID is for an unknown block IdentityByBlock(blockID flow.Identifier, participantID flow.Identifier) (*flow.Identity, error) } @@ -135,8 +137,8 @@ type BlockSignerDecoder interface { // consensus committee has reached agreement on validity of parent block. Consequently, the // returned IdentifierList contains the consensus participants that signed the parent block. // Expected Error returns during normal operations: - // - signature.InvalidSignerIndicesError if signer indices included in the header do - // not encode a valid subset of the consensus committee + // * signature.InvalidSignerIndicesError if signer indices included in the header do + // not encode a valid subset of the consensus committee DecodeSignerIDs(header *flow.Header) (flow.IdentifierList, error) } diff --git a/consensus/hotstuff/signature/block_signer_decoder.go b/consensus/hotstuff/signature/block_signer_decoder.go index ad70979c08f..ea08dbad5fd 100644 --- a/consensus/hotstuff/signature/block_signer_decoder.go +++ b/consensus/hotstuff/signature/block_signer_decoder.go @@ -41,6 +41,8 @@ func (b *BlockSignerDecoder) DecodeSignerIDs(header *flow.Header) (flow.Identifi if errors.Is(err, model.ErrViewForUnknownEpoch) { // possibly, we request epoch which is far behind in the past, in this case we won't have it in cache. // try asking by parent ID + // TODO: this assumes no identity table changes within epochs, must be changed for Dynamic Protocol State + // See https://github.com/onflow/flow-go/issues/4085 members, err = b.IdentitiesByBlock(header.ParentID) if err != nil { return nil, fmt.Errorf("could not retrieve identities for block %x with QC view %d for parent %x: %w", diff --git a/state/protocol/badger/snapshot_test.go b/state/protocol/badger/snapshot_test.go index 3b37b82cdf0..02f885d5a79 100644 --- a/state/protocol/badger/snapshot_test.go +++ b/state/protocol/badger/snapshot_test.go @@ -31,6 +31,52 @@ func init() { rand.Seed(time.Now().UnixNano()) } +// TestUnknownReferenceBlock tests queries for snapshots which should be unknown. +// We use this fixture: +// - Root height: 100 +// - Heights [100, 110] are finalized +// - Height 111 is unfinalized +func TestUnknownReferenceBlock(t *testing.T) { + rootHeight := uint64(100) + participants := unittest.IdentityListFixture(5, unittest.WithAllRoles()) + rootSnapshot := unittest.RootSnapshotFixture(participants, func(block *flow.Block) { + block.Header.Height = rootHeight + }) + + util.RunWithFullProtocolState(t, rootSnapshot, func(db *badger.DB, state *bprotocol.ParticipantState) { + // build some finalized non-root blocks (heights 101-110) + head := rootSnapshot.Encodable().Head + const nBlocks = 10 + for i := 0; i < nBlocks; i++ { + next := unittest.BlockWithParentFixture(head) + buildFinalizedBlock(t, state, next) + head = next.Header + } + // build an unfinalized block (height 111) + buildBlock(t, state, unittest.BlockWithParentFixture(head)) + + finalizedHeader, err := state.Final().Head() + require.NoError(t, err) + + t.Run("below root height", func(t *testing.T) { + _, err := state.AtHeight(rootHeight - 1).Head() + assert.ErrorIs(t, err, statepkg.ErrUnknownSnapshotReference) + }) + t.Run("above finalized height, non-existent height", func(t *testing.T) { + _, err := state.AtHeight(finalizedHeader.Height + 100).Head() + assert.ErrorIs(t, err, statepkg.ErrUnknownSnapshotReference) + }) + t.Run("above finalized height, existent height", func(t *testing.T) { + _, err := state.AtHeight(finalizedHeader.Height + 1).Head() + assert.ErrorIs(t, err, statepkg.ErrUnknownSnapshotReference) + }) + t.Run("unknown block ID", func(t *testing.T) { + _, err := state.AtBlockID(unittest.IdentifierFixture()).Head() + assert.ErrorIs(t, err, statepkg.ErrUnknownSnapshotReference) + }) + }) +} + func TestHead(t *testing.T) { participants := unittest.IdentityListFixture(5, unittest.WithAllRoles()) rootSnapshot := unittest.RootSnapshotFixture(participants) diff --git a/state/protocol/snapshot.go b/state/protocol/snapshot.go index d0041be83c4..76268b47a86 100644 --- a/state/protocol/snapshot.go +++ b/state/protocol/snapshot.go @@ -24,6 +24,8 @@ import ( // // See https://github.com/dapperlabs/flow-go/issues/6368 for details and proposal // +// A snapshot with an unknown reference block will return state.ErrUnknownSnapshotReference for all methods. +// // TODO document error returns type Snapshot interface { @@ -37,7 +39,8 @@ type Snapshot interface { // QuorumCertificate returns a valid quorum certificate for the header at // this snapshot, if one exists. // Expected error returns: - // * storage.ErrNotFound is returned if the QC is unknown. + // - storage.ErrNotFound is returned if the QC is unknown. + // - state.ErrUnknownSnapshotReference if the snapshot reference block is unknown // All other errors should be treated as exceptions. QuorumCertificate() (*flow.QuorumCertificate, error) @@ -91,8 +94,9 @@ type Snapshot interface { // missing from the payload. These missing execution results are stored on the // flow.SealingSegment.ExecutionResults field. // Expected errors during normal operations: - // - protocol.ErrSealingSegmentBelowRootBlock if sealing segment would stretch beyond the node's local history cut-off - // - protocol.UnfinalizedSealingSegmentError if sealing segment would contain unfinalized blocks (including orphaned blocks) + // - protocol.ErrSealingSegmentBelowRootBlock if sealing segment would stretch beyond the node's local history cut-off + // - protocol.UnfinalizedSealingSegmentError if sealing segment would contain unfinalized blocks (including orphaned blocks) + // - state.ErrUnknownSnapshotReference if the snapshot reference block is unknown SealingSegment() (*flow.SealingSegment, error) // Descendants returns the IDs of all descendants of the Head block. @@ -111,7 +115,8 @@ type Snapshot interface { // QC known (yet) for the head block. // NOTE: not to be confused with the epoch source of randomness! // Expected error returns: - // * storage.ErrNotFound is returned if the QC is unknown. + // - storage.ErrNotFound is returned if the QC is unknown. + // - state.ErrUnknownSnapshotReference if the snapshot reference block is unknown // All other errors should be treated as exceptions. RandomSource() ([]byte, error) @@ -125,8 +130,10 @@ type Snapshot interface { // For epochs that are in the future w.r.t. the Head block, some of Epoch's // methods may return errors, since the Epoch Preparation Protocol may be // in-progress and incomplete for the epoch. + // Returns invalid.Epoch with state.ErrUnknownSnapshotReference if snapshot reference block is unknown. Epochs() EpochQuery // Params returns global parameters of the state this snapshot is taken from. + // Returns invalid.Params with state.ErrUnknownSnapshotReference if snapshot reference block is unknown. Params() GlobalParams } From da47539ce24e32da4c0c18a07700d14028a40a3a Mon Sep 17 00:00:00 2001 From: Jordan Schalm Date: Fri, 24 Mar 2023 11:11:15 -0400 Subject: [PATCH 05/12] check for unknown snapshot sentinel --- consensus/hotstuff/committee.go | 42 +++++++++---------- .../committees/consensus_committee.go | 11 +++-- .../committees/consensus_committee_test.go | 6 +++ .../signature/block_signer_decoder.go | 3 +- 4 files changed, 37 insertions(+), 25 deletions(-) diff --git a/consensus/hotstuff/committee.go b/consensus/hotstuff/committee.go index 47c62bad525..422ddb4351c 100644 --- a/consensus/hotstuff/committee.go +++ b/consensus/hotstuff/committee.go @@ -25,8 +25,8 @@ import ( // So for validating votes/timeouts we use *ByEpoch methods. // // Since the voter committee is considered static over an epoch: -// * we can query identities by view -// * we don't need the full block ancestry prior to validating messages +// - we can query identities by view +// - we don't need the full block ancestry prior to validating messages type Replicas interface { // LeaderForView returns the identity of the leader for a given view. @@ -34,14 +34,14 @@ type Replicas interface { // Therefore, a node retains its proposer view slots even if it is slashed. // Its proposal is simply considered invalid, as it is not from a legitimate participant. // Returns the following expected errors for invalid inputs: - // * model.ErrViewForUnknownEpoch if no epoch containing the given view is known + // - model.ErrViewForUnknownEpoch if no epoch containing the given view is known LeaderForView(view uint64) (flow.Identifier, error) // QuorumThresholdForView returns the minimum total weight for a supermajority // at the given view. This weight threshold is computed using the total weight // of the initial committee and is static over the course of an epoch. // Returns the following expected errors for invalid inputs: - // * model.ErrViewForUnknownEpoch if no epoch containing the given view is known + // - model.ErrViewForUnknownEpoch if no epoch containing the given view is known QuorumThresholdForView(view uint64) (uint64, error) // TimeoutThresholdForView returns the minimum total weight of observed timeout objects @@ -49,7 +49,7 @@ type Replicas interface { // using the total weight of the initial committee and is static over the course of // an epoch. // Returns the following expected errors for invalid inputs: - // * model.ErrViewForUnknownEpoch if no epoch containing the given view is known + // - model.ErrViewForUnknownEpoch if no epoch containing the given view is known TimeoutThresholdForView(view uint64) (uint64, error) // Self returns our own node identifier. @@ -60,16 +60,16 @@ type Replicas interface { // DKG returns the DKG info for epoch given by the input view. // Returns the following expected errors for invalid inputs: - // * model.ErrViewForUnknownEpoch if no epoch containing the given view is known + // - model.ErrViewForUnknownEpoch if no epoch containing the given view is known DKG(view uint64) (DKG, error) // IdentitiesByEpoch returns a list of the legitimate HotStuff participants for the epoch // given by the input view. The list of participants is filtered by the provided selector. // The returned list of HotStuff participants: - // * contains nodes that are allowed to submit votes or timeouts within the given epoch + // - contains nodes that are allowed to submit votes or timeouts within the given epoch // (un-ejected, non-zero weight at the beginning of the epoch) - // * is ordered in the canonical order - // * contains no duplicates. + // - is ordered in the canonical order + // - contains no duplicates. // The list of all legitimate HotStuff participants for the given epoch can be obtained by using `filter.Any` // // CAUTION: DO NOT use this method for validating block proposals. @@ -77,7 +77,7 @@ type Replicas interface { // finalized block, to be unknown. https://github.com/onflow/flow-go/issues/4085 // // Returns the following expected errors for invalid inputs: - // * model.ErrViewForUnknownEpoch if no epoch containing the given view is known + // - model.ErrViewForUnknownEpoch if no epoch containing the given view is known // // TODO: should return identity skeleton https://github.com/dapperlabs/flow-go/issues/6232 IdentitiesByEpoch(view uint64) (flow.IdentityList, error) @@ -88,10 +88,10 @@ type Replicas interface { // finalized block, to be unknown. https://github.com/onflow/flow-go/issues/4085 // // ERROR conditions: - // * model.InvalidSignerError if participantID does NOT correspond to an authorized HotStuff participant at the specified block. + // - model.InvalidSignerError if participantID does NOT correspond to an authorized HotStuff participant at the specified block. // // Returns the following expected errors for invalid inputs: - // * model.ErrViewForUnknownEpoch if no epoch containing the given view is known + // - model.ErrViewForUnknownEpoch if no epoch containing the given view is known // // TODO: should return identity skeleton https://github.com/dapperlabs/flow-go/issues/6232 IdentityByEpoch(view uint64, participantID flow.Identifier) (*flow.Identity, error) @@ -103,29 +103,29 @@ type Replicas interface { // For validating proposals, we use *ByBlock methods. // // Since the proposer committee can change at any block: -// * we query by block ID -// * we must have incorporated the full block ancestry prior to validating messages +// - we query by block ID +// - we must have incorporated the full block ancestry prior to validating messages type DynamicCommittee interface { Replicas // IdentitiesByBlock returns a list of the legitimate HotStuff participants for the given block. // The list of participants is filtered by the provided selector. // The returned list of HotStuff participants: - // * contains nodes that are allowed to submit proposals, votes, and timeouts + // - contains nodes that are allowed to submit proposals, votes, and timeouts // (un-ejected, non-zero weight at current block) - // * is ordered in the canonical order - // * contains no duplicates. + // - is ordered in the canonical order + // - contains no duplicates. // The list of all legitimate HotStuff participants for the given epoch can be obtained by using `filter.Any` // // ERROR conditions: - // * state.ErrUnknownSnapshotReference if the blockID is for an unknown block + // - state.ErrUnknownSnapshotReference if the blockID is for an unknown block IdentitiesByBlock(blockID flow.Identifier) (flow.IdentityList, error) // IdentityByBlock returns the full Identity for specified HotStuff participant. // The node must be a legitimate HotStuff participant with NON-ZERO WEIGHT at the specified block. // ERROR conditions: - // * model.InvalidSignerError if participantID does NOT correspond to an authorized HotStuff participant at the specified block. - // * state.ErrUnknownSnapshotReference if the blockID is for an unknown block + // - model.InvalidSignerError if participantID does NOT correspond to an authorized HotStuff participant at the specified block. + // - state.ErrUnknownSnapshotReference if the blockID is for an unknown block IdentityByBlock(blockID flow.Identifier, participantID flow.Identifier) (*flow.Identity, error) } @@ -137,7 +137,7 @@ type BlockSignerDecoder interface { // consensus committee has reached agreement on validity of parent block. Consequently, the // returned IdentifierList contains the consensus participants that signed the parent block. // Expected Error returns during normal operations: - // * signature.InvalidSignerIndicesError if signer indices included in the header do + // - signature.InvalidSignerIndicesError if signer indices included in the header do // not encode a valid subset of the consensus committee DecodeSignerIDs(header *flow.Header) (flow.IdentifierList, error) } diff --git a/consensus/hotstuff/committees/consensus_committee.go b/consensus/hotstuff/committees/consensus_committee.go index 156db004848..cc29265e464 100644 --- a/consensus/hotstuff/committees/consensus_committee.go +++ b/consensus/hotstuff/committees/consensus_committee.go @@ -189,22 +189,27 @@ func NewConsensusCommittee(state protocol.State, me flow.Identifier) (*Consensus // IdentitiesByBlock returns the identities of all authorized consensus participants at the given block. // The order of the identities is the canonical order. -// No errors are expected during normal operation. +// ERROR conditions: +// - state.ErrUnknownSnapshotReference if the blockID is for an unknown block func (c *Consensus) IdentitiesByBlock(blockID flow.Identifier) (flow.IdentityList, error) { il, err := c.state.AtBlockID(blockID).Identities(filter.IsVotingConsensusCommitteeMember) - return il, err + if err != nil { + return nil, fmt.Errorf("could not identities at block %x: %w", blockID, err) // state.ErrUnknownSnapshotReference or exception + } + return il, nil } // IdentityByBlock returns the identity of the node with the given node ID at the given block. // ERROR conditions: // - model.InvalidSignerError if participantID does NOT correspond to an authorized HotStuff participant at the specified block. +// - state.ErrUnknownSnapshotReference if the blockID is for an unknown block func (c *Consensus) IdentityByBlock(blockID flow.Identifier, nodeID flow.Identifier) (*flow.Identity, error) { identity, err := c.state.AtBlockID(blockID).Identity(nodeID) if err != nil { if protocol.IsIdentityNotFound(err) { return nil, model.NewInvalidSignerErrorf("id %v is not a valid node id: %w", nodeID, err) } - return nil, fmt.Errorf("could not get identity for node ID %x: %w", nodeID, err) + return nil, fmt.Errorf("could not get identity for node ID %x: %w", nodeID, err) // state.ErrUnknownSnapshotReference or exception } if !filter.IsVotingConsensusCommitteeMember(identity) { return nil, model.NewInvalidSignerErrorf("node %v is not an authorized hotstuff voting participant", nodeID) diff --git a/consensus/hotstuff/committees/consensus_committee_test.go b/consensus/hotstuff/committees/consensus_committee_test.go index b8d1f5bc415..d2ecdc7fae2 100644 --- a/consensus/hotstuff/committees/consensus_committee_test.go +++ b/consensus/hotstuff/committees/consensus_committee_test.go @@ -16,6 +16,7 @@ import ( "github.com/onflow/flow-go/model/flow" "github.com/onflow/flow-go/model/flow/mapfunc" "github.com/onflow/flow-go/module/irrecoverable" + "github.com/onflow/flow-go/state" "github.com/onflow/flow-go/state/protocol" protocolmock "github.com/onflow/flow-go/state/protocol/mock" "github.com/onflow/flow-go/state/protocol/seed" @@ -314,6 +315,11 @@ func (suite *ConsensusSuite) TestIdentitiesByBlock() { _, err := suite.committee.IdentityByBlock(blockID, unittest.IdentifierFixture()) assert.ErrorIs(t, err, mockErr) }) + t.Run("should propagate state.ErrUnknownSnapshotReference", func(t *testing.T) { + suite.snapshot.On("Identity", mock.Anything).Return(nil, state.ErrUnknownSnapshotReference) + _, err := suite.committee.IdentityByBlock(blockID, unittest.IdentifierFixture()) + assert.ErrorIs(t, err, state.ErrUnknownSnapshotReference) + }) } // TestIdentitiesByEpoch tests that identities can be queried by epoch. diff --git a/consensus/hotstuff/signature/block_signer_decoder.go b/consensus/hotstuff/signature/block_signer_decoder.go index ea08dbad5fd..b9ab35eee3c 100644 --- a/consensus/hotstuff/signature/block_signer_decoder.go +++ b/consensus/hotstuff/signature/block_signer_decoder.go @@ -29,6 +29,7 @@ var _ hotstuff.BlockSignerDecoder = (*BlockSignerDecoder)(nil) // Expected Error returns during normal operations: // - signature.InvalidSignerIndicesError if signer indices included in the header do // not encode a valid subset of the consensus committee +// - state.ErrUnknownSnapshotReference if the input header is not a known incorporated block. func (b *BlockSignerDecoder) DecodeSignerIDs(header *flow.Header) (flow.IdentifierList, error) { // root block does not have signer indices if header.ParentVoterIndices == nil && header.View == 0 { @@ -46,7 +47,7 @@ func (b *BlockSignerDecoder) DecodeSignerIDs(header *flow.Header) (flow.Identifi members, err = b.IdentitiesByBlock(header.ParentID) if err != nil { return nil, fmt.Errorf("could not retrieve identities for block %x with QC view %d for parent %x: %w", - header.ID(), header.ParentView, header.ParentID, err) + header.ID(), header.ParentView, header.ParentID, err) // state.ErrUnknownSnapshotReference or exception } } else { return nil, fmt.Errorf("unexpected error retrieving identities for block %v: %w", header.ID(), err) From 58629368a7cb0ac2ceae23294837adb86a5ebeb2 Mon Sep 17 00:00:00 2001 From: Jordan Schalm Date: Fri, 24 Mar 2023 11:23:18 -0400 Subject: [PATCH 06/12] signer decoder tests --- .../signature/block_signer_decoder_test.go | 54 ++++++++++++++----- 1 file changed, 40 insertions(+), 14 deletions(-) diff --git a/consensus/hotstuff/signature/block_signer_decoder_test.go b/consensus/hotstuff/signature/block_signer_decoder_test.go index 0a399797c46..2940c21f390 100644 --- a/consensus/hotstuff/signature/block_signer_decoder_test.go +++ b/consensus/hotstuff/signature/block_signer_decoder_test.go @@ -2,7 +2,6 @@ package signature import ( "errors" - "fmt" "testing" "github.com/stretchr/testify/mock" @@ -14,6 +13,7 @@ import ( "github.com/onflow/flow-go/model/flow" "github.com/onflow/flow-go/model/flow/order" "github.com/onflow/flow-go/module/signature" + "github.com/onflow/flow-go/state" "github.com/onflow/flow-go/utils/unittest" ) @@ -65,31 +65,57 @@ func (s *blockSignerDecoderSuite) Test_RootBlock() { require.Empty(s.T(), ids) } -// Test_UnexpectedCommitteeException verifies that `BlockSignerDecoder` +// Test_CommitteeException verifies that `BlockSignerDecoder` // does _not_ erroneously interpret an unexpected exception from the committee as // a sign of an unknown block, i.e. the decoder should _not_ return an `model.ErrViewForUnknownEpoch` or `signature.InvalidSignerIndicesError` -func (s *blockSignerDecoderSuite) Test_UnexpectedCommitteeException() { - exception := errors.New("unexpected exception") +func (s *blockSignerDecoderSuite) Test_CommitteeException() { + s.Run("ByEpoch exception", func() { + exception := errors.New("unexpected exception") + *s.committee = *hotstuff.NewDynamicCommittee(s.T()) + s.committee.On("IdentitiesByEpoch", mock.Anything).Return(nil, exception) + + ids, err := s.decoder.DecodeSignerIDs(s.block.Header) + require.Empty(s.T(), ids) + require.NotErrorIs(s.T(), err, model.ErrViewForUnknownEpoch) + require.False(s.T(), signature.IsInvalidSignerIndicesError(err)) + require.True(s.T(), errors.Is(err, exception)) + }) + s.Run("ByBlock exception", func() { + exception := errors.New("unexpected exception") + *s.committee = *hotstuff.NewDynamicCommittee(s.T()) + s.committee.On("IdentitiesByEpoch", mock.Anything).Return(nil, model.ErrViewForUnknownEpoch) + s.committee.On("IdentitiesByBlock", mock.Anything).Return(nil, exception) + + ids, err := s.decoder.DecodeSignerIDs(s.block.Header) + require.Empty(s.T(), ids) + require.NotErrorIs(s.T(), err, model.ErrViewForUnknownEpoch) + require.False(s.T(), signature.IsInvalidSignerIndicesError(err)) + require.True(s.T(), errors.Is(err, exception)) + }) +} + +// Test_UnknownEpoch_KnownBlock tests handling of a block from an un-cached epoch but +// where the block is known - should return identities for block. +func (s *blockSignerDecoderSuite) Test_UnknownEpoch_KnownBlock() { *s.committee = *hotstuff.NewDynamicCommittee(s.T()) - s.committee.On("IdentitiesByEpoch", mock.Anything).Return(nil, exception) + s.committee.On("IdentitiesByEpoch", s.block.Header.ParentView).Return(nil, model.ErrViewForUnknownEpoch) + s.committee.On("IdentitiesByBlock", s.block.Header.ParentID).Return(s.allConsensus, nil) ids, err := s.decoder.DecodeSignerIDs(s.block.Header) - require.Empty(s.T(), ids) - require.NotErrorIs(s.T(), err, model.ErrViewForUnknownEpoch) - require.False(s.T(), signature.IsInvalidSignerIndicesError(err)) - require.True(s.T(), errors.Is(err, exception)) + require.NoError(s.T(), err) + require.Equal(s.T(), s.allConsensus.NodeIDs(), ids) } -// Test_UnknownEpoch tests handling of a block from an unknown epoch. -// It should propagate the sentinel error model.ErrViewForUnknownEpoch from Committee. -func (s *blockSignerDecoderSuite) Test_UnknownEpoch() { +// Test_UnknownEpoch_UnknownBlock tests handling of a block from an un-cached epoch +// where the block is unknown - should propagate state.ErrUnknownSnapshotReference. +func (s *blockSignerDecoderSuite) Test_UnknownEpoch_UnknownBlock() { *s.committee = *hotstuff.NewDynamicCommittee(s.T()) s.committee.On("IdentitiesByEpoch", s.block.Header.ParentView).Return(nil, model.ErrViewForUnknownEpoch) - s.committee.On("IdentitiesByBlock", s.block.Header.ParentID).Return(nil, fmt.Errorf("")) + s.committee.On("IdentitiesByBlock", s.block.Header.ParentID).Return(nil, state.ErrUnknownSnapshotReference) ids, err := s.decoder.DecodeSignerIDs(s.block.Header) + require.ErrorIs(s.T(), err, state.ErrUnknownSnapshotReference) require.Empty(s.T(), ids) - require.Error(s.T(), err) } // Test_InvalidIndices verifies that `BlockSignerDecoder` returns From 98e8841da4505099a19917c6981779411d84b138 Mon Sep 17 00:00:00 2001 From: Jordan Schalm Date: Fri, 24 Mar 2023 12:29:33 -0400 Subject: [PATCH 07/12] update mocks --- state/protocol/snapshot.go | 4 ++-- storage/mock/headers.go | 24 ++++++++++++++++++++++++ storage/mocks/storage.go | 15 +++++++++++++++ 3 files changed, 41 insertions(+), 2 deletions(-) diff --git a/state/protocol/snapshot.go b/state/protocol/snapshot.go index 76268b47a86..73b3acf8930 100644 --- a/state/protocol/snapshot.go +++ b/state/protocol/snapshot.go @@ -39,8 +39,8 @@ type Snapshot interface { // QuorumCertificate returns a valid quorum certificate for the header at // this snapshot, if one exists. // Expected error returns: - // - storage.ErrNotFound is returned if the QC is unknown. - // - state.ErrUnknownSnapshotReference if the snapshot reference block is unknown + // - storage.ErrNotFound is returned if the QC is unknown. + // - state.ErrUnknownSnapshotReference if the snapshot reference block is unknown // All other errors should be treated as exceptions. QuorumCertificate() (*flow.QuorumCertificate, error) diff --git a/storage/mock/headers.go b/storage/mock/headers.go index 5ba505a135c..0c21e53fe07 100644 --- a/storage/mock/headers.go +++ b/storage/mock/headers.go @@ -146,6 +146,30 @@ func (_m *Headers) ByParentID(parentID flow.Identifier) ([]*flow.Header, error) return r0, r1 } +// Exists provides a mock function with given fields: blockID +func (_m *Headers) Exists(blockID flow.Identifier) (bool, error) { + ret := _m.Called(blockID) + + var r0 bool + var r1 error + if rf, ok := ret.Get(0).(func(flow.Identifier) (bool, error)); ok { + return rf(blockID) + } + if rf, ok := ret.Get(0).(func(flow.Identifier) bool); ok { + r0 = rf(blockID) + } else { + r0 = ret.Get(0).(bool) + } + + if rf, ok := ret.Get(1).(func(flow.Identifier) error); ok { + r1 = rf(blockID) + } else { + r1 = ret.Error(1) + } + + return r0, r1 +} + // IDByChunkID provides a mock function with given fields: chunkID func (_m *Headers) IDByChunkID(chunkID flow.Identifier) (flow.Identifier, error) { ret := _m.Called(chunkID) diff --git a/storage/mocks/storage.go b/storage/mocks/storage.go index 04e4a63c5a7..49fdbe48c96 100644 --- a/storage/mocks/storage.go +++ b/storage/mocks/storage.go @@ -277,6 +277,21 @@ func (mr *MockHeadersMockRecorder) ByParentID(arg0 interface{}) *gomock.Call { return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "ByParentID", reflect.TypeOf((*MockHeaders)(nil).ByParentID), arg0) } +// Exists mocks base method. +func (m *MockHeaders) Exists(arg0 flow.Identifier) (bool, error) { + m.ctrl.T.Helper() + ret := m.ctrl.Call(m, "Exists", arg0) + ret0, _ := ret[0].(bool) + ret1, _ := ret[1].(error) + return ret0, ret1 +} + +// Exists indicates an expected call of Exists. +func (mr *MockHeadersMockRecorder) Exists(arg0 interface{}) *gomock.Call { + mr.mock.ctrl.T.Helper() + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "Exists", reflect.TypeOf((*MockHeaders)(nil).Exists), arg0) +} + // IDByChunkID mocks base method. func (m *MockHeaders) IDByChunkID(arg0 flow.Identifier) (flow.Identifier, error) { m.ctrl.T.Helper() From 60981f76451e25b8ea2d12ee0de54a2842b1233d Mon Sep 17 00:00:00 2001 From: Jordan Schalm Date: Fri, 24 Mar 2023 17:38:14 -0400 Subject: [PATCH 08/12] bump flow-emu version --- go.mod | 22 ++++++++-------- go.sum | 42 ++++++++++++++++--------------- insecure/go.mod | 22 ++++++++-------- insecure/go.sum | 42 ++++++++++++++++--------------- integration/go.mod | 32 +++++++++++++---------- integration/go.sum | 63 ++++++++++++++++++++++++++++------------------ 6 files changed, 124 insertions(+), 99 deletions(-) diff --git a/go.mod b/go.mod index 32a34e95218..c7588205062 100644 --- a/go.mod +++ b/go.mod @@ -3,7 +3,7 @@ module github.com/onflow/flow-go go 1.19 require ( - cloud.google.com/go/compute/metadata v0.2.1 + cloud.google.com/go/compute/metadata v0.2.3 cloud.google.com/go/profiler v0.3.0 cloud.google.com/go/storage v1.27.0 github.com/antihax/optional v1.0.0 @@ -89,9 +89,9 @@ require ( golang.org/x/text v0.7.0 golang.org/x/time v0.0.0-20210723032227-1f47c861a9ac golang.org/x/tools v0.4.0 - google.golang.org/api v0.102.0 - google.golang.org/genproto v0.0.0-20221118155620-16455021b5e6 - google.golang.org/grpc v1.52.3 + google.golang.org/api v0.103.0 + google.golang.org/genproto v0.0.0-20230110181048-76db0878b65f + google.golang.org/grpc v1.53.0 google.golang.org/grpc/cmd/protoc-gen-go-grpc v1.1.0 google.golang.org/protobuf v1.28.1 gotest.tools v2.2.0+incompatible @@ -101,9 +101,9 @@ require ( require github.com/slok/go-http-metrics v0.10.0 require ( - cloud.google.com/go v0.105.0 // indirect - cloud.google.com/go/compute v1.12.1 // indirect - cloud.google.com/go/iam v0.7.0 // indirect + cloud.google.com/go v0.107.0 // indirect + cloud.google.com/go/compute v1.15.1 // indirect + cloud.google.com/go/iam v0.8.0 // indirect github.com/aws/aws-sdk-go-v2 v1.17.3 // indirect github.com/aws/aws-sdk-go-v2/credentials v1.13.10 // indirect github.com/aws/aws-sdk-go-v2/feature/ec2/imds v1.12.21 // indirect @@ -133,7 +133,7 @@ require ( github.com/dgraph-io/ristretto v0.0.3-0.20200630154024-f66de99634de // indirect github.com/dgryski/go-farm v0.0.0-20190423205320-6a90982ecee2 // indirect github.com/docker/go-units v0.5.0 // indirect - github.com/dustin/go-humanize v1.0.0 // indirect + github.com/dustin/go-humanize v1.0.1 // indirect github.com/elastic/gosigar v0.14.2 // indirect github.com/felixge/fgprof v0.9.3 // indirect github.com/flynn/noise v1.0.0 // indirect @@ -156,7 +156,7 @@ require ( github.com/golang/snappy v0.0.4 // indirect github.com/google/gopacket v1.1.19 // indirect github.com/googleapis/enterprise-certificate-proxy v0.2.0 // indirect - github.com/googleapis/gax-go/v2 v2.6.0 // indirect + github.com/googleapis/gax-go/v2 v2.7.0 // indirect github.com/gorilla/websocket v1.5.0 // indirect github.com/hashicorp/errwrap v1.1.0 // indirect github.com/hashicorp/hcl v1.0.0 // indirect @@ -204,7 +204,7 @@ require ( github.com/marten-seemann/qtls-go1-19 v0.1.1 // indirect github.com/marten-seemann/tcp v0.0.0-20210406111302-dfbc87cc63fd // indirect github.com/mattn/go-colorable v0.1.13 // indirect - github.com/mattn/go-isatty v0.0.16 // indirect + github.com/mattn/go-isatty v0.0.17 // indirect github.com/mattn/go-pointer v0.0.1 // indirect github.com/mattn/go-runewidth v0.0.13 // indirect github.com/matttproud/golang_protobuf_extensions v1.0.4 // indirect @@ -264,7 +264,7 @@ require ( go.uber.org/zap v1.24.0 // indirect golang.org/x/mod v0.7.0 // indirect golang.org/x/net v0.7.0 // indirect - golang.org/x/oauth2 v0.3.0 // indirect + golang.org/x/oauth2 v0.4.0 // indirect golang.org/x/term v0.5.0 // indirect golang.org/x/xerrors v0.0.0-20220907171357-04be3eba64a2 // indirect gonum.org/v1/gonum v0.8.2 // indirect diff --git a/go.sum b/go.sum index 35602a9ec0e..aa1d7258a09 100644 --- a/go.sum +++ b/go.sum @@ -31,8 +31,8 @@ cloud.google.com/go v0.94.1/go.mod h1:qAlAugsXlC+JWO+Bke5vCtc9ONxjQT3drlTTnAplMW cloud.google.com/go v0.97.0/go.mod h1:GF7l59pYBVlXQIBLx3a761cZ41F9bBH3JUlihCt2Udc= cloud.google.com/go v0.99.0/go.mod h1:w0Xx2nLzqWJPuozYQX+hFfCSI8WioryfRDzkoI/Y2ZA= cloud.google.com/go v0.100.2/go.mod h1:4Xra9TjzAeYHrl5+oeLlzbM2k3mjVhZh4UqTZ//w99A= -cloud.google.com/go v0.105.0 h1:DNtEKRBAAzeS4KyIory52wWHuClNaXJ5x1F7xa4q+5Y= -cloud.google.com/go v0.105.0/go.mod h1:PrLgOJNe5nfE9UMxKxgXj4mD3voiP+YQ6gdt6KMFOKM= +cloud.google.com/go v0.107.0 h1:qkj22L7bgkl6vIeZDlOY2po43Mx/TIa2Wsa7VR+PEww= +cloud.google.com/go v0.107.0/go.mod h1:wpc2eNrD7hXUTy8EKS10jkxpZBjASrORK7goS+3YX2I= cloud.google.com/go/bigquery v1.0.1/go.mod h1:i/xbL2UlR5RvWAURpBYZTtm/cXjCha9lbfbpx4poX+o= cloud.google.com/go/bigquery v1.3.0/go.mod h1:PjpwJnslEMmckchkHFfq+HTD2DmtT67aNFKH1/VBDHE= cloud.google.com/go/bigquery v1.4.0/go.mod h1:S8dzgnTigyfTmLBfrtrhyYhwRxG72rYxvftPBK2Dvzc= @@ -44,15 +44,15 @@ cloud.google.com/go/compute v1.3.0/go.mod h1:cCZiE1NHEtai4wiufUhW8I8S1JKkAnhnQJW cloud.google.com/go/compute v1.5.0/go.mod h1:9SMHyhJlzhlkJqrPAc839t2BZFTSk6Jdj6mkzQJeu0M= cloud.google.com/go/compute v1.6.0/go.mod h1:T29tfhtVbq1wvAPo0E3+7vhgmkOYeXjhFvz/FMzPu0s= cloud.google.com/go/compute v1.6.1/go.mod h1:g85FgpzFvNULZ+S8AYq87axRKuf2Kh7deLqV/jJ3thU= -cloud.google.com/go/compute v1.12.1 h1:gKVJMEyqV5c/UnpzjjQbo3Rjvvqpr9B1DFSbJC4OXr0= -cloud.google.com/go/compute v1.12.1/go.mod h1:e8yNOBcBONZU1vJKCvCoDw/4JQsA0dpM4x/6PIIOocU= -cloud.google.com/go/compute/metadata v0.2.1 h1:efOwf5ymceDhK6PKMnnrTHP4pppY5L22mle96M1yP48= -cloud.google.com/go/compute/metadata v0.2.1/go.mod h1:jgHgmJd2RKBGzXqF5LR2EZMGxBkeanZ9wwa75XHJgOM= +cloud.google.com/go/compute v1.15.1 h1:7UGq3QknM33pw5xATlpzeoomNxsacIVvTqTTvbfajmE= +cloud.google.com/go/compute v1.15.1/go.mod h1:bjjoF/NtFUrkD/urWfdHaKuOPDR5nWIs63rR+SXhcpA= +cloud.google.com/go/compute/metadata v0.2.3 h1:mg4jlk7mCAj6xXp9UJ4fjI9VUI5rubuGBW5aJ7UnBMY= +cloud.google.com/go/compute/metadata v0.2.3/go.mod h1:VAV5nSsACxMJvgaAuX6Pk2AawlZn8kiOGuCv6gTkwuA= cloud.google.com/go/datastore v1.0.0/go.mod h1:LXYbyblFSglQ5pkeyhO+Qmw7ukd3C+pD7TKLgZqpHYE= cloud.google.com/go/datastore v1.1.0/go.mod h1:umbIZjpQpHh4hmRpGhH4tLFup+FVzqBi1b3c64qFpCk= cloud.google.com/go/iam v0.3.0/go.mod h1:XzJPvDayI+9zsASAFO68Hk07u3z+f+JrT2xXNdp4bnY= -cloud.google.com/go/iam v0.7.0 h1:k4MuwOsS7zGJJ+QfZ5vBK8SgHBAvYN/23BWsiihJ1vs= -cloud.google.com/go/iam v0.7.0/go.mod h1:H5Br8wRaDGNc8XP3keLc4unfUUZeyH3Sfl9XpQEYOeg= +cloud.google.com/go/iam v0.8.0 h1:E2osAkZzxI/+8pZcxVLcDtAQx/u+hZXVryUaYQ5O0Kk= +cloud.google.com/go/iam v0.8.0/go.mod h1:lga0/y3iH6CX7sYqypWJ33hf7kkfXJag67naqGESjkE= cloud.google.com/go/longrunning v0.3.0 h1:NjljC+FYPV3uh5/OwWT6pVU+doBqMg2x/rZlE+CamDs= cloud.google.com/go/profiler v0.3.0 h1:R6y/xAeifaUXxd2x6w+jIwKxoKl8Cv5HJvcvASTPWJo= cloud.google.com/go/profiler v0.3.0/go.mod h1:9wYk9eY4iZHsev8TQb61kh3wiOiSyz/xOYixWPzweCU= @@ -294,8 +294,9 @@ github.com/docker/go-units v0.5.0 h1:69rxXcBk27SvSaaxTtLh/8llcHD8vYHT7WSdRZ/jvr4 github.com/docker/go-units v0.5.0/go.mod h1:fgPhTUdO+D/Jk86RDLlptpiXQzgHJF7gydDDbaIK4Dk= github.com/dop251/goja v0.0.0-20200219165308-d1232e640a87/go.mod h1:Mw6PkjjMXWbTj+nnj4s3QPXq1jaT0s5pC0iFD4+BOAA= github.com/dustin/go-humanize v0.0.0-20171111073723-bb3d318650d4/go.mod h1:HtrtbFcZ19U5GC7JDqmcUSB87Iq5E25KnS6fMYU6eOk= -github.com/dustin/go-humanize v1.0.0 h1:VSnTsYCnlFHaM2/igO1h6X3HA71jcobQuxemgkq4zYo= github.com/dustin/go-humanize v1.0.0/go.mod h1:HtrtbFcZ19U5GC7JDqmcUSB87Iq5E25KnS6fMYU6eOk= +github.com/dustin/go-humanize v1.0.1 h1:GzkhY7T5VNhEkwH0PVJgjz+fX1rhBrR7pRT3mDkpeCY= +github.com/dustin/go-humanize v1.0.1/go.mod h1:Mu1zIs6XwVuF/gI1OepvI0qD18qycQx+mFykh5fBlto= github.com/eapache/go-resiliency v1.1.0/go.mod h1:kFI+JgMyC7bLPUVY133qvEBtVayf5mFgVsvEsIPBvNs= github.com/eapache/go-xerial-snappy v0.0.0-20180814174437-776d5712da21/go.mod h1:+020luEh2TKB4/GOp8oxxtq0Daoen/Cii55CzbTV6DU= github.com/eapache/queue v1.1.0/go.mod h1:6eCeP0CKFpHLu8blIFXhExK/dRa7WDZfr6jVFPTqq+I= @@ -532,8 +533,8 @@ github.com/googleapis/gax-go/v2 v2.1.1/go.mod h1:hddJymUZASv3XPyGkUpKj8pPO47Rmb0 github.com/googleapis/gax-go/v2 v2.2.0/go.mod h1:as02EH8zWkzwUoLbBaFeQ+arQaj/OthfcblKl4IGNaM= github.com/googleapis/gax-go/v2 v2.3.0/go.mod h1:b8LNqSzNabLiUpXKkY7HAR5jr6bIT99EXz9pXxye9YM= github.com/googleapis/gax-go/v2 v2.4.0/go.mod h1:XOTVJ59hdnfJLIP/dh8n5CGryZR2LxK9wbMD5+iXC6c= -github.com/googleapis/gax-go/v2 v2.6.0 h1:SXk3ABtQYDT/OH8jAyvEOQ58mgawq5C4o/4/89qN2ZU= -github.com/googleapis/gax-go/v2 v2.6.0/go.mod h1:1mjbznJAPHFpesgE5ucqfYEscaz5kMdcIDwU/6+DDoY= +github.com/googleapis/gax-go/v2 v2.7.0 h1:IcsPKeInNvYi7eqSaDjiZqDDKu5rsmunY0Y1YupQSSQ= +github.com/googleapis/gax-go/v2 v2.7.0/go.mod h1:TEop28CZZQ2y+c0VxMUmu1lV+fQx57QpBWsYpwqHJx8= github.com/googleapis/go-type-adapters v1.0.0/go.mod h1:zHW75FOG2aur7gAO2B+MLby+cLsWGBF62rFAi7WjWO4= github.com/googleapis/google-cloud-go-testing v0.0.0-20200911160855-bcd43fbb19e8/go.mod h1:dvDLG8qkwmyD9a/MJJN3XJcT3xFxOKAvTZGvuZmac9g= github.com/gopherjs/gopherjs v0.0.0-20181017120253-0766667cb4d1 h1:EGx4pi6eqNxGaHF6qqu48+N2wcFQ5qg5FXgOdqsJ5d8= @@ -1069,8 +1070,9 @@ github.com/mattn/go-isatty v0.0.9/go.mod h1:YNRxwqDuOph6SZLI9vUUz6OYw3QyUt7WiY2y github.com/mattn/go-isatty v0.0.12/go.mod h1:cbi8OIDigv2wuxKPP5vlRcQ1OAZbq2CE4Kysco4FUpU= github.com/mattn/go-isatty v0.0.13/go.mod h1:cbi8OIDigv2wuxKPP5vlRcQ1OAZbq2CE4Kysco4FUpU= github.com/mattn/go-isatty v0.0.14/go.mod h1:7GGIvUiUoEMVVmxf/4nioHXj79iQHKdU27kJ6hsGG94= -github.com/mattn/go-isatty v0.0.16 h1:bq3VjFmv/sOjHtdEhmkEV4x1AJtvUvOJ2PFAZ5+peKQ= github.com/mattn/go-isatty v0.0.16/go.mod h1:kYGgaQfpe5nmfYZH+SKPsOc2e4SrIfOl2e/yFXSvRLM= +github.com/mattn/go-isatty v0.0.17 h1:BTarxUcIeDqL27Mc+vyvdWYSL28zpIhv3RoTdsLMPng= +github.com/mattn/go-isatty v0.0.17/go.mod h1:kYGgaQfpe5nmfYZH+SKPsOc2e4SrIfOl2e/yFXSvRLM= github.com/mattn/go-pointer v0.0.1 h1:n+XhsuGeVO6MEAp7xyEukFINEa+Quek5psIR/ylA6o0= github.com/mattn/go-pointer v0.0.1/go.mod h1:2zXcozF6qYGgmsG+SeTZz3oAbFLdD3OWqnUbNvJZAlc= github.com/mattn/go-runewidth v0.0.2/go.mod h1:LwmH8dsx7+W8Uxz3IHJYH5QSwggIsqBzpuz5H//U1FU= @@ -1769,8 +1771,8 @@ golang.org/x/oauth2 v0.0.0-20211104180415-d3ed0bb246c8/go.mod h1:KelEdhl1UZF7XfJ golang.org/x/oauth2 v0.0.0-20220223155221-ee480838109b/go.mod h1:DAh4E804XQdzx2j+YRIaUnCqCV2RuMz24cGBJ5QYIrc= golang.org/x/oauth2 v0.0.0-20220309155454-6242fa91716a/go.mod h1:DAh4E804XQdzx2j+YRIaUnCqCV2RuMz24cGBJ5QYIrc= golang.org/x/oauth2 v0.0.0-20220411215720-9780585627b5/go.mod h1:DAh4E804XQdzx2j+YRIaUnCqCV2RuMz24cGBJ5QYIrc= -golang.org/x/oauth2 v0.3.0 h1:6l90koy8/LaBLmLu8jpHeHexzMwEita0zFfYlggy2F8= -golang.org/x/oauth2 v0.3.0/go.mod h1:rQrIauxkUhJ6CuwEXwymO2/eh4xz2ZWF1nBkcxS+tGk= +golang.org/x/oauth2 v0.4.0 h1:NF0gk8LVPg1Ml7SSbGyySuoxdsXitj7TvgvuRxIMc/M= +golang.org/x/oauth2 v0.4.0/go.mod h1:RznEsdpjGAINPTOF0UH/t+xJ75L18YO3Ho6Pyn+uRec= golang.org/x/perf v0.0.0-20180704124530-6e6d33e29852/go.mod h1:JLpeXjPJfIyPr5TlbXLkXWLhP8nz10XfvxElABhCtcw= golang.org/x/sync v0.0.0-20180314180146-1d60e4601c6f/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sync v0.0.0-20181108010431-42b317875d0f/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= @@ -2042,8 +2044,8 @@ google.golang.org/api v0.71.0/go.mod h1:4PyU6e6JogV1f9eA4voyrTY2batOLdgZ5qZ5HOCc google.golang.org/api v0.74.0/go.mod h1:ZpfMZOVRMywNyvJFeqL9HRWBgAuRfSjJFpe9QtRRyDs= google.golang.org/api v0.75.0/go.mod h1:pU9QmyHLnzlpar1Mjt4IbapUCy8J+6HD6GeELN69ljA= google.golang.org/api v0.78.0/go.mod h1:1Sg78yoMLOhlQTeF+ARBoytAcH1NNyyl390YMy6rKmw= -google.golang.org/api v0.102.0 h1:JxJl2qQ85fRMPNvlZY/enexbxpCjLwGhZUtgfGeQ51I= -google.golang.org/api v0.102.0/go.mod h1:3VFl6/fzoA+qNuS1N1/VfXY4LjoXN/wzeIp7TweWwGo= +google.golang.org/api v0.103.0 h1:9yuVqlu2JCvcLg9p8S3fcFLZij8EPSyvODIY1rkMizQ= +google.golang.org/api v0.103.0/go.mod h1:hGtW6nK1AC+d9si/UBhw8Xli+QMOf6xyNAyJw4qU9w0= google.golang.org/appengine v1.1.0/go.mod h1:EbEs0AVv82hx2wNQdGPgUI5lhzA/G0D9YwlJXL52JkM= google.golang.org/appengine v1.2.0/go.mod h1:xpcJRLb0r/rnEns0DIKYYv+WjYCduHsrkT7/EB5XEv4= google.golang.org/appengine v1.3.0/go.mod h1:xpcJRLb0r/rnEns0DIKYYv+WjYCduHsrkT7/EB5XEv4= @@ -2138,8 +2140,8 @@ google.golang.org/genproto v0.0.0-20220421151946-72621c1f0bd3/go.mod h1:8w6bsBMX google.golang.org/genproto v0.0.0-20220429170224-98d788798c3e/go.mod h1:8w6bsBMX6yCPbAVTeqQHvzxW0EIFigd5lZyahWgyfDo= google.golang.org/genproto v0.0.0-20220505152158-f39f71e6c8f3/go.mod h1:RAyBrSAP7Fh3Nc84ghnVLDPuV51xc9agzmm4Ph6i0Q4= google.golang.org/genproto v0.0.0-20220518221133-4f43b3371335/go.mod h1:RAyBrSAP7Fh3Nc84ghnVLDPuV51xc9agzmm4Ph6i0Q4= -google.golang.org/genproto v0.0.0-20221118155620-16455021b5e6 h1:a2S6M0+660BgMNl++4JPlcAO/CjkqYItDEZwkoDQK7c= -google.golang.org/genproto v0.0.0-20221118155620-16455021b5e6/go.mod h1:rZS5c/ZVYMaOGBfO68GWtjOw/eLaZM1X6iVtgjZ+EWg= +google.golang.org/genproto v0.0.0-20230110181048-76db0878b65f h1:BWUVssLB0HVOSY78gIdvk1dTVYtT1y8SBWtPYuTJ/6w= +google.golang.org/genproto v0.0.0-20230110181048-76db0878b65f/go.mod h1:RGgjbofJ8xD9Sq1VVhDM1Vok1vRONV+rg+CjzG4SZKM= google.golang.org/grpc v1.14.0/go.mod h1:yo6s7OP7yaDglbqo1J04qKzAhqBH6lvTonzMVmEdcZw= google.golang.org/grpc v1.16.0/go.mod h1:0JHn/cJsOMiMfNA9+DeHDlAU7KAAB5GDlYFpa9MZMio= google.golang.org/grpc v1.17.0/go.mod h1:6QZJwpn2B+Zp71q/5VxRsJ6NXXVCE5NRUHRo+f3cWCs= @@ -2179,8 +2181,8 @@ google.golang.org/grpc v1.42.0/go.mod h1:k+4IHHFw41K8+bbowsex27ge2rCb65oeWqe4jJ5 google.golang.org/grpc v1.44.0/go.mod h1:k+4IHHFw41K8+bbowsex27ge2rCb65oeWqe4jJ590SU= google.golang.org/grpc v1.45.0/go.mod h1:lN7owxKUQEqMfSyQikvvk5tf/6zMPsrK+ONuO11+0rQ= google.golang.org/grpc v1.46.0/go.mod h1:vN9eftEi1UMyUsIF80+uQXhHjbXYbm0uXoFCACuMGWk= -google.golang.org/grpc v1.52.3 h1:pf7sOysg4LdgBqduXveGKrcEwbStiK2rtfghdzlUYDQ= -google.golang.org/grpc v1.52.3/go.mod h1:pu6fVzoFb+NBYNAvQL08ic+lvB2IojljRYuun5vorUY= +google.golang.org/grpc v1.53.0 h1:LAv2ds7cmFV/XTS3XG1NneeENYrXGmorPxsBbptIjNc= +google.golang.org/grpc v1.53.0/go.mod h1:OnIrk0ipVdj4N5d9IUoFUx72/VlD7+jUsHwZgwSMQpw= google.golang.org/grpc/cmd/protoc-gen-go-grpc v1.1.0 h1:M1YKkFIboKNieVO5DLUEVzQfGwJD30Nv2jfUgzb5UcE= google.golang.org/grpc/cmd/protoc-gen-go-grpc v1.1.0/go.mod h1:6Kw0yEErY5E/yWrBtf03jp27GLLJujG4z/JK95pnjjw= google.golang.org/protobuf v0.0.0-20200109180630-ec00e32a8dfd/go.mod h1:DFci5gLYBciE7Vtevhsrf46CRTquxDuWsQurQQe4oz8= diff --git a/insecure/go.mod b/insecure/go.mod index 4f6a5115157..4e1a01530be 100644 --- a/insecure/go.mod +++ b/insecure/go.mod @@ -15,15 +15,15 @@ require ( github.com/spf13/pflag v1.0.5 github.com/stretchr/testify v1.8.1 github.com/yhassanzadeh13/go-libp2p-pubsub v0.6.2-0.20221208234712-b44d9133e4ee - google.golang.org/grpc v1.52.3 + google.golang.org/grpc v1.53.0 google.golang.org/protobuf v1.28.1 ) require ( - cloud.google.com/go v0.105.0 // indirect - cloud.google.com/go/compute v1.12.1 // indirect - cloud.google.com/go/compute/metadata v0.2.1 // indirect - cloud.google.com/go/iam v0.7.0 // indirect + cloud.google.com/go v0.107.0 // indirect + cloud.google.com/go/compute v1.15.1 // indirect + cloud.google.com/go/compute/metadata v0.2.3 // indirect + cloud.google.com/go/iam v0.8.0 // indirect cloud.google.com/go/storage v1.27.0 // indirect github.com/aws/aws-sdk-go-v2 v1.17.3 // indirect github.com/aws/aws-sdk-go-v2/config v1.18.10 // indirect @@ -60,7 +60,7 @@ require ( github.com/dgraph-io/ristretto v0.0.3-0.20200630154024-f66de99634de // indirect github.com/dgryski/go-farm v0.0.0-20190423205320-6a90982ecee2 // indirect github.com/docker/go-units v0.5.0 // indirect - github.com/dustin/go-humanize v1.0.0 // indirect + github.com/dustin/go-humanize v1.0.1 // indirect github.com/ef-ds/deque v1.0.4 // indirect github.com/elastic/gosigar v0.14.2 // indirect github.com/ethereum/go-ethereum v1.9.13 // indirect @@ -91,7 +91,7 @@ require ( github.com/google/pprof v0.0.0-20221219190121-3cb0bae90811 // indirect github.com/google/uuid v1.3.0 // indirect github.com/googleapis/enterprise-certificate-proxy v0.2.0 // indirect - github.com/googleapis/gax-go/v2 v2.6.0 // indirect + github.com/googleapis/gax-go/v2 v2.7.0 // indirect github.com/gorilla/mux v1.8.0 // indirect github.com/gorilla/websocket v1.5.0 // indirect github.com/grpc-ecosystem/go-grpc-middleware/providers/zerolog/v2 v2.0.0-rc.2 // indirect @@ -158,7 +158,7 @@ require ( github.com/marten-seemann/qtls-go1-19 v0.1.1 // indirect github.com/marten-seemann/tcp v0.0.0-20210406111302-dfbc87cc63fd // indirect github.com/mattn/go-colorable v0.1.13 // indirect - github.com/mattn/go-isatty v0.0.16 // indirect + github.com/mattn/go-isatty v0.0.17 // indirect github.com/mattn/go-pointer v0.0.1 // indirect github.com/mattn/go-runewidth v0.0.13 // indirect github.com/matttproud/golang_protobuf_extensions v1.0.4 // indirect @@ -248,7 +248,7 @@ require ( golang.org/x/exp v0.0.0-20221217163422-3c43f8badb15 // indirect golang.org/x/mod v0.7.0 // indirect golang.org/x/net v0.7.0 // indirect - golang.org/x/oauth2 v0.3.0 // indirect + golang.org/x/oauth2 v0.4.0 // indirect golang.org/x/sync v0.1.0 // indirect golang.org/x/sys v0.5.0 // indirect golang.org/x/term v0.5.0 // indirect @@ -256,9 +256,9 @@ require ( golang.org/x/time v0.0.0-20210723032227-1f47c861a9ac // indirect golang.org/x/tools v0.4.0 // indirect golang.org/x/xerrors v0.0.0-20220907171357-04be3eba64a2 // indirect - google.golang.org/api v0.102.0 // indirect + google.golang.org/api v0.103.0 // indirect google.golang.org/appengine v1.6.7 // indirect - google.golang.org/genproto v0.0.0-20221118155620-16455021b5e6 // indirect + google.golang.org/genproto v0.0.0-20230110181048-76db0878b65f // indirect google.golang.org/grpc/cmd/protoc-gen-go-grpc v1.1.0 // indirect gopkg.in/ini.v1 v1.66.6 // indirect gopkg.in/yaml.v2 v2.4.0 // indirect diff --git a/insecure/go.sum b/insecure/go.sum index 9163822599c..05c7c4a0c1a 100644 --- a/insecure/go.sum +++ b/insecure/go.sum @@ -19,22 +19,22 @@ cloud.google.com/go v0.65.0/go.mod h1:O5N8zS7uWy9vkA9vayVHs65eM1ubvY4h553ofrNHOb cloud.google.com/go v0.72.0/go.mod h1:M+5Vjvlc2wnp6tjzE102Dw08nGShTscUx2nZMufOKPI= cloud.google.com/go v0.74.0/go.mod h1:VV1xSbzvo+9QJOxLDaJfTjx5e+MePCpCWwvftOeQmWk= cloud.google.com/go v0.75.0/go.mod h1:VGuuCn7PG0dwsd5XPVm2Mm3wlh3EL55/79EKB6hlPTY= -cloud.google.com/go v0.105.0 h1:DNtEKRBAAzeS4KyIory52wWHuClNaXJ5x1F7xa4q+5Y= -cloud.google.com/go v0.105.0/go.mod h1:PrLgOJNe5nfE9UMxKxgXj4mD3voiP+YQ6gdt6KMFOKM= +cloud.google.com/go v0.107.0 h1:qkj22L7bgkl6vIeZDlOY2po43Mx/TIa2Wsa7VR+PEww= +cloud.google.com/go v0.107.0/go.mod h1:wpc2eNrD7hXUTy8EKS10jkxpZBjASrORK7goS+3YX2I= cloud.google.com/go/bigquery v1.0.1/go.mod h1:i/xbL2UlR5RvWAURpBYZTtm/cXjCha9lbfbpx4poX+o= cloud.google.com/go/bigquery v1.3.0/go.mod h1:PjpwJnslEMmckchkHFfq+HTD2DmtT67aNFKH1/VBDHE= cloud.google.com/go/bigquery v1.4.0/go.mod h1:S8dzgnTigyfTmLBfrtrhyYhwRxG72rYxvftPBK2Dvzc= cloud.google.com/go/bigquery v1.5.0/go.mod h1:snEHRnqQbz117VIFhE8bmtwIDY80NLUZUMb4Nv6dBIg= cloud.google.com/go/bigquery v1.7.0/go.mod h1://okPTzCYNXSlb24MZs83e2Do+h+VXtc4gLoIoXIAPc= cloud.google.com/go/bigquery v1.8.0/go.mod h1:J5hqkt3O0uAFnINi6JXValWIb1v0goeZM77hZzJN/fQ= -cloud.google.com/go/compute v1.12.1 h1:gKVJMEyqV5c/UnpzjjQbo3Rjvvqpr9B1DFSbJC4OXr0= -cloud.google.com/go/compute v1.12.1/go.mod h1:e8yNOBcBONZU1vJKCvCoDw/4JQsA0dpM4x/6PIIOocU= -cloud.google.com/go/compute/metadata v0.2.1 h1:efOwf5ymceDhK6PKMnnrTHP4pppY5L22mle96M1yP48= -cloud.google.com/go/compute/metadata v0.2.1/go.mod h1:jgHgmJd2RKBGzXqF5LR2EZMGxBkeanZ9wwa75XHJgOM= +cloud.google.com/go/compute v1.15.1 h1:7UGq3QknM33pw5xATlpzeoomNxsacIVvTqTTvbfajmE= +cloud.google.com/go/compute v1.15.1/go.mod h1:bjjoF/NtFUrkD/urWfdHaKuOPDR5nWIs63rR+SXhcpA= +cloud.google.com/go/compute/metadata v0.2.3 h1:mg4jlk7mCAj6xXp9UJ4fjI9VUI5rubuGBW5aJ7UnBMY= +cloud.google.com/go/compute/metadata v0.2.3/go.mod h1:VAV5nSsACxMJvgaAuX6Pk2AawlZn8kiOGuCv6gTkwuA= cloud.google.com/go/datastore v1.0.0/go.mod h1:LXYbyblFSglQ5pkeyhO+Qmw7ukd3C+pD7TKLgZqpHYE= cloud.google.com/go/datastore v1.1.0/go.mod h1:umbIZjpQpHh4hmRpGhH4tLFup+FVzqBi1b3c64qFpCk= -cloud.google.com/go/iam v0.7.0 h1:k4MuwOsS7zGJJ+QfZ5vBK8SgHBAvYN/23BWsiihJ1vs= -cloud.google.com/go/iam v0.7.0/go.mod h1:H5Br8wRaDGNc8XP3keLc4unfUUZeyH3Sfl9XpQEYOeg= +cloud.google.com/go/iam v0.8.0 h1:E2osAkZzxI/+8pZcxVLcDtAQx/u+hZXVryUaYQ5O0Kk= +cloud.google.com/go/iam v0.8.0/go.mod h1:lga0/y3iH6CX7sYqypWJ33hf7kkfXJag67naqGESjkE= cloud.google.com/go/longrunning v0.3.0 h1:NjljC+FYPV3uh5/OwWT6pVU+doBqMg2x/rZlE+CamDs= cloud.google.com/go/profiler v0.3.0 h1:R6y/xAeifaUXxd2x6w+jIwKxoKl8Cv5HJvcvASTPWJo= cloud.google.com/go/pubsub v1.0.1/go.mod h1:R0Gpsv3s54REJCy4fxDixWD93lHJMoZTyQ2kNxGRt3I= @@ -271,8 +271,9 @@ github.com/docker/go-units v0.5.0 h1:69rxXcBk27SvSaaxTtLh/8llcHD8vYHT7WSdRZ/jvr4 github.com/docker/go-units v0.5.0/go.mod h1:fgPhTUdO+D/Jk86RDLlptpiXQzgHJF7gydDDbaIK4Dk= github.com/dop251/goja v0.0.0-20200219165308-d1232e640a87/go.mod h1:Mw6PkjjMXWbTj+nnj4s3QPXq1jaT0s5pC0iFD4+BOAA= github.com/dustin/go-humanize v0.0.0-20171111073723-bb3d318650d4/go.mod h1:HtrtbFcZ19U5GC7JDqmcUSB87Iq5E25KnS6fMYU6eOk= -github.com/dustin/go-humanize v1.0.0 h1:VSnTsYCnlFHaM2/igO1h6X3HA71jcobQuxemgkq4zYo= github.com/dustin/go-humanize v1.0.0/go.mod h1:HtrtbFcZ19U5GC7JDqmcUSB87Iq5E25KnS6fMYU6eOk= +github.com/dustin/go-humanize v1.0.1 h1:GzkhY7T5VNhEkwH0PVJgjz+fX1rhBrR7pRT3mDkpeCY= +github.com/dustin/go-humanize v1.0.1/go.mod h1:Mu1zIs6XwVuF/gI1OepvI0qD18qycQx+mFykh5fBlto= github.com/eapache/go-resiliency v1.1.0/go.mod h1:kFI+JgMyC7bLPUVY133qvEBtVayf5mFgVsvEsIPBvNs= github.com/eapache/go-xerial-snappy v0.0.0-20180814174437-776d5712da21/go.mod h1:+020luEh2TKB4/GOp8oxxtq0Daoen/Cii55CzbTV6DU= github.com/eapache/queue v1.1.0/go.mod h1:6eCeP0CKFpHLu8blIFXhExK/dRa7WDZfr6jVFPTqq+I= @@ -488,8 +489,8 @@ github.com/googleapis/gax-go v2.0.0+incompatible/go.mod h1:SFVmujtThgffbyetf+mdk github.com/googleapis/gax-go/v2 v2.0.3/go.mod h1:LLvjysVCY1JZeum8Z6l8qUty8fiNwE08qbEPm1M08qg= github.com/googleapis/gax-go/v2 v2.0.4/go.mod h1:0Wqv26UfaUD9n4G6kQubkQ+KchISgw+vpHVxEJEs9eg= github.com/googleapis/gax-go/v2 v2.0.5/go.mod h1:DWXyrwAJ9X0FpwwEdw+IPEYBICEFu5mhpdKc/us6bOk= -github.com/googleapis/gax-go/v2 v2.6.0 h1:SXk3ABtQYDT/OH8jAyvEOQ58mgawq5C4o/4/89qN2ZU= -github.com/googleapis/gax-go/v2 v2.6.0/go.mod h1:1mjbznJAPHFpesgE5ucqfYEscaz5kMdcIDwU/6+DDoY= +github.com/googleapis/gax-go/v2 v2.7.0 h1:IcsPKeInNvYi7eqSaDjiZqDDKu5rsmunY0Y1YupQSSQ= +github.com/googleapis/gax-go/v2 v2.7.0/go.mod h1:TEop28CZZQ2y+c0VxMUmu1lV+fQx57QpBWsYpwqHJx8= github.com/googleapis/google-cloud-go-testing v0.0.0-20200911160855-bcd43fbb19e8/go.mod h1:dvDLG8qkwmyD9a/MJJN3XJcT3xFxOKAvTZGvuZmac9g= github.com/gopherjs/gopherjs v0.0.0-20181017120253-0766667cb4d1 h1:EGx4pi6eqNxGaHF6qqu48+N2wcFQ5qg5FXgOdqsJ5d8= github.com/gopherjs/gopherjs v0.0.0-20181017120253-0766667cb4d1/go.mod h1:wJfORRmW1u3UXTncJ5qlYoELFm8eSnnEO6hX4iZ3EWY= @@ -1021,8 +1022,9 @@ github.com/mattn/go-isatty v0.0.9/go.mod h1:YNRxwqDuOph6SZLI9vUUz6OYw3QyUt7WiY2y github.com/mattn/go-isatty v0.0.12/go.mod h1:cbi8OIDigv2wuxKPP5vlRcQ1OAZbq2CE4Kysco4FUpU= github.com/mattn/go-isatty v0.0.13/go.mod h1:cbi8OIDigv2wuxKPP5vlRcQ1OAZbq2CE4Kysco4FUpU= github.com/mattn/go-isatty v0.0.14/go.mod h1:7GGIvUiUoEMVVmxf/4nioHXj79iQHKdU27kJ6hsGG94= -github.com/mattn/go-isatty v0.0.16 h1:bq3VjFmv/sOjHtdEhmkEV4x1AJtvUvOJ2PFAZ5+peKQ= github.com/mattn/go-isatty v0.0.16/go.mod h1:kYGgaQfpe5nmfYZH+SKPsOc2e4SrIfOl2e/yFXSvRLM= +github.com/mattn/go-isatty v0.0.17 h1:BTarxUcIeDqL27Mc+vyvdWYSL28zpIhv3RoTdsLMPng= +github.com/mattn/go-isatty v0.0.17/go.mod h1:kYGgaQfpe5nmfYZH+SKPsOc2e4SrIfOl2e/yFXSvRLM= github.com/mattn/go-pointer v0.0.1 h1:n+XhsuGeVO6MEAp7xyEukFINEa+Quek5psIR/ylA6o0= github.com/mattn/go-pointer v0.0.1/go.mod h1:2zXcozF6qYGgmsG+SeTZz3oAbFLdD3OWqnUbNvJZAlc= github.com/mattn/go-runewidth v0.0.2/go.mod h1:LwmH8dsx7+W8Uxz3IHJYH5QSwggIsqBzpuz5H//U1FU= @@ -1697,8 +1699,8 @@ golang.org/x/oauth2 v0.0.0-20201109201403-9fd604954f58/go.mod h1:KelEdhl1UZF7XfJ golang.org/x/oauth2 v0.0.0-20201208152858-08078c50e5b5/go.mod h1:KelEdhl1UZF7XfJ4dDtk6s++YSgaE7mD/BuKKDLBl4A= golang.org/x/oauth2 v0.0.0-20210218202405-ba52d332ba99/go.mod h1:KelEdhl1UZF7XfJ4dDtk6s++YSgaE7mD/BuKKDLBl4A= golang.org/x/oauth2 v0.0.0-20211104180415-d3ed0bb246c8/go.mod h1:KelEdhl1UZF7XfJ4dDtk6s++YSgaE7mD/BuKKDLBl4A= -golang.org/x/oauth2 v0.3.0 h1:6l90koy8/LaBLmLu8jpHeHexzMwEita0zFfYlggy2F8= -golang.org/x/oauth2 v0.3.0/go.mod h1:rQrIauxkUhJ6CuwEXwymO2/eh4xz2ZWF1nBkcxS+tGk= +golang.org/x/oauth2 v0.4.0 h1:NF0gk8LVPg1Ml7SSbGyySuoxdsXitj7TvgvuRxIMc/M= +golang.org/x/oauth2 v0.4.0/go.mod h1:RznEsdpjGAINPTOF0UH/t+xJ75L18YO3Ho6Pyn+uRec= golang.org/x/perf v0.0.0-20180704124530-6e6d33e29852/go.mod h1:JLpeXjPJfIyPr5TlbXLkXWLhP8nz10XfvxElABhCtcw= golang.org/x/sync v0.0.0-20180314180146-1d60e4601c6f/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sync v0.0.0-20181108010431-42b317875d0f/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= @@ -1924,8 +1926,8 @@ google.golang.org/api v0.30.0/go.mod h1:QGmEvQ87FHZNiUVJkT14jQNYJ4ZJjdRF23ZXz513 google.golang.org/api v0.35.0/go.mod h1:/XrVsuzM0rZmrsbjJutiuftIzeuTQcEeaYcSk/mQ1dg= google.golang.org/api v0.36.0/go.mod h1:+z5ficQTmoYpPn8LCUNVpK5I7hwkpjbcgqA7I34qYtE= google.golang.org/api v0.40.0/go.mod h1:fYKFpnQN0DsDSKRVRcQSDQNtqWPfM9i+zNPxepjRCQ8= -google.golang.org/api v0.102.0 h1:JxJl2qQ85fRMPNvlZY/enexbxpCjLwGhZUtgfGeQ51I= -google.golang.org/api v0.102.0/go.mod h1:3VFl6/fzoA+qNuS1N1/VfXY4LjoXN/wzeIp7TweWwGo= +google.golang.org/api v0.103.0 h1:9yuVqlu2JCvcLg9p8S3fcFLZij8EPSyvODIY1rkMizQ= +google.golang.org/api v0.103.0/go.mod h1:hGtW6nK1AC+d9si/UBhw8Xli+QMOf6xyNAyJw4qU9w0= google.golang.org/appengine v1.1.0/go.mod h1:EbEs0AVv82hx2wNQdGPgUI5lhzA/G0D9YwlJXL52JkM= google.golang.org/appengine v1.2.0/go.mod h1:xpcJRLb0r/rnEns0DIKYYv+WjYCduHsrkT7/EB5XEv4= google.golang.org/appengine v1.3.0/go.mod h1:xpcJRLb0r/rnEns0DIKYYv+WjYCduHsrkT7/EB5XEv4= @@ -1981,8 +1983,8 @@ google.golang.org/genproto v0.0.0-20210108203827-ffc7fda8c3d7/go.mod h1:FWY/as6D google.golang.org/genproto v0.0.0-20210126160654-44e461bb6506/go.mod h1:FWY/as6DDZQgahTzZj3fqbO1CbirC29ZNUFHwi0/+no= google.golang.org/genproto v0.0.0-20210226172003-ab064af71705/go.mod h1:FWY/as6DDZQgahTzZj3fqbO1CbirC29ZNUFHwi0/+no= google.golang.org/genproto v0.0.0-20211118181313-81c1377c94b1/go.mod h1:5CzLGKJ67TSI2B9POpiiyGha0AjJvZIUgRMt1dSmuhc= -google.golang.org/genproto v0.0.0-20221118155620-16455021b5e6 h1:a2S6M0+660BgMNl++4JPlcAO/CjkqYItDEZwkoDQK7c= -google.golang.org/genproto v0.0.0-20221118155620-16455021b5e6/go.mod h1:rZS5c/ZVYMaOGBfO68GWtjOw/eLaZM1X6iVtgjZ+EWg= +google.golang.org/genproto v0.0.0-20230110181048-76db0878b65f h1:BWUVssLB0HVOSY78gIdvk1dTVYtT1y8SBWtPYuTJ/6w= +google.golang.org/genproto v0.0.0-20230110181048-76db0878b65f/go.mod h1:RGgjbofJ8xD9Sq1VVhDM1Vok1vRONV+rg+CjzG4SZKM= google.golang.org/grpc v1.14.0/go.mod h1:yo6s7OP7yaDglbqo1J04qKzAhqBH6lvTonzMVmEdcZw= google.golang.org/grpc v1.16.0/go.mod h1:0JHn/cJsOMiMfNA9+DeHDlAU7KAAB5GDlYFpa9MZMio= google.golang.org/grpc v1.17.0/go.mod h1:6QZJwpn2B+Zp71q/5VxRsJ6NXXVCE5NRUHRo+f3cWCs= @@ -2012,8 +2014,8 @@ google.golang.org/grpc v1.35.0/go.mod h1:qjiiYl8FncCW8feJPdyg3v6XW24KsRHe+dy9BAG google.golang.org/grpc v1.36.0/go.mod h1:qjiiYl8FncCW8feJPdyg3v6XW24KsRHe+dy9BAGRRjU= google.golang.org/grpc v1.40.0/go.mod h1:ogyxbiOoUXAkP+4+xa6PZSE9DZgIHtSpzjDTB9KAK34= google.golang.org/grpc v1.42.0/go.mod h1:k+4IHHFw41K8+bbowsex27ge2rCb65oeWqe4jJ590SU= -google.golang.org/grpc v1.52.3 h1:pf7sOysg4LdgBqduXveGKrcEwbStiK2rtfghdzlUYDQ= -google.golang.org/grpc v1.52.3/go.mod h1:pu6fVzoFb+NBYNAvQL08ic+lvB2IojljRYuun5vorUY= +google.golang.org/grpc v1.53.0 h1:LAv2ds7cmFV/XTS3XG1NneeENYrXGmorPxsBbptIjNc= +google.golang.org/grpc v1.53.0/go.mod h1:OnIrk0ipVdj4N5d9IUoFUx72/VlD7+jUsHwZgwSMQpw= google.golang.org/grpc/cmd/protoc-gen-go-grpc v1.1.0 h1:M1YKkFIboKNieVO5DLUEVzQfGwJD30Nv2jfUgzb5UcE= google.golang.org/grpc/cmd/protoc-gen-go-grpc v1.1.0/go.mod h1:6Kw0yEErY5E/yWrBtf03jp27GLLJujG4z/JK95pnjjw= google.golang.org/protobuf v0.0.0-20200109180630-ec00e32a8dfd/go.mod h1:DFci5gLYBciE7Vtevhsrf46CRTquxDuWsQurQQe4oz8= diff --git a/integration/go.mod b/integration/go.mod index 9b7d8f09dc4..b147314603c 100644 --- a/integration/go.mod +++ b/integration/go.mod @@ -3,7 +3,7 @@ module github.com/onflow/flow-go/integration go 1.19 require ( - cloud.google.com/go/bigquery v1.43.0 + cloud.google.com/go/bigquery v1.44.0 github.com/VividCortex/ewma v1.2.0 github.com/dapperlabs/testingdock v0.4.4 github.com/dgraph-io/badger/v2 v2.2007.4 @@ -19,7 +19,7 @@ require ( github.com/onflow/cadence v0.36.1-0.20230321154305-ba9bfc7b2551 github.com/onflow/flow-core-contracts/lib/go/contracts v0.12.1 github.com/onflow/flow-core-contracts/lib/go/templates v0.12.1 - github.com/onflow/flow-emulator v0.43.1-0.20230202181019-910459a16e2e + github.com/onflow/flow-emulator v0.45.0 github.com/onflow/flow-go v0.29.9 github.com/onflow/flow-go-sdk v0.35.0 github.com/onflow/flow-go/crypto v0.24.6 @@ -33,15 +33,15 @@ require ( go.uber.org/atomic v1.10.0 golang.org/x/exp v0.0.0-20221217163422-3c43f8badb15 golang.org/x/sync v0.1.0 - google.golang.org/grpc v1.52.3 + google.golang.org/grpc v1.53.0 google.golang.org/protobuf v1.28.1 ) require ( - cloud.google.com/go v0.105.0 // indirect - cloud.google.com/go/compute v1.12.1 // indirect - cloud.google.com/go/compute/metadata v0.2.1 // indirect - cloud.google.com/go/iam v0.7.0 // indirect + cloud.google.com/go v0.107.0 // indirect + cloud.google.com/go/compute v1.15.1 // indirect + cloud.google.com/go/compute/metadata v0.2.3 // indirect + cloud.google.com/go/iam v0.8.0 // indirect cloud.google.com/go/storage v1.27.0 // indirect github.com/Azure/go-ansiterm v0.0.0-20170929234023-d6e3b3328b78 // indirect github.com/Microsoft/go-winio v0.5.2 // indirect @@ -89,7 +89,7 @@ require ( github.com/docker/docker-credential-helpers v0.6.3 // indirect github.com/docker/go-metrics v0.0.1 // indirect github.com/docker/go-units v0.5.0 // indirect - github.com/dustin/go-humanize v1.0.0 // indirect + github.com/dustin/go-humanize v1.0.1 // indirect github.com/ef-ds/deque v1.0.4 // indirect github.com/elastic/gosigar v0.14.2 // indirect github.com/emirpasic/gods v1.18.1 // indirect @@ -102,6 +102,7 @@ require ( github.com/gammazero/deque v0.1.0 // indirect github.com/gammazero/workerpool v1.1.2 // indirect github.com/ghodss/yaml v1.0.0 // indirect + github.com/glebarez/go-sqlite v1.20.3 // indirect github.com/go-git/gcfg v1.5.0 // indirect github.com/go-git/go-billy/v5 v5.4.0 // indirect github.com/go-kit/kit v0.12.0 // indirect @@ -124,7 +125,7 @@ require ( github.com/google/pprof v0.0.0-20221219190121-3cb0bae90811 // indirect github.com/google/uuid v1.3.0 // indirect github.com/googleapis/enterprise-certificate-proxy v0.2.0 // indirect - github.com/googleapis/gax-go/v2 v2.6.0 // indirect + github.com/googleapis/gax-go/v2 v2.7.0 // indirect github.com/gorilla/websocket v1.5.0 // indirect github.com/grpc-ecosystem/go-grpc-middleware/providers/zerolog/v2 v2.0.0-rc.2 // indirect github.com/grpc-ecosystem/go-grpc-middleware/v2 v2.0.0-20200501113911-9a95f0fdbfea // indirect @@ -191,7 +192,7 @@ require ( github.com/marten-seemann/qtls-go1-19 v0.1.1 // indirect github.com/marten-seemann/tcp v0.0.0-20210406111302-dfbc87cc63fd // indirect github.com/mattn/go-colorable v0.1.13 // indirect - github.com/mattn/go-isatty v0.0.16 // indirect + github.com/mattn/go-isatty v0.0.17 // indirect github.com/mattn/go-pointer v0.0.1 // indirect github.com/mattn/go-runewidth v0.0.13 // indirect github.com/matttproud/golang_protobuf_extensions v1.0.4 // indirect @@ -237,6 +238,7 @@ require ( github.com/prometheus/procfs v0.9.0 // indirect github.com/psiemens/sconfig v0.1.0 // indirect github.com/raulk/go-watchdog v1.3.0 // indirect + github.com/remyoudompheng/bigfft v0.0.0-20230126093431-47fa9a501578 // indirect github.com/rivo/uniseg v0.2.1-0.20211004051800-57c86be7915a // indirect github.com/schollz/progressbar/v3 v3.8.3 // indirect github.com/sergi/go-diff v1.1.0 // indirect @@ -284,22 +286,26 @@ require ( golang.org/x/crypto v0.4.0 // indirect golang.org/x/mod v0.7.0 // indirect golang.org/x/net v0.7.0 // indirect - golang.org/x/oauth2 v0.3.0 // indirect + golang.org/x/oauth2 v0.4.0 // indirect golang.org/x/sys v0.5.0 // indirect golang.org/x/term v0.5.0 // indirect golang.org/x/text v0.7.0 // indirect golang.org/x/time v0.0.0-20210723032227-1f47c861a9ac // indirect golang.org/x/tools v0.4.0 // indirect golang.org/x/xerrors v0.0.0-20220907171357-04be3eba64a2 // indirect - google.golang.org/api v0.102.0 // indirect + google.golang.org/api v0.103.0 // indirect google.golang.org/appengine v1.6.7 // indirect - google.golang.org/genproto v0.0.0-20221118155620-16455021b5e6 // indirect + google.golang.org/genproto v0.0.0-20230110181048-76db0878b65f // indirect google.golang.org/grpc/cmd/protoc-gen-go-grpc v1.1.0 // indirect gopkg.in/ini.v1 v1.66.6 // indirect gopkg.in/warnings.v0 v0.1.2 // indirect gopkg.in/yaml.v2 v2.4.0 // indirect gopkg.in/yaml.v3 v3.0.1 // indirect lukechampine.com/blake3 v1.1.7 // indirect + modernc.org/libc v1.22.2 // indirect + modernc.org/mathutil v1.5.0 // indirect + modernc.org/memory v1.5.0 // indirect + modernc.org/sqlite v1.20.3 // indirect ) replace github.com/onflow/flow-go => ../ diff --git a/integration/go.sum b/integration/go.sum index 59dc8970b20..aceb60100c1 100644 --- a/integration/go.sum +++ b/integration/go.sum @@ -22,27 +22,27 @@ cloud.google.com/go v0.65.0/go.mod h1:O5N8zS7uWy9vkA9vayVHs65eM1ubvY4h553ofrNHOb cloud.google.com/go v0.72.0/go.mod h1:M+5Vjvlc2wnp6tjzE102Dw08nGShTscUx2nZMufOKPI= cloud.google.com/go v0.74.0/go.mod h1:VV1xSbzvo+9QJOxLDaJfTjx5e+MePCpCWwvftOeQmWk= cloud.google.com/go v0.75.0/go.mod h1:VGuuCn7PG0dwsd5XPVm2Mm3wlh3EL55/79EKB6hlPTY= -cloud.google.com/go v0.105.0 h1:DNtEKRBAAzeS4KyIory52wWHuClNaXJ5x1F7xa4q+5Y= -cloud.google.com/go v0.105.0/go.mod h1:PrLgOJNe5nfE9UMxKxgXj4mD3voiP+YQ6gdt6KMFOKM= +cloud.google.com/go v0.107.0 h1:qkj22L7bgkl6vIeZDlOY2po43Mx/TIa2Wsa7VR+PEww= +cloud.google.com/go v0.107.0/go.mod h1:wpc2eNrD7hXUTy8EKS10jkxpZBjASrORK7goS+3YX2I= cloud.google.com/go/bigquery v1.0.1/go.mod h1:i/xbL2UlR5RvWAURpBYZTtm/cXjCha9lbfbpx4poX+o= cloud.google.com/go/bigquery v1.3.0/go.mod h1:PjpwJnslEMmckchkHFfq+HTD2DmtT67aNFKH1/VBDHE= cloud.google.com/go/bigquery v1.4.0/go.mod h1:S8dzgnTigyfTmLBfrtrhyYhwRxG72rYxvftPBK2Dvzc= cloud.google.com/go/bigquery v1.5.0/go.mod h1:snEHRnqQbz117VIFhE8bmtwIDY80NLUZUMb4Nv6dBIg= cloud.google.com/go/bigquery v1.7.0/go.mod h1://okPTzCYNXSlb24MZs83e2Do+h+VXtc4gLoIoXIAPc= cloud.google.com/go/bigquery v1.8.0/go.mod h1:J5hqkt3O0uAFnINi6JXValWIb1v0goeZM77hZzJN/fQ= -cloud.google.com/go/bigquery v1.43.0 h1:u0fvz5ysJBe1jwUPI4LuPwAX+o+6fCUwf3ECeg6eDUQ= -cloud.google.com/go/bigquery v1.43.0/go.mod h1:ZMQcXHsl+xmU1z36G2jNGZmKp9zNY5BUua5wDgmNCfw= +cloud.google.com/go/bigquery v1.44.0 h1:Wi4dITi+cf9VYp4VH2T9O41w0kCW0uQTELq2Z6tukN0= +cloud.google.com/go/bigquery v1.44.0/go.mod h1:0Y33VqXTEsbamHJvJHdFmtqHvMIY28aK1+dFsvaChGc= cloud.google.com/go/bigtable v1.2.0/go.mod h1:JcVAOl45lrTmQfLj7T6TxyMzIN/3FGGcFm+2xVAli2o= -cloud.google.com/go/compute v1.12.1 h1:gKVJMEyqV5c/UnpzjjQbo3Rjvvqpr9B1DFSbJC4OXr0= -cloud.google.com/go/compute v1.12.1/go.mod h1:e8yNOBcBONZU1vJKCvCoDw/4JQsA0dpM4x/6PIIOocU= -cloud.google.com/go/compute/metadata v0.2.1 h1:efOwf5ymceDhK6PKMnnrTHP4pppY5L22mle96M1yP48= -cloud.google.com/go/compute/metadata v0.2.1/go.mod h1:jgHgmJd2RKBGzXqF5LR2EZMGxBkeanZ9wwa75XHJgOM= +cloud.google.com/go/compute v1.15.1 h1:7UGq3QknM33pw5xATlpzeoomNxsacIVvTqTTvbfajmE= +cloud.google.com/go/compute v1.15.1/go.mod h1:bjjoF/NtFUrkD/urWfdHaKuOPDR5nWIs63rR+SXhcpA= +cloud.google.com/go/compute/metadata v0.2.3 h1:mg4jlk7mCAj6xXp9UJ4fjI9VUI5rubuGBW5aJ7UnBMY= +cloud.google.com/go/compute/metadata v0.2.3/go.mod h1:VAV5nSsACxMJvgaAuX6Pk2AawlZn8kiOGuCv6gTkwuA= cloud.google.com/go/datacatalog v1.8.0 h1:6kZ4RIOW/uT7QWC5SfPfq/G8sYzr/v+UOmOAxy4Z1TE= cloud.google.com/go/datastore v1.0.0/go.mod h1:LXYbyblFSglQ5pkeyhO+Qmw7ukd3C+pD7TKLgZqpHYE= cloud.google.com/go/datastore v1.1.0/go.mod h1:umbIZjpQpHh4hmRpGhH4tLFup+FVzqBi1b3c64qFpCk= cloud.google.com/go/firestore v1.1.0/go.mod h1:ulACoGHTpvq5r8rxGJ4ddJZBZqakUQqClKRT5SZwBmk= -cloud.google.com/go/iam v0.7.0 h1:k4MuwOsS7zGJJ+QfZ5vBK8SgHBAvYN/23BWsiihJ1vs= -cloud.google.com/go/iam v0.7.0/go.mod h1:H5Br8wRaDGNc8XP3keLc4unfUUZeyH3Sfl9XpQEYOeg= +cloud.google.com/go/iam v0.8.0 h1:E2osAkZzxI/+8pZcxVLcDtAQx/u+hZXVryUaYQ5O0Kk= +cloud.google.com/go/iam v0.8.0/go.mod h1:lga0/y3iH6CX7sYqypWJ33hf7kkfXJag67naqGESjkE= cloud.google.com/go/longrunning v0.3.0 h1:NjljC+FYPV3uh5/OwWT6pVU+doBqMg2x/rZlE+CamDs= cloud.google.com/go/profiler v0.3.0 h1:R6y/xAeifaUXxd2x6w+jIwKxoKl8Cv5HJvcvASTPWJo= cloud.google.com/go/pubsub v1.0.1/go.mod h1:R0Gpsv3s54REJCy4fxDixWD93lHJMoZTyQ2kNxGRt3I= @@ -339,8 +339,9 @@ github.com/docker/go-units v0.5.0 h1:69rxXcBk27SvSaaxTtLh/8llcHD8vYHT7WSdRZ/jvr4 github.com/docker/go-units v0.5.0/go.mod h1:fgPhTUdO+D/Jk86RDLlptpiXQzgHJF7gydDDbaIK4Dk= github.com/dop251/goja v0.0.0-20200721192441-a695b0cdd498/go.mod h1:Mw6PkjjMXWbTj+nnj4s3QPXq1jaT0s5pC0iFD4+BOAA= github.com/dustin/go-humanize v0.0.0-20171111073723-bb3d318650d4/go.mod h1:HtrtbFcZ19U5GC7JDqmcUSB87Iq5E25KnS6fMYU6eOk= -github.com/dustin/go-humanize v1.0.0 h1:VSnTsYCnlFHaM2/igO1h6X3HA71jcobQuxemgkq4zYo= github.com/dustin/go-humanize v1.0.0/go.mod h1:HtrtbFcZ19U5GC7JDqmcUSB87Iq5E25KnS6fMYU6eOk= +github.com/dustin/go-humanize v1.0.1 h1:GzkhY7T5VNhEkwH0PVJgjz+fX1rhBrR7pRT3mDkpeCY= +github.com/dustin/go-humanize v1.0.1/go.mod h1:Mu1zIs6XwVuF/gI1OepvI0qD18qycQx+mFykh5fBlto= github.com/dvyukov/go-fuzz v0.0.0-20200318091601-be3528f3a813/go.mod h1:11Gm+ccJnvAhCNLlf5+cS9KjtbaD5I5zaZpFMsTHWTw= github.com/eapache/go-resiliency v1.1.0/go.mod h1:kFI+JgMyC7bLPUVY133qvEBtVayf5mFgVsvEsIPBvNs= github.com/eapache/go-xerial-snappy v0.0.0-20180814174437-776d5712da21/go.mod h1:+020luEh2TKB4/GOp8oxxtq0Daoen/Cii55CzbTV6DU= @@ -398,6 +399,8 @@ github.com/gammazero/workerpool v1.1.2/go.mod h1:UelbXcO0zCIGFcufcirHhq2/xtLXJdQ github.com/gballet/go-libpcsclite v0.0.0-20190607065134-2772fd86a8ff/go.mod h1:x7DCsMOv1taUwEWCzT4cmDeAkigA5/QCwUodaVOe8Ww= github.com/ghodss/yaml v1.0.0 h1:wQHKEahhL6wmXdzwWG11gIVCkOv05bNOh+Rxn0yngAk= github.com/ghodss/yaml v1.0.0/go.mod h1:4dBDuWmgqj2HViK6kFavaiC9ZROes6MMH2rRYeMEF04= +github.com/glebarez/go-sqlite v1.20.3 h1:89BkqGOXR9oRmG58ZrzgoY/Fhy5x0M+/WV48U5zVrZ4= +github.com/glebarez/go-sqlite v1.20.3/go.mod h1:u3N6D/wftiAzIOJtZl6BmedqxmmkDfH3q+ihjqxC9u0= github.com/gliderlabs/ssh v0.1.1/go.mod h1:U7qILu1NlMHj9FlMhZLlkCdDnU1DBEAqr0aevW3Awn0= github.com/gliderlabs/ssh v0.3.5 h1:OcaySEmAQJgyYcArR+gGGTHCyE7nvhEMTlYY+Dp8CpY= github.com/gliderlabs/ssh v0.3.5/go.mod h1:8XB4KraRrX39qHhT6yxPsHedjA08I/uBVwj4xC+/+z4= @@ -565,8 +568,8 @@ github.com/googleapis/gax-go v2.0.0+incompatible/go.mod h1:SFVmujtThgffbyetf+mdk github.com/googleapis/gax-go/v2 v2.0.3/go.mod h1:LLvjysVCY1JZeum8Z6l8qUty8fiNwE08qbEPm1M08qg= github.com/googleapis/gax-go/v2 v2.0.4/go.mod h1:0Wqv26UfaUD9n4G6kQubkQ+KchISgw+vpHVxEJEs9eg= github.com/googleapis/gax-go/v2 v2.0.5/go.mod h1:DWXyrwAJ9X0FpwwEdw+IPEYBICEFu5mhpdKc/us6bOk= -github.com/googleapis/gax-go/v2 v2.6.0 h1:SXk3ABtQYDT/OH8jAyvEOQ58mgawq5C4o/4/89qN2ZU= -github.com/googleapis/gax-go/v2 v2.6.0/go.mod h1:1mjbznJAPHFpesgE5ucqfYEscaz5kMdcIDwU/6+DDoY= +github.com/googleapis/gax-go/v2 v2.7.0 h1:IcsPKeInNvYi7eqSaDjiZqDDKu5rsmunY0Y1YupQSSQ= +github.com/googleapis/gax-go/v2 v2.7.0/go.mod h1:TEop28CZZQ2y+c0VxMUmu1lV+fQx57QpBWsYpwqHJx8= github.com/googleapis/google-cloud-go-testing v0.0.0-20200911160855-bcd43fbb19e8/go.mod h1:dvDLG8qkwmyD9a/MJJN3XJcT3xFxOKAvTZGvuZmac9g= github.com/gopherjs/gopherjs v0.0.0-20181017120253-0766667cb4d1 h1:EGx4pi6eqNxGaHF6qqu48+N2wcFQ5qg5FXgOdqsJ5d8= github.com/gopherjs/gopherjs v0.0.0-20181017120253-0766667cb4d1/go.mod h1:wJfORRmW1u3UXTncJ5qlYoELFm8eSnnEO6hX4iZ3EWY= @@ -1124,8 +1127,9 @@ github.com/mattn/go-isatty v0.0.5/go.mod h1:Iq45c/XA43vh69/j3iqttzPXn0bhXyGjM0Hd github.com/mattn/go-isatty v0.0.8/go.mod h1:Iq45c/XA43vh69/j3iqttzPXn0bhXyGjM0Hdxcsrc5s= github.com/mattn/go-isatty v0.0.13/go.mod h1:cbi8OIDigv2wuxKPP5vlRcQ1OAZbq2CE4Kysco4FUpU= github.com/mattn/go-isatty v0.0.14/go.mod h1:7GGIvUiUoEMVVmxf/4nioHXj79iQHKdU27kJ6hsGG94= -github.com/mattn/go-isatty v0.0.16 h1:bq3VjFmv/sOjHtdEhmkEV4x1AJtvUvOJ2PFAZ5+peKQ= github.com/mattn/go-isatty v0.0.16/go.mod h1:kYGgaQfpe5nmfYZH+SKPsOc2e4SrIfOl2e/yFXSvRLM= +github.com/mattn/go-isatty v0.0.17 h1:BTarxUcIeDqL27Mc+vyvdWYSL28zpIhv3RoTdsLMPng= +github.com/mattn/go-isatty v0.0.17/go.mod h1:kYGgaQfpe5nmfYZH+SKPsOc2e4SrIfOl2e/yFXSvRLM= github.com/mattn/go-pointer v0.0.1 h1:n+XhsuGeVO6MEAp7xyEukFINEa+Quek5psIR/ylA6o0= github.com/mattn/go-pointer v0.0.1/go.mod h1:2zXcozF6qYGgmsG+SeTZz3oAbFLdD3OWqnUbNvJZAlc= github.com/mattn/go-runewidth v0.0.2/go.mod h1:LwmH8dsx7+W8Uxz3IHJYH5QSwggIsqBzpuz5H//U1FU= @@ -1282,8 +1286,8 @@ github.com/onflow/flow-core-contracts/lib/go/contracts v0.12.1 h1:9QEI+C9k/Cx/TR github.com/onflow/flow-core-contracts/lib/go/contracts v0.12.1/go.mod h1:xiSs5IkirazpG89H5jH8xVUKNPlCZqUhLH4+vikQVS4= github.com/onflow/flow-core-contracts/lib/go/templates v0.12.1 h1:dhXSFiBkS6Q3XmBctJAfwR4XPkgBT7VNx08F/zTBgkM= github.com/onflow/flow-core-contracts/lib/go/templates v0.12.1/go.mod h1:cBimYbTvHK77lclJ1JyhvmKAB9KDzCeWm7OW1EeQSr0= -github.com/onflow/flow-emulator v0.43.1-0.20230202181019-910459a16e2e h1:iKd4A+FOxjEpOBgMoVWepyt20bMZoxzPJ3FOggGpNjQ= -github.com/onflow/flow-emulator v0.43.1-0.20230202181019-910459a16e2e/go.mod h1:hC3NgLMbQRyxlTcv15NFdb/nZs7emi3yV9QDslxirQ4= +github.com/onflow/flow-emulator v0.45.0 h1:LErItLP6dK+4HDlJWODhJMat7Cw+9jL6rKNpuj8BgJ8= +github.com/onflow/flow-emulator v0.45.0/go.mod h1:X6v25MqdyAJ5gMoYqpb95GZITvJAHMbM7svskYodn+Q= github.com/onflow/flow-ft/lib/go/contracts v0.5.0 h1:Cg4gHGVblxcejfNNG5Mfj98Wf4zbY76O0Y28QB0766A= github.com/onflow/flow-ft/lib/go/contracts v0.5.0/go.mod h1:1zoTjp1KzNnOPkyqKmWKerUyf0gciw+e6tAEt0Ks3JE= github.com/onflow/flow-go-sdk v0.35.0 h1:ndUBCCWqPSdbLNdkP3oZQ8Gfmag9CGlL/i26UjwbFhY= @@ -1426,6 +1430,9 @@ github.com/psiemens/sconfig v0.1.0/go.mod h1:+MLKqdledP/8G3rOBpknbLh0IclCf4WneJU github.com/raulk/go-watchdog v1.3.0 h1:oUmdlHxdkXRJlwfG0O9omj8ukerm8MEQavSiDTEtBsk= github.com/raulk/go-watchdog v1.3.0/go.mod h1:fIvOnLbF0b0ZwkB9YU4mOW9Did//4vPZtDqv66NfsMU= github.com/rcrowley/go-metrics v0.0.0-20181016184325-3113b8401b8a/go.mod h1:bCqnVzQkZxMG4s8nGwiZ5l3QUCyqpo9Y+/ZMZ9VjZe4= +github.com/remyoudompheng/bigfft v0.0.0-20200410134404-eec4a21b6bb0/go.mod h1:qqbHyh8v60DhA7CoWK5oRCqLrMHRGoxYCSS9EjAz6Eo= +github.com/remyoudompheng/bigfft v0.0.0-20230126093431-47fa9a501578 h1:VstopitMQi3hZP0fzvnsLmzXZdQGc4bEcgu24cp+d4M= +github.com/remyoudompheng/bigfft v0.0.0-20230126093431-47fa9a501578/go.mod h1:qqbHyh8v60DhA7CoWK5oRCqLrMHRGoxYCSS9EjAz6Eo= github.com/retailnext/hllpp v1.0.1-0.20180308014038-101a6d2f8b52/go.mod h1:RDpi1RftBQPUCDRw6SmxeaREsAaRKnOclghuzp/WRzc= github.com/rivo/uniseg v0.2.0/go.mod h1:J6wj4VEh+S6ZtnVlnTBMWIodfgj8LQOQFoIToxlJtxc= github.com/rivo/uniseg v0.2.1-0.20211004051800-57c86be7915a h1:s7GrsqeorVkFR1vGmQ6WVL9nup0eyQCC+YVUeSQLH/Q= @@ -1868,8 +1875,8 @@ golang.org/x/oauth2 v0.0.0-20201109201403-9fd604954f58/go.mod h1:KelEdhl1UZF7XfJ golang.org/x/oauth2 v0.0.0-20201208152858-08078c50e5b5/go.mod h1:KelEdhl1UZF7XfJ4dDtk6s++YSgaE7mD/BuKKDLBl4A= golang.org/x/oauth2 v0.0.0-20210218202405-ba52d332ba99/go.mod h1:KelEdhl1UZF7XfJ4dDtk6s++YSgaE7mD/BuKKDLBl4A= golang.org/x/oauth2 v0.0.0-20211104180415-d3ed0bb246c8/go.mod h1:KelEdhl1UZF7XfJ4dDtk6s++YSgaE7mD/BuKKDLBl4A= -golang.org/x/oauth2 v0.3.0 h1:6l90koy8/LaBLmLu8jpHeHexzMwEita0zFfYlggy2F8= -golang.org/x/oauth2 v0.3.0/go.mod h1:rQrIauxkUhJ6CuwEXwymO2/eh4xz2ZWF1nBkcxS+tGk= +golang.org/x/oauth2 v0.4.0 h1:NF0gk8LVPg1Ml7SSbGyySuoxdsXitj7TvgvuRxIMc/M= +golang.org/x/oauth2 v0.4.0/go.mod h1:RznEsdpjGAINPTOF0UH/t+xJ75L18YO3Ho6Pyn+uRec= golang.org/x/perf v0.0.0-20180704124530-6e6d33e29852/go.mod h1:JLpeXjPJfIyPr5TlbXLkXWLhP8nz10XfvxElABhCtcw= golang.org/x/sync v0.0.0-20180314180146-1d60e4601c6f/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sync v0.0.0-20181108010431-42b317875d0f/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= @@ -2128,8 +2135,8 @@ google.golang.org/api v0.30.0/go.mod h1:QGmEvQ87FHZNiUVJkT14jQNYJ4ZJjdRF23ZXz513 google.golang.org/api v0.35.0/go.mod h1:/XrVsuzM0rZmrsbjJutiuftIzeuTQcEeaYcSk/mQ1dg= google.golang.org/api v0.36.0/go.mod h1:+z5ficQTmoYpPn8LCUNVpK5I7hwkpjbcgqA7I34qYtE= google.golang.org/api v0.40.0/go.mod h1:fYKFpnQN0DsDSKRVRcQSDQNtqWPfM9i+zNPxepjRCQ8= -google.golang.org/api v0.102.0 h1:JxJl2qQ85fRMPNvlZY/enexbxpCjLwGhZUtgfGeQ51I= -google.golang.org/api v0.102.0/go.mod h1:3VFl6/fzoA+qNuS1N1/VfXY4LjoXN/wzeIp7TweWwGo= +google.golang.org/api v0.103.0 h1:9yuVqlu2JCvcLg9p8S3fcFLZij8EPSyvODIY1rkMizQ= +google.golang.org/api v0.103.0/go.mod h1:hGtW6nK1AC+d9si/UBhw8Xli+QMOf6xyNAyJw4qU9w0= google.golang.org/appengine v1.1.0/go.mod h1:EbEs0AVv82hx2wNQdGPgUI5lhzA/G0D9YwlJXL52JkM= google.golang.org/appengine v1.2.0/go.mod h1:xpcJRLb0r/rnEns0DIKYYv+WjYCduHsrkT7/EB5XEv4= google.golang.org/appengine v1.3.0/go.mod h1:xpcJRLb0r/rnEns0DIKYYv+WjYCduHsrkT7/EB5XEv4= @@ -2185,8 +2192,8 @@ google.golang.org/genproto v0.0.0-20201214200347-8c77b98c765d/go.mod h1:FWY/as6D google.golang.org/genproto v0.0.0-20210108203827-ffc7fda8c3d7/go.mod h1:FWY/as6DDZQgahTzZj3fqbO1CbirC29ZNUFHwi0/+no= google.golang.org/genproto v0.0.0-20210226172003-ab064af71705/go.mod h1:FWY/as6DDZQgahTzZj3fqbO1CbirC29ZNUFHwi0/+no= google.golang.org/genproto v0.0.0-20211118181313-81c1377c94b1/go.mod h1:5CzLGKJ67TSI2B9POpiiyGha0AjJvZIUgRMt1dSmuhc= -google.golang.org/genproto v0.0.0-20221118155620-16455021b5e6 h1:a2S6M0+660BgMNl++4JPlcAO/CjkqYItDEZwkoDQK7c= -google.golang.org/genproto v0.0.0-20221118155620-16455021b5e6/go.mod h1:rZS5c/ZVYMaOGBfO68GWtjOw/eLaZM1X6iVtgjZ+EWg= +google.golang.org/genproto v0.0.0-20230110181048-76db0878b65f h1:BWUVssLB0HVOSY78gIdvk1dTVYtT1y8SBWtPYuTJ/6w= +google.golang.org/genproto v0.0.0-20230110181048-76db0878b65f/go.mod h1:RGgjbofJ8xD9Sq1VVhDM1Vok1vRONV+rg+CjzG4SZKM= google.golang.org/grpc v1.14.0/go.mod h1:yo6s7OP7yaDglbqo1J04qKzAhqBH6lvTonzMVmEdcZw= google.golang.org/grpc v1.16.0/go.mod h1:0JHn/cJsOMiMfNA9+DeHDlAU7KAAB5GDlYFpa9MZMio= google.golang.org/grpc v1.17.0/go.mod h1:6QZJwpn2B+Zp71q/5VxRsJ6NXXVCE5NRUHRo+f3cWCs= @@ -2215,8 +2222,8 @@ google.golang.org/grpc v1.35.0/go.mod h1:qjiiYl8FncCW8feJPdyg3v6XW24KsRHe+dy9BAG google.golang.org/grpc v1.36.0/go.mod h1:qjiiYl8FncCW8feJPdyg3v6XW24KsRHe+dy9BAGRRjU= google.golang.org/grpc v1.40.0/go.mod h1:ogyxbiOoUXAkP+4+xa6PZSE9DZgIHtSpzjDTB9KAK34= google.golang.org/grpc v1.42.0/go.mod h1:k+4IHHFw41K8+bbowsex27ge2rCb65oeWqe4jJ590SU= -google.golang.org/grpc v1.52.3 h1:pf7sOysg4LdgBqduXveGKrcEwbStiK2rtfghdzlUYDQ= -google.golang.org/grpc v1.52.3/go.mod h1:pu6fVzoFb+NBYNAvQL08ic+lvB2IojljRYuun5vorUY= +google.golang.org/grpc v1.53.0 h1:LAv2ds7cmFV/XTS3XG1NneeENYrXGmorPxsBbptIjNc= +google.golang.org/grpc v1.53.0/go.mod h1:OnIrk0ipVdj4N5d9IUoFUx72/VlD7+jUsHwZgwSMQpw= google.golang.org/grpc/cmd/protoc-gen-go-grpc v1.1.0 h1:M1YKkFIboKNieVO5DLUEVzQfGwJD30Nv2jfUgzb5UcE= google.golang.org/grpc/cmd/protoc-gen-go-grpc v1.1.0/go.mod h1:6Kw0yEErY5E/yWrBtf03jp27GLLJujG4z/JK95pnjjw= google.golang.org/protobuf v0.0.0-20200109180630-ec00e32a8dfd/go.mod h1:DFci5gLYBciE7Vtevhsrf46CRTquxDuWsQurQQe4oz8= @@ -2292,6 +2299,14 @@ k8s.io/kubernetes v1.13.0/go.mod h1:ocZa8+6APFNC2tX1DZASIbocyYT5jHzqFVsY5aoB7Jk= lukechampine.com/blake3 v1.1.6/go.mod h1:tkKEOtDkNtklkXtLNEOGNq5tcV90tJiA1vAA12R78LA= lukechampine.com/blake3 v1.1.7 h1:GgRMhmdsuK8+ii6UZFDL8Nb+VyMwadAgcJyfYHxG6n0= lukechampine.com/blake3 v1.1.7/go.mod h1:tkKEOtDkNtklkXtLNEOGNq5tcV90tJiA1vAA12R78LA= +modernc.org/libc v1.22.2 h1:4U7v51GyhlWqQmwCHj28Rdq2Yzwk55ovjFrdPjs8Hb0= +modernc.org/libc v1.22.2/go.mod h1:uvQavJ1pZ0hIoC/jfqNoMLURIMhKzINIWypNM17puug= +modernc.org/mathutil v1.5.0 h1:rV0Ko/6SfM+8G+yKiyI830l3Wuz1zRutdslNoQ0kfiQ= +modernc.org/mathutil v1.5.0/go.mod h1:mZW8CKdRPY1v87qxC/wUdX5O1qDzXMP5TH3wjfpga6E= +modernc.org/memory v1.5.0 h1:N+/8c5rE6EqugZwHii4IFsaJ7MUhoWX07J5tC/iI5Ds= +modernc.org/memory v1.5.0/go.mod h1:PkUhL0Mugw21sHPeskwZW4D6VscE/GQJOnIpCnW6pSU= +modernc.org/sqlite v1.20.3 h1:SqGJMMxjj1PHusLxdYxeQSodg7Jxn9WWkaAQjKrntZs= +modernc.org/sqlite v1.20.3/go.mod h1:zKcGyrICaxNTMEHSr1HQ2GUraP0j+845GYw37+EyT6A= pgregory.net/rapid v0.4.7 h1:MTNRktPuv5FNqOO151TM9mDTa+XHcX6ypYeISDVD14g= rsc.io/binaryregexp v0.2.0/go.mod h1:qTv7/COck+e2FymRvadv62gMdZztPaShugOCi3I+8D8= rsc.io/pdf v0.1.1/go.mod h1:n8OzWcQ6Sp37PL01nO98y4iUCRdTGarVfzxY20ICaU4= From 53ef8e9759f05b8acf41cab02ade8acf96e5b773 Mon Sep 17 00:00:00 2001 From: Jordan Schalm Date: Fri, 24 Mar 2023 17:59:32 -0400 Subject: [PATCH 09/12] update common tests remove assumption that encoding error is in error chain, since this is an exception --- consensus/hotstuff/committees/consensus_committee_test.go | 6 ------ 1 file changed, 6 deletions(-) diff --git a/consensus/hotstuff/committees/consensus_committee_test.go b/consensus/hotstuff/committees/consensus_committee_test.go index d2ecdc7fae2..b8d1f5bc415 100644 --- a/consensus/hotstuff/committees/consensus_committee_test.go +++ b/consensus/hotstuff/committees/consensus_committee_test.go @@ -16,7 +16,6 @@ import ( "github.com/onflow/flow-go/model/flow" "github.com/onflow/flow-go/model/flow/mapfunc" "github.com/onflow/flow-go/module/irrecoverable" - "github.com/onflow/flow-go/state" "github.com/onflow/flow-go/state/protocol" protocolmock "github.com/onflow/flow-go/state/protocol/mock" "github.com/onflow/flow-go/state/protocol/seed" @@ -315,11 +314,6 @@ func (suite *ConsensusSuite) TestIdentitiesByBlock() { _, err := suite.committee.IdentityByBlock(blockID, unittest.IdentifierFixture()) assert.ErrorIs(t, err, mockErr) }) - t.Run("should propagate state.ErrUnknownSnapshotReference", func(t *testing.T) { - suite.snapshot.On("Identity", mock.Anything).Return(nil, state.ErrUnknownSnapshotReference) - _, err := suite.committee.IdentityByBlock(blockID, unittest.IdentifierFixture()) - assert.ErrorIs(t, err, state.ErrUnknownSnapshotReference) - }) } // TestIdentitiesByEpoch tests that identities can be queried by epoch. From e37de487c9443c49ebd13199ce4c2e43c733fbb9 Mon Sep 17 00:00:00 2001 From: Jordan Schalm Date: Mon, 27 Mar 2023 09:25:11 -0400 Subject: [PATCH 10/12] common tests: assert not sentinel --- storage/badger/operation/common_test.go | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/storage/badger/operation/common_test.go b/storage/badger/operation/common_test.go index 27f7f468b18..07b60941d34 100644 --- a/storage/badger/operation/common_test.go +++ b/storage/badger/operation/common_test.go @@ -108,8 +108,8 @@ func TestInsertEncodingError(t *testing.T) { key := []byte{0x01, 0x02, 0x03} err := db.Update(insert(key, UnencodeableEntity(e))) - - require.ErrorIs(t, err, errCantEncode) + require.Error(t, err, errCantEncode) + require.NotErrorIs(t, err, storage.ErrNotFound) }) } @@ -171,7 +171,8 @@ func TestUpdateEncodingError(t *testing.T) { }) err := db.Update(update(key, UnencodeableEntity(e))) - require.ErrorIs(t, err, errCantEncode) + require.Error(t, err) + require.NotErrorIs(t, err, storage.ErrNotFound) // ensure value did not change var act []byte @@ -270,7 +271,8 @@ func TestRetrieveUnencodeable(t *testing.T) { var act *UnencodeableEntity err := db.View(retrieve(key, &act)) - require.ErrorIs(t, err, errCantDecode) + require.Error(t, err) + require.NotErrorIs(t, err, storage.ErrNotFound) }) } From b81799f88d0c3ca17632a40fd888728edead45c4 Mon Sep 17 00:00:00 2001 From: Jordan Schalm Date: Mon, 27 Mar 2023 16:36:16 -0400 Subject: [PATCH 11/12] Update state/protocol/badger/state.go --- state/protocol/badger/state.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/state/protocol/badger/state.go b/state/protocol/badger/state.go index c05e3b2a674..cb479fed4ac 100644 --- a/state/protocol/badger/state.go +++ b/state/protocol/badger/state.go @@ -644,7 +644,7 @@ func (state *State) AtHeight(height uint64) protocol.Snapshot { func (state *State) AtBlockID(blockID flow.Identifier) protocol.Snapshot { exists, err := state.headers.Exists(blockID) if err != nil { - return invalid.NewSnapshotf("could not check existence of reference block") + return invalid.NewSnapshotf("could not check existence of reference block: %w", err) } if !exists { return invalid.NewSnapshotf("unknown block %x: %w", blockID, statepkg.ErrUnknownSnapshotReference) From 693261318a27c9e933ce978da7ed9fe7cefe6cce Mon Sep 17 00:00:00 2001 From: Jordan Schalm Date: Tue, 4 Apr 2023 10:26:56 -0400 Subject: [PATCH 12/12] Apply suggestions from code review Co-authored-by: Yurii Oleksyshyn --- consensus/hotstuff/signature/block_signer_decoder_test.go | 4 ++-- storage/badger/operation/common_test.go | 1 + 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/consensus/hotstuff/signature/block_signer_decoder_test.go b/consensus/hotstuff/signature/block_signer_decoder_test.go index 2940c21f390..78efb3005eb 100644 --- a/consensus/hotstuff/signature/block_signer_decoder_test.go +++ b/consensus/hotstuff/signature/block_signer_decoder_test.go @@ -78,7 +78,7 @@ func (s *blockSignerDecoderSuite) Test_CommitteeException() { require.Empty(s.T(), ids) require.NotErrorIs(s.T(), err, model.ErrViewForUnknownEpoch) require.False(s.T(), signature.IsInvalidSignerIndicesError(err)) - require.True(s.T(), errors.Is(err, exception)) + require.ErrorIs(s.T(), err, exception) }) s.Run("ByBlock exception", func() { exception := errors.New("unexpected exception") @@ -90,7 +90,7 @@ func (s *blockSignerDecoderSuite) Test_CommitteeException() { require.Empty(s.T(), ids) require.NotErrorIs(s.T(), err, model.ErrViewForUnknownEpoch) require.False(s.T(), signature.IsInvalidSignerIndicesError(err)) - require.True(s.T(), errors.Is(err, exception)) + require.ErrorIs(s.T(), err, exception) }) } diff --git a/storage/badger/operation/common_test.go b/storage/badger/operation/common_test.go index 07b60941d34..ebef5aef45d 100644 --- a/storage/badger/operation/common_test.go +++ b/storage/badger/operation/common_test.go @@ -276,6 +276,7 @@ func TestRetrieveUnencodeable(t *testing.T) { }) } +// TestExists verifies that `exists` returns correct results in different scenarios. func TestExists(t *testing.T) { unittest.RunWithBadgerDB(t, func(db *badger.DB) { t.Run("non-existent key", func(t *testing.T) {