Skip to content

Commit

Permalink
Add note on requestsRoot non-determinism
Browse files Browse the repository at this point in the history
  • Loading branch information
acolytec3 committed Apr 25, 2024
1 parent 975ab38 commit 0f06222
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions packages/block/src/block.ts
Original file line number Diff line number Diff line change
Expand Up @@ -162,6 +162,10 @@ export class Block {
const executionWitness = executionWitnessData

// Requests are sorted in ascending order based on type
// NOTE: This is a huge issue right now because there's no specific ordering within types so
// the requestsRoot corresponding to the requests is nondeterministic when you have multiple requests
// of the same type since the EIP explicitly does not specify the "intra-type" order

// TODO: Decide if we should require requests to be sorted correctly or just do it automatically
const requests = requestsData?.map(CLRequest.fromRequestsData).sort((a, b) => a.type - b.type)

Expand Down

0 comments on commit 0f06222

Please sign in to comment.