Skip to content

Commit 92695b5

Browse files
authored
Merge branch 'master' into peter/execdata-metrics-highest-consecutive
2 parents b532d62 + 0ff8354 commit 92695b5

File tree

8 files changed

+28
-20
lines changed

8 files changed

+28
-20
lines changed

go.mod

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,6 @@ require (
5555
github.com/onflow/flow-go-sdk v1.8.4
5656
github.com/onflow/flow/protobuf/go/flow v0.4.16
5757
github.com/pbnjay/memory v0.0.0-20210728143218-7b4eea64cf58
58-
github.com/pierrec/lz4 v2.6.1+incompatible
5958
github.com/pkg/errors v0.9.1
6059
github.com/pkg/profile v1.7.0
6160
github.com/prometheus/client_golang v1.20.5
@@ -110,6 +109,7 @@ require (
110109
github.com/onflow/go-ethereum v1.13.4
111110
github.com/onflow/nft-storefront/lib/go/contracts v1.0.0
112111
github.com/onflow/wal v1.0.2
112+
github.com/pierrec/lz4/v4 v4.1.22
113113
github.com/slok/go-http-metrics v0.12.0
114114
github.com/sony/gobreaker v0.5.0
115115
go.opentelemetry.io/otel/exporters/stdout/stdouttrace v1.21.0

go.sum

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1012,8 +1012,8 @@ github.com/pelletier/go-toml/v2 v2.2.1/go.mod h1:1t835xjRzz80PqgE6HHgN2JOsmgYu/h
10121012
github.com/performancecopilot/speed v3.0.0+incompatible/go.mod h1:/CLtqpZ5gBg1M9iaPbIdPPGyKcA8hKdoy6hAWba7Yac=
10131013
github.com/pierrec/lz4 v1.0.2-0.20190131084431-473cd7ce01a1/go.mod h1:3/3N9NVKO0jef7pBehbT1qWhCMrIgbYNnFAZCqQ5LRc=
10141014
github.com/pierrec/lz4 v2.0.5+incompatible/go.mod h1:pdkljMzZIN41W+lC3N2tnIh5sFi+IEE17M5jbnwPHcY=
1015-
github.com/pierrec/lz4 v2.6.1+incompatible h1:9UY3+iC23yxF0UfGaYrGplQ+79Rg+h/q9FV9ix19jjM=
1016-
github.com/pierrec/lz4 v2.6.1+incompatible/go.mod h1:pdkljMzZIN41W+lC3N2tnIh5sFi+IEE17M5jbnwPHcY=
1015+
github.com/pierrec/lz4/v4 v4.1.22 h1:cKFw6uJDK+/gfw5BcDL0JL5aBsAFdsIT18eRtLj7VIU=
1016+
github.com/pierrec/lz4/v4 v4.1.22/go.mod h1:gZWDp/Ze/IJXGXf23ltt2EXimqmTUXEy0GFuRQyBid4=
10171017
github.com/pingcap/errors v0.11.4 h1:lFuQV/oaUMGcD2tqt+01ROSmJs75VG1ToEOkZIZ4nE4=
10181018
github.com/pingcap/errors v0.11.4/go.mod h1:Oi8TUi2kEtXXLMJk9l1cGmz20kV3TaQ0usTwv5KuLY8=
10191019
github.com/pion/datachannel v1.5.10 h1:ly0Q26K1i6ZkGf42W7D4hQYR90pZwzFOjTq5AuCKk4o=

insecure/go.mod

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -233,7 +233,7 @@ require (
233233
github.com/opentracing/opentracing-go v1.2.0 // indirect
234234
github.com/pbnjay/memory v0.0.0-20210728143218-7b4eea64cf58 // indirect
235235
github.com/pelletier/go-toml/v2 v2.2.1 // indirect
236-
github.com/pierrec/lz4 v2.6.1+incompatible // indirect
236+
github.com/pierrec/lz4/v4 v4.1.22 // indirect
237237
github.com/pion/datachannel v1.5.10 // indirect
238238
github.com/pion/dtls/v2 v2.2.12 // indirect
239239
github.com/pion/ice/v2 v2.3.37 // indirect

insecure/go.sum

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -960,8 +960,8 @@ github.com/pelletier/go-toml/v2 v2.2.1/go.mod h1:1t835xjRzz80PqgE6HHgN2JOsmgYu/h
960960
github.com/performancecopilot/speed v3.0.0+incompatible/go.mod h1:/CLtqpZ5gBg1M9iaPbIdPPGyKcA8hKdoy6hAWba7Yac=
961961
github.com/pierrec/lz4 v1.0.2-0.20190131084431-473cd7ce01a1/go.mod h1:3/3N9NVKO0jef7pBehbT1qWhCMrIgbYNnFAZCqQ5LRc=
962962
github.com/pierrec/lz4 v2.0.5+incompatible/go.mod h1:pdkljMzZIN41W+lC3N2tnIh5sFi+IEE17M5jbnwPHcY=
963-
github.com/pierrec/lz4 v2.6.1+incompatible h1:9UY3+iC23yxF0UfGaYrGplQ+79Rg+h/q9FV9ix19jjM=
964-
github.com/pierrec/lz4 v2.6.1+incompatible/go.mod h1:pdkljMzZIN41W+lC3N2tnIh5sFi+IEE17M5jbnwPHcY=
963+
github.com/pierrec/lz4/v4 v4.1.22 h1:cKFw6uJDK+/gfw5BcDL0JL5aBsAFdsIT18eRtLj7VIU=
964+
github.com/pierrec/lz4/v4 v4.1.22/go.mod h1:gZWDp/Ze/IJXGXf23ltt2EXimqmTUXEy0GFuRQyBid4=
965965
github.com/pingcap/errors v0.11.4 h1:lFuQV/oaUMGcD2tqt+01ROSmJs75VG1ToEOkZIZ4nE4=
966966
github.com/pingcap/errors v0.11.4/go.mod h1:Oi8TUi2kEtXXLMJk9l1cGmz20kV3TaQ0usTwv5KuLY8=
967967
github.com/pion/datachannel v1.5.10 h1:ly0Q26K1i6ZkGf42W7D4hQYR90pZwzFOjTq5AuCKk4o=

integration/go.mod

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -271,8 +271,7 @@ require (
271271
github.com/opentracing/opentracing-go v1.2.0 // indirect
272272
github.com/pbnjay/memory v0.0.0-20210728143218-7b4eea64cf58 // indirect
273273
github.com/pelletier/go-toml/v2 v2.2.2 // indirect
274-
github.com/pierrec/lz4 v2.6.1+incompatible // indirect
275-
github.com/pierrec/lz4/v4 v4.1.18 // indirect
274+
github.com/pierrec/lz4/v4 v4.1.22 // indirect
276275
github.com/pion/datachannel v1.5.10 // indirect
277276
github.com/pion/dtls/v2 v2.2.12 // indirect
278277
github.com/pion/ice/v2 v2.3.37 // indirect

integration/go.sum

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -820,12 +820,10 @@ github.com/pbnjay/memory v0.0.0-20210728143218-7b4eea64cf58/go.mod h1:DXv8WO4yhM
820820
github.com/pelletier/go-toml v1.2.0/go.mod h1:5z9KED0ma1S8pY6P1sdut58dfprrGBbd/94hg7ilaic=
821821
github.com/pelletier/go-toml/v2 v2.2.2 h1:aYUidT7k73Pcl9nb2gScu7NSrKCSHIDE89b3+6Wq+LM=
822822
github.com/pelletier/go-toml/v2 v2.2.2/go.mod h1:1t835xjRzz80PqgE6HHgN2JOsmgYu/h4qDAS4n929Rs=
823-
github.com/pierrec/lz4 v2.6.1+incompatible h1:9UY3+iC23yxF0UfGaYrGplQ+79Rg+h/q9FV9ix19jjM=
824-
github.com/pierrec/lz4 v2.6.1+incompatible/go.mod h1:pdkljMzZIN41W+lC3N2tnIh5sFi+IEE17M5jbnwPHcY=
825823
github.com/pierrec/lz4/v4 v4.1.14/go.mod h1:gZWDp/Ze/IJXGXf23ltt2EXimqmTUXEy0GFuRQyBid4=
826824
github.com/pierrec/lz4/v4 v4.1.17/go.mod h1:gZWDp/Ze/IJXGXf23ltt2EXimqmTUXEy0GFuRQyBid4=
827-
github.com/pierrec/lz4/v4 v4.1.18 h1:xaKrnTkyoqfh1YItXl56+6KJNVYWlEEPuAQW9xsplYQ=
828-
github.com/pierrec/lz4/v4 v4.1.18/go.mod h1:gZWDp/Ze/IJXGXf23ltt2EXimqmTUXEy0GFuRQyBid4=
825+
github.com/pierrec/lz4/v4 v4.1.22 h1:cKFw6uJDK+/gfw5BcDL0JL5aBsAFdsIT18eRtLj7VIU=
826+
github.com/pierrec/lz4/v4 v4.1.22/go.mod h1:gZWDp/Ze/IJXGXf23ltt2EXimqmTUXEy0GFuRQyBid4=
829827
github.com/pingcap/errors v0.11.4 h1:lFuQV/oaUMGcD2tqt+01ROSmJs75VG1ToEOkZIZ4nE4=
830828
github.com/pingcap/errors v0.11.4/go.mod h1:Oi8TUi2kEtXXLMJk9l1cGmz20kV3TaQ0usTwv5KuLY8=
831829
github.com/pion/datachannel v1.5.10 h1:ly0Q26K1i6ZkGf42W7D4hQYR90pZwzFOjTq5AuCKk4o=

module/executiondatasync/provider/provider_test.go

Lines changed: 18 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -156,11 +156,18 @@ func TestGenerateExecutionDataRoot(t *testing.T) {
156156
assert.Equal(t, expectedExecutionDataRoot, actualExecutionDataRoot)
157157
}
158158

159-
// TestCalculateExecutionDataRootID tests that CalculateExecutionDataRootID calculates the correct ID given a static BlockExecutionDataRoot
159+
// TestCalculateExecutionDataRootID tests that CalculateExecutionDataRootID calculates the correct
160+
// ID given a static BlockExecutionDataRoot. This is used to ensure library updates or modification
161+
// to the provider do not change the ID calculation logic.
162+
//
163+
// CAUTION: Unintentional changes may cause execution forks!
164+
// Only modify this test if the hash calculation is expected to change.
160165
func TestCalculateExecutionDataRootID(t *testing.T) {
161166
t.Parallel()
162167

168+
// ONLY modify this hash if it was expected to change. Unintentional changes may cause execution forks!
163169
expected := flow.MustHexStringToIdentifier("ae80bb200545de7ff009d2f3e20970643198be635a9b90fffb9da1198a988deb")
170+
164171
edRoot := flow.BlockExecutionDataRoot{
165172
BlockID: flow.MustHexStringToIdentifier("2b31c5e26b999a41d18dc62584ac68476742b071fc9412d68be9e516e1dfc79e"),
166173
ChunkExecutionDataIDs: []cid.Cid{
@@ -179,15 +186,20 @@ func TestCalculateExecutionDataRootID(t *testing.T) {
179186
assert.Equal(t, expected, actual)
180187
}
181188

182-
// TestCalculateChunkExecutionDataID tests that CalculateChunkExecutionDataID calculates the correct ID given a static ChunkExecutionData
183-
// This is used to ensure library updates or modification to the provider do not change the ID calculation logic
189+
// TestCalculateChunkExecutionDataID tests that CalculateChunkExecutionDataID calculates the correct
190+
// ID given a static ChunkExecutionData. This is used to ensure library updates or modification to
191+
// the provider do not change the ID calculation logic.
192+
//
193+
// CAUTION: Unintentional changes may cause execution forks!
194+
// Only modify this test if the hash calculation is expected to change.
184195
func TestCalculateChunkExecutionDataID(t *testing.T) {
185196
t.Parallel()
186197

187198
rootHash, err := ledger.ToRootHash([]byte("0123456789acbdef0123456789acbdef"))
188199
require.NoError(t, err)
189200

190-
expected := cid.MustParse("QmWJsC7DTufdGijftpphuxZ6EbNsDar1knP2BnvgBaMf9n")
201+
// ONLY modify this hash if it was expected to change. Unintentional changes may cause execution forks!
202+
expected := cid.MustParse("QmSZ4sMzj8Be7kkZekjHKppmx2os87oAHV87WFUgZTMrWf")
191203

192204
ced := execution_data.ChunkExecutionData{
193205
Collection: &flow.Collection{
@@ -221,9 +233,6 @@ func TestCalculateChunkExecutionDataID(t *testing.T) {
221233
actual, err := cidProvider.CalculateChunkExecutionDataID(ced)
222234
require.NoError(t, err)
223235

224-
// This can be used for updating the expected ID when the format is *intentionally* updated
225-
t.Log(actual)
226-
227236
assert.Equal(t,
228237
expected, actual,
229238
"expected and actual CID do not match: expected %s, actual %s",
@@ -235,6 +244,8 @@ func TestCalculateChunkExecutionDataID(t *testing.T) {
235244
// TestCalculateExecutionDataLifecycle tests that the execution data is reproduced correctly
236245
// at different stages of the lifecycle. This ensures that the data remains consistent, and
237246
// the hashing logic is correct.
247+
//
248+
// CAUTION: Unintentional changes may cause execution forks!
238249
func TestCalculateExecutionDataLifecycle(t *testing.T) {
239250
t.Parallel()
240251

network/compressor/lz4Compressor.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ package compressor
33
import (
44
"io"
55

6-
"github.com/pierrec/lz4"
6+
"github.com/pierrec/lz4/v4"
77

88
"github.com/onflow/flow-go/network"
99
)

0 commit comments

Comments
 (0)