@@ -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.
160165func 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.
184195func 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!
238249func TestCalculateExecutionDataLifecycle (t * testing.T ) {
239250 t .Parallel ()
240251
0 commit comments