From c28cdda3b34c887b348d0377e65d8f0263f4042f Mon Sep 17 00:00:00 2001 From: Deniz Mert Edincik Date: Tue, 31 Oct 2023 19:49:14 +0100 Subject: [PATCH 01/11] change partition byte for uuid to 3rd byte --- fvm/environment/uuids.go | 16 +++++++++++++--- 1 file changed, 13 insertions(+), 3 deletions(-) diff --git a/fvm/environment/uuids.go b/fvm/environment/uuids.go index 2612ac6d1f8..a64aacdf998 100644 --- a/fvm/environment/uuids.go +++ b/fvm/environment/uuids.go @@ -14,9 +14,18 @@ import ( "github.com/onflow/flow-go/utils/slices" ) +// uuid is partitioned with 3rd byte for compatibility reasons. +// (database types and Javascript safe integer limits) +// +// counter(C) is 7 bytes, paritition(P) is 1 byte +// C7 C6 P C5 C4 C3 C2 C1 +// +// Until resource ids start filling the bits above the 48th one, dapps will have enough time +// to switch to a larger data type. + const ( - // The max value for any is uuid partition is MaxUint56, since the top - // 8 bits in the uuid are used for partitioning. + // The max value for any is uuid partition is MaxUint56, since one byte + // in the uuid is used for partitioning. MaxUint56 = (uint64(1) << 56) - 1 // Start warning when there's only a single high bit left. This should give @@ -196,5 +205,6 @@ func (generator *uUIDGenerator) GenerateUUID() (uint64, error) { // Since the partition counter only goes up to MaxUint56, we can use the // upper 8 bits to represent which partition was used. - return (uint64(generator.partition) << 56) | value, nil + return (uint64(generator.partition) << 40) | (value & 0xFF_FFFF_FFFF) | ((value & 0xFF_FF00_0000_0000) << 8), nil + } From 462b9ccd75732a4f9026ccdbf237170350df8b4b Mon Sep 17 00:00:00 2001 From: Deniz Mert Edincik Date: Tue, 31 Oct 2023 20:05:07 +0100 Subject: [PATCH 02/11] udid partition tests --- fvm/environment/uuids_test.go | 21 +++++++++++---------- 1 file changed, 11 insertions(+), 10 deletions(-) diff --git a/fvm/environment/uuids_test.go b/fvm/environment/uuids_test.go index b83bd5b1821..f600ea78085 100644 --- a/fvm/environment/uuids_test.go +++ b/fvm/environment/uuids_test.go @@ -115,8 +115,9 @@ func testUUIDGenerator(t *testing.T, blockHeader *flow.Header, txnIndex uint32) generator.maybeInitializePartition() partition := generator.partition - partitionMinValue := uint64(partition) << 56 - maxUint56 := uint64(72057594037927935) // (1 << 56) - 1 + partitionMinValue := uint64(partition) << 40 + maxUint56 := uint64(0xFFFFFFFFFFFFFF) + maxUint56Split := uint64(0xFFFF00FFFFFFFFFF) t.Run( fmt.Sprintf("basic get and set uint (partition: %d)", partition), @@ -249,8 +250,8 @@ func testUUIDGenerator(t *testing.T, blockHeader *flow.Header, txnIndex uint32) value, err := uuids.GenerateUUID() require.NoError(t, err) - require.Equal(t, value, partitionMinValue+maxUint56-1) - require.Equal(t, value, partitionMinValue|(maxUint56-1)) + require.Equal(t, value, partitionMinValue+maxUint56Split-1) + require.Equal(t, value, partitionMinValue|(maxUint56Split-1)) value, err = uuids.getUint64() require.NoError(t, err) @@ -282,7 +283,7 @@ func TestUUIDGeneratorHardcodedPartitionIdGeneration(t *testing.T) { value, err := uuids.GenerateUUID() require.NoError(t, err) - require.Equal(t, value, uint64(0xde00000000000000)) + require.Equal(t, value, uint64(0x0000de0000000000)) value, err = uuids.getUint64() require.NoError(t, err) @@ -290,7 +291,7 @@ func TestUUIDGeneratorHardcodedPartitionIdGeneration(t *testing.T) { value, err = uuids.GenerateUUID() require.NoError(t, err) - require.Equal(t, value, uint64(0xde00000000000001)) + require.Equal(t, value, uint64(0x0000de0000000001)) value, err = uuids.getUint64() require.NoError(t, err) @@ -298,7 +299,7 @@ func TestUUIDGeneratorHardcodedPartitionIdGeneration(t *testing.T) { value, err = uuids.GenerateUUID() require.NoError(t, err) - require.Equal(t, value, uint64(0xde00000000000002)) + require.Equal(t, value, uint64(0x0000de0000000002)) value, err = uuids.getUint64() require.NoError(t, err) @@ -306,7 +307,7 @@ func TestUUIDGeneratorHardcodedPartitionIdGeneration(t *testing.T) { // pretend we increamented the counter up to cafBad cafBad := uint64(0x1c2a3f4b5a6d70) - decafBad := uint64(0xde1c2a3f4b5a6d70) + decafBad := uint64(0x1c2ade3f4b5a6d70) err = uuids.setUint56(cafBad) require.NoError(t, err) @@ -328,7 +329,7 @@ func TestUUIDGeneratorHardcodedPartitionIdGeneration(t *testing.T) { value, err = uuids.GenerateUUID() require.NoError(t, err) - require.Equal(t, value, uint64(0xdefffffffffffffd)) + require.Equal(t, value, uint64(0xffffdefffffffffd)) value, err = uuids.getUint64() require.NoError(t, err) @@ -336,7 +337,7 @@ func TestUUIDGeneratorHardcodedPartitionIdGeneration(t *testing.T) { value, err = uuids.GenerateUUID() require.NoError(t, err) - require.Equal(t, value, uint64(0xdefffffffffffffe)) + require.Equal(t, value, uint64(0xffffdefffffffffe)) value, err = uuids.getUint64() require.NoError(t, err) From 20f0dc5fcd227c2eb604b9fbebdcc69947f2deaf Mon Sep 17 00:00:00 2001 From: Deniz Mert Edincik Date: Wed, 1 Nov 2023 09:24:57 +0100 Subject: [PATCH 03/11] Update uuids.go Co-authored-by: Janez Podhostnik <67895329+janezpodhostnik@users.noreply.github.com> --- fvm/environment/uuids.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/fvm/environment/uuids.go b/fvm/environment/uuids.go index a64aacdf998..61cc219ac84 100644 --- a/fvm/environment/uuids.go +++ b/fvm/environment/uuids.go @@ -204,7 +204,7 @@ func (generator *uUIDGenerator) GenerateUUID() (uint64, error) { } // Since the partition counter only goes up to MaxUint56, we can use the - // upper 8 bits to represent which partition was used. + // 6th byte to represent which partition was used. return (uint64(generator.partition) << 40) | (value & 0xFF_FFFF_FFFF) | ((value & 0xFF_FF00_0000_0000) << 8), nil } From 0d02488c3e4a1cdd0d9a25c6f802011f9753932b Mon Sep 17 00:00:00 2001 From: Deniz Mert Edincik Date: Wed, 1 Nov 2023 15:57:55 +0100 Subject: [PATCH 04/11] Update fvm/environment/uuids.go Co-authored-by: Leo Zhang --- fvm/environment/uuids.go | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/fvm/environment/uuids.go b/fvm/environment/uuids.go index 61cc219ac84..3ff8e765357 100644 --- a/fvm/environment/uuids.go +++ b/fvm/environment/uuids.go @@ -205,6 +205,7 @@ func (generator *uUIDGenerator) GenerateUUID() (uint64, error) { // Since the partition counter only goes up to MaxUint56, we can use the // 6th byte to represent which partition was used. - return (uint64(generator.partition) << 40) | (value & 0xFF_FFFF_FFFF) | ((value & 0xFF_FF00_0000_0000) << 8), nil + // (C7 C6) | P | (C5 C4 C3 C2 C1) + return ((value & 0xFF_FF00_0000_0000) << 8) | (uint64(generator.partition) << 40) | (value & 0xFF_FFFF_FFFF), nil } From 48520a104ef99097c6e9b2607e17e56916640033 Mon Sep 17 00:00:00 2001 From: Deniz Mert Edincik Date: Fri, 3 Nov 2023 16:57:43 +0100 Subject: [PATCH 05/11] continuation test --- fvm/environment/uuids_test.go | 32 ++++++++++++++++++++++++++++++++ 1 file changed, 32 insertions(+) diff --git a/fvm/environment/uuids_test.go b/fvm/environment/uuids_test.go index f600ea78085..36f0253a93d 100644 --- a/fvm/environment/uuids_test.go +++ b/fvm/environment/uuids_test.go @@ -350,3 +350,35 @@ func TestUUIDGeneratorHardcodedPartitionIdGeneration(t *testing.T) { require.NoError(t, err) require.Equal(t, value, maxUint56Minus2+2) } + +func TestContinuati(t *testing.T) { + txnState := state.NewTransactionState(nil, state.DefaultParameters()) + uuids := NewUUIDGenerator( + tracing.NewTracerSpan(), + zerolog.Nop(), + NewMeter(txnState), + txnState, + nil, + 0) + + // Hardcoded the partition to check for exact bytes + uuids.initialized = true + uuids.partition = 0x01 + uuids.registerId = flow.UUIDRegisterID(0x01) + + value, err := uuids.GenerateUUID() + require.NoError(t, err) + require.Equal(t, value, uint64(0x0000010000000000)) + + err = uuids.setUint56(0xFFFFFFFFFF) + require.NoError(t, err) + + value, err = uuids.GenerateUUID() + require.NoError(t, err) + require.Equal(t, value, uint64(0x000001FFFFFFFFFF)) + + value, err = uuids.GenerateUUID() + require.NoError(t, err) + require.Equal(t, value, uint64(0x0001010000000000)) + +} From 000ea72de50b5cb2b635864ddeb17e796ad92edc Mon Sep 17 00:00:00 2001 From: Deniz Mert Edincik Date: Fri, 3 Nov 2023 16:58:59 +0100 Subject: [PATCH 06/11] test --- fvm/environment/uuids_test.go | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/fvm/environment/uuids_test.go b/fvm/environment/uuids_test.go index 36f0253a93d..5d3e65ad095 100644 --- a/fvm/environment/uuids_test.go +++ b/fvm/environment/uuids_test.go @@ -381,4 +381,8 @@ func TestContinuati(t *testing.T) { require.NoError(t, err) require.Equal(t, value, uint64(0x0001010000000000)) + value, err = uuids.GenerateUUID() + require.NoError(t, err) + require.Equal(t, value, uint64(0x0001010000000001)) + } From 2a27781de7815c02c4d576f38a87740eb09dd81d Mon Sep 17 00:00:00 2001 From: Deniz Mert Edincik Date: Fri, 3 Nov 2023 23:09:57 +0100 Subject: [PATCH 07/11] Update fvm/environment/uuids.go Co-authored-by: Leo Zhang --- fvm/environment/uuids.go | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/fvm/environment/uuids.go b/fvm/environment/uuids.go index 3ff8e765357..b7bfc15d8bc 100644 --- a/fvm/environment/uuids.go +++ b/fvm/environment/uuids.go @@ -204,8 +204,9 @@ func (generator *uUIDGenerator) GenerateUUID() (uint64, error) { } // Since the partition counter only goes up to MaxUint56, we can use the - // 6th byte to represent which partition was used. + // assemble a UUID value with the partition (P) and the counter (C). + // Note: partition (P) is represented by the 6th byte // (C7 C6) | P | (C5 C4 C3 C2 C1) - return ((value & 0xFF_FF00_0000_0000) << 8) | (uint64(generator.partition) << 40) | (value & 0xFF_FFFF_FFFF), nil + return ((counter & 0xFF_FF00_0000_0000) << 8) | (uint64(generator.partition) << 40) | (counter & 0xFF_FFFF_FFFF), nil``` } From efe1c6f2a189ea27808e2143ca2a4a1595d93d9d Mon Sep 17 00:00:00 2001 From: Deniz Mert Edincik Date: Fri, 3 Nov 2023 23:10:17 +0100 Subject: [PATCH 08/11] Update fvm/environment/uuids.go Co-authored-by: Leo Zhang --- fvm/environment/uuids.go | 2 ++ 1 file changed, 2 insertions(+) diff --git a/fvm/environment/uuids.go b/fvm/environment/uuids.go index b7bfc15d8bc..ef179aa211d 100644 --- a/fvm/environment/uuids.go +++ b/fvm/environment/uuids.go @@ -18,6 +18,8 @@ import ( // (database types and Javascript safe integer limits) // // counter(C) is 7 bytes, paritition(P) is 1 byte +// uuid is assembled by first reading the counter from the register value of the partitioned register, +// and then left shifting the 6th and 7th byte, and placing the partition byte at 6th byte: // C7 C6 P C5 C4 C3 C2 C1 // // Until resource ids start filling the bits above the 48th one, dapps will have enough time From 8eb7df2f752d430101582652c1b63074321cb322 Mon Sep 17 00:00:00 2001 From: Deniz Mert Edincik Date: Fri, 3 Nov 2023 23:12:35 +0100 Subject: [PATCH 09/11] rename --- fvm/environment/uuids.go | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/fvm/environment/uuids.go b/fvm/environment/uuids.go index 3ff8e765357..f52b9402040 100644 --- a/fvm/environment/uuids.go +++ b/fvm/environment/uuids.go @@ -117,8 +117,8 @@ func NewUUIDGenerator( } } -// getUint64 reads the uint64 value from the partitioned uuid register. -func (generator *uUIDGenerator) getUint64() (uint64, error) { +// getCounter reads the uint64 value from the partitioned uuid register. +func (generator *uUIDGenerator) getCounter() (uint64, error) { stateBytes, err := generator.txnState.Get(generator.registerId) if err != nil { return 0, fmt.Errorf( @@ -131,8 +131,8 @@ func (generator *uUIDGenerator) getUint64() (uint64, error) { return binary.BigEndian.Uint64(bytes), nil } -// setUint56 sets a new uint56 value into the partitioned uuid register. -func (generator *uUIDGenerator) setUint56( +// setCounter sets a new uint56 value into the partitioned uuid register. +func (generator *uUIDGenerator) setCounter( value uint64, ) error { if value > Uint56OverflowWarningThreshold { @@ -193,12 +193,12 @@ func (generator *uUIDGenerator) GenerateUUID() (uint64, error) { generator.maybeInitializePartition() - value, err := generator.getUint64() + value, err := generator.getCounter() if err != nil { return 0, fmt.Errorf("cannot generate UUID: %w", err) } - err = generator.setUint56(value + 1) + err = generator.setCounter(value + 1) if err != nil { return 0, fmt.Errorf("cannot generate UUID: %w", err) } From 4f4c564f8e6be23d01737a5ace7be87215252aff Mon Sep 17 00:00:00 2001 From: Deniz Mert Edincik Date: Fri, 3 Nov 2023 23:17:15 +0100 Subject: [PATCH 10/11] rename methods to getCounter/setCounter --- fvm/environment/uuids.go | 8 +++---- fvm/environment/uuids_test.go | 42 +++++++++++++++++------------------ 2 files changed, 25 insertions(+), 25 deletions(-) diff --git a/fvm/environment/uuids.go b/fvm/environment/uuids.go index 8c5a5400053..6775d067ac9 100644 --- a/fvm/environment/uuids.go +++ b/fvm/environment/uuids.go @@ -18,7 +18,7 @@ import ( // (database types and Javascript safe integer limits) // // counter(C) is 7 bytes, paritition(P) is 1 byte -// uuid is assembled by first reading the counter from the register value of the partitioned register, +// uuid is assembled by first reading the counter from the register value of the partitioned register, // and then left shifting the 6th and 7th byte, and placing the partition byte at 6th byte: // C7 C6 P C5 C4 C3 C2 C1 // @@ -195,12 +195,12 @@ func (generator *uUIDGenerator) GenerateUUID() (uint64, error) { generator.maybeInitializePartition() - value, err := generator.getCounter() + counter, err := generator.getCounter() if err != nil { return 0, fmt.Errorf("cannot generate UUID: %w", err) } - err = generator.setCounter(value + 1) + err = generator.setCounter(counter + 1) if err != nil { return 0, fmt.Errorf("cannot generate UUID: %w", err) } @@ -209,6 +209,6 @@ func (generator *uUIDGenerator) GenerateUUID() (uint64, error) { // assemble a UUID value with the partition (P) and the counter (C). // Note: partition (P) is represented by the 6th byte // (C7 C6) | P | (C5 C4 C3 C2 C1) - return ((counter & 0xFF_FF00_0000_0000) << 8) | (uint64(generator.partition) << 40) | (counter & 0xFF_FFFF_FFFF), nil``` + return ((counter & 0xFF_FF00_0000_0000) << 8) | (uint64(generator.partition) << 40) | (counter & 0xFF_FFFF_FFFF), nil } diff --git a/fvm/environment/uuids_test.go b/fvm/environment/uuids_test.go index 5d3e65ad095..a9852bff6a9 100644 --- a/fvm/environment/uuids_test.go +++ b/fvm/environment/uuids_test.go @@ -132,11 +132,11 @@ func testUUIDGenerator(t *testing.T, blockHeader *flow.Header, txnIndex uint32) txnIndex) uuidsA.maybeInitializePartition() - uuid, err := uuidsA.getUint64() // start from zero + uuid, err := uuidsA.getCounter() // start from zero require.NoError(t, err) require.Equal(t, uint64(0), uuid) - err = uuidsA.setUint56(5) + err = uuidsA.setCounter(5) require.NoError(t, err) // create new UUIDs instance @@ -149,7 +149,7 @@ func testUUIDGenerator(t *testing.T, blockHeader *flow.Header, txnIndex uint32) txnIndex) uuidsB.maybeInitializePartition() - uuid, err = uuidsB.getUint64() // should read saved value + uuid, err = uuidsB.getCounter() // should read saved value require.NoError(t, err) require.Equal(t, uint64(5), uuid) @@ -205,7 +205,7 @@ func testUUIDGenerator(t *testing.T, blockHeader *flow.Header, txnIndex uint32) }) t.Run( - fmt.Sprintf("setUint56 overflows (partition: %d)", partition), + fmt.Sprintf("setCounter overflows (partition: %d)", partition), func(t *testing.T) { txnState := state.NewTransactionState(nil, state.DefaultParameters()) uuids := NewUUIDGenerator( @@ -217,17 +217,17 @@ func testUUIDGenerator(t *testing.T, blockHeader *flow.Header, txnIndex uint32) txnIndex) uuids.maybeInitializePartition() - err := uuids.setUint56(maxUint56) + err := uuids.setCounter(maxUint56) require.NoError(t, err) - value, err := uuids.getUint64() + value, err := uuids.getCounter() require.NoError(t, err) require.Equal(t, value, maxUint56) - err = uuids.setUint56(maxUint56 + 1) + err = uuids.setCounter(maxUint56 + 1) require.ErrorContains(t, err, "overflowed") - value, err = uuids.getUint64() + value, err = uuids.getCounter() require.NoError(t, err) require.Equal(t, value, maxUint56) }) @@ -245,7 +245,7 @@ func testUUIDGenerator(t *testing.T, blockHeader *flow.Header, txnIndex uint32) txnIndex) uuids.maybeInitializePartition() - err := uuids.setUint56(maxUint56 - 1) + err := uuids.setCounter(maxUint56 - 1) require.NoError(t, err) value, err := uuids.GenerateUUID() @@ -253,14 +253,14 @@ func testUUIDGenerator(t *testing.T, blockHeader *flow.Header, txnIndex uint32) require.Equal(t, value, partitionMinValue+maxUint56Split-1) require.Equal(t, value, partitionMinValue|(maxUint56Split-1)) - value, err = uuids.getUint64() + value, err = uuids.getCounter() require.NoError(t, err) require.Equal(t, value, maxUint56) _, err = uuids.GenerateUUID() require.ErrorContains(t, err, "overflowed") - value, err = uuids.getUint64() + value, err = uuids.getCounter() require.NoError(t, err) require.Equal(t, value, maxUint56) }) @@ -285,7 +285,7 @@ func TestUUIDGeneratorHardcodedPartitionIdGeneration(t *testing.T) { require.NoError(t, err) require.Equal(t, value, uint64(0x0000de0000000000)) - value, err = uuids.getUint64() + value, err = uuids.getCounter() require.NoError(t, err) require.Equal(t, value, uint64(1)) @@ -293,7 +293,7 @@ func TestUUIDGeneratorHardcodedPartitionIdGeneration(t *testing.T) { require.NoError(t, err) require.Equal(t, value, uint64(0x0000de0000000001)) - value, err = uuids.getUint64() + value, err = uuids.getCounter() require.NoError(t, err) require.Equal(t, value, uint64(2)) @@ -301,7 +301,7 @@ func TestUUIDGeneratorHardcodedPartitionIdGeneration(t *testing.T) { require.NoError(t, err) require.Equal(t, value, uint64(0x0000de0000000002)) - value, err = uuids.getUint64() + value, err = uuids.getCounter() require.NoError(t, err) require.Equal(t, value, uint64(3)) @@ -309,7 +309,7 @@ func TestUUIDGeneratorHardcodedPartitionIdGeneration(t *testing.T) { cafBad := uint64(0x1c2a3f4b5a6d70) decafBad := uint64(0x1c2ade3f4b5a6d70) - err = uuids.setUint56(cafBad) + err = uuids.setCounter(cafBad) require.NoError(t, err) for i := 0; i < 5; i++ { @@ -318,20 +318,20 @@ func TestUUIDGeneratorHardcodedPartitionIdGeneration(t *testing.T) { require.Equal(t, value, decafBad+uint64(i)) } - value, err = uuids.getUint64() + value, err = uuids.getCounter() require.NoError(t, err) require.Equal(t, value, cafBad+uint64(5)) // pretend we increamented the counter up to overflow - 2 maxUint56Minus2 := uint64(0xfffffffffffffd) - err = uuids.setUint56(maxUint56Minus2) + err = uuids.setCounter(maxUint56Minus2) require.NoError(t, err) value, err = uuids.GenerateUUID() require.NoError(t, err) require.Equal(t, value, uint64(0xffffdefffffffffd)) - value, err = uuids.getUint64() + value, err = uuids.getCounter() require.NoError(t, err) require.Equal(t, value, maxUint56Minus2+1) @@ -339,14 +339,14 @@ func TestUUIDGeneratorHardcodedPartitionIdGeneration(t *testing.T) { require.NoError(t, err) require.Equal(t, value, uint64(0xffffdefffffffffe)) - value, err = uuids.getUint64() + value, err = uuids.getCounter() require.NoError(t, err) require.Equal(t, value, maxUint56Minus2+2) _, err = uuids.GenerateUUID() require.ErrorContains(t, err, "overflowed") - value, err = uuids.getUint64() + value, err = uuids.getCounter() require.NoError(t, err) require.Equal(t, value, maxUint56Minus2+2) } @@ -370,7 +370,7 @@ func TestContinuati(t *testing.T) { require.NoError(t, err) require.Equal(t, value, uint64(0x0000010000000000)) - err = uuids.setUint56(0xFFFFFFFFFF) + err = uuids.setCounter(0xFFFFFFFFFF) require.NoError(t, err) value, err = uuids.GenerateUUID() From a3b336cfa8c640342f2c7f45d9aec503333ed5dd Mon Sep 17 00:00:00 2001 From: Janez Podhostnik Date: Wed, 24 Jan 2024 22:02:57 +0100 Subject: [PATCH 11/11] change expected state comitments --- engine/execution/state/bootstrap/bootstrap_test.go | 2 +- utils/unittest/execution_state.go | 6 +++--- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/engine/execution/state/bootstrap/bootstrap_test.go b/engine/execution/state/bootstrap/bootstrap_test.go index 4969baa9208..7ef8bc35d84 100644 --- a/engine/execution/state/bootstrap/bootstrap_test.go +++ b/engine/execution/state/bootstrap/bootstrap_test.go @@ -53,7 +53,7 @@ func TestBootstrapLedger(t *testing.T) { } func TestBootstrapLedger_ZeroTokenSupply(t *testing.T) { - expectedStateCommitmentBytes, _ := hex.DecodeString("4c5b099dae68a858dd8da0944e6fad6f6d1b943b83c5acb39aeee659e165adb5") + expectedStateCommitmentBytes, _ := hex.DecodeString("8d9d52a66a832898f6f2416b703759b7ecd1eb390db6d5e727c2daeec001ffc6") expectedStateCommitment, err := flow.ToStateCommitment(expectedStateCommitmentBytes) require.NoError(t, err) diff --git a/utils/unittest/execution_state.go b/utils/unittest/execution_state.go index 8acb8d2a09e..5e0b3d3620f 100644 --- a/utils/unittest/execution_state.go +++ b/utils/unittest/execution_state.go @@ -23,7 +23,7 @@ const ServiceAccountPrivateKeySignAlgo = crypto.ECDSAP256 const ServiceAccountPrivateKeyHashAlgo = hash.SHA2_256 // Pre-calculated state commitment with root account with the above private key -const GenesisStateCommitmentHex = "6c394b798bcabfdbdcfddb98f33a818de81efc160d99a4697db57b7b099d1ab1" +const GenesisStateCommitmentHex = "e4674bba14f59af783bbf70b2a43c1696a7d9888eeaca86cf74b033580fe1c23" var GenesisStateCommitment flow.StateCommitment @@ -87,10 +87,10 @@ func genesisCommitHexByChainID(chainID flow.ChainID) string { return GenesisStateCommitmentHex } if chainID == flow.Testnet { - return "5dc11f195653540c1cc3c2fd42ac9d9dca415be6080276eebd1e2fa5dba07a1c" + return "bfe964655cf13711b93dbaf156aaebbc24a607beed69dd36d71b593832b5129c" } if chainID == flow.Sandboxnet { return "e1c08b17f9e5896f03fe28dd37ca396c19b26628161506924fbf785834646ea1" } - return "0d5dcd6cd42cbc41c2aae1a4a6ee950758cc2f75f21ad0ccf84b9e9fa35305ff" + return "a56a2750708bc981eb949a3b02a41061dc6b7e6bfa9f31a19a48f560f616bed3" }