Skip to content

Commit

Permalink
fix randomness notFirstBlock undefined (#558)
Browse files Browse the repository at this point in the history
* fix randomness notFirstBlock undefined

* simple condition
  • Loading branch information
zqhxuyuan authored Nov 24, 2023
1 parent 0666363 commit 48968a0
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion packages/core/src/blockchain/block-builder.ts
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,7 @@ export const newHeader = async (head: Block, unsafeBlockHeight?: number) => {
...consensus.rest,
]

if (meta.query.randomness) {
if (meta.query.randomness?.notFirstBlock) {
// TODO: shouldn't modify existing head
// reset notFirstBlock so randomness will skip validation
head.pushStorageLayer().set(compactHex(meta.query.randomness.notFirstBlock()), StorageValueKind.Deleted)
Expand Down

0 comments on commit 48968a0

Please sign in to comment.