Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix execValidateBlock #1740

Merged
merged 5 commits into from
Oct 24, 2023
Merged

Fix execValidateBlock #1740

merged 5 commits into from
Oct 24, 2023

Conversation

ghost
Copy link

@ghost ghost commented Sep 22, 2023


@ghost ghost force-pushed the fix-validate-block branch from 40a3ac4 to 2eaf1de Compare September 25, 2023 06:32
@ghost ghost marked this pull request as ready for review September 26, 2023 12:48
@ghost ghost requested a review from edmundnoble September 26, 2023 12:48
@ghost ghost force-pushed the fix-validate-block branch 2 times, most recently from d69c72e to dc1ac4b Compare October 2, 2023 12:13
Copy link
Contributor

@edmundnoble edmundnoble left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We could move the validateHashes check to the smart constructor, but I'm fine with this as it is too.

@ghost ghost force-pushed the fix-validate-block branch from dc1ac4b to ea1efdd Compare October 12, 2023 16:30
, _payloadWithOutputsTransactionsHash = txsHash
, _payloadWithOutputsOutputsHash = outsHash
}
return $ newPayloadWithOutputs (_blockMinerData txs) (_blockCoinbaseOutput outs) (V.zip (_blockTransactions txs) (_blockOutputs outs))
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

So we're recomputing the hashes now? Can we avoid that?

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yep, by using the neighbour smart constructor payloadWithOutputs.

@@ -108,7 +108,9 @@ simulate sc@(SimConfig dbDir txIdx' _ _ cid ver gasLog doTypecheck) = do
(_cpBeginCheckpointerBatch cp)
(_cpDiscardCheckpointerBatch cp) $ case (txIdx',doTypecheck) of
(Just txIdx,_) -> do -- single-tx simulation
let PayloadWithOutputs txs md _ _ _ _ :: PayloadWithOutputs = head pwos
let pwo :: PayloadWithOutputs = head pwos
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Idk why this type annotation is here.

@ghost ghost requested a review from edmundnoble October 16, 2023 09:48
@ghost ghost force-pushed the fix-validate-block branch from 32ff584 to 8968cb9 Compare October 17, 2023 12:31
@ghost
Copy link
Author

ghost commented Oct 19, 2023

@edmundnoble can we merge this one as well?

@edmundnoble edmundnoble enabled auto-merge October 19, 2023 14:13
@ghost ghost force-pushed the fix-validate-block branch from 8968cb9 to fddafd0 Compare October 23, 2023 10:15
@edmundnoble edmundnoble added this pull request to the merge queue Oct 24, 2023
Merged via the queue into master with commit 921d4d9 Oct 24, 2023
@ghost ghost deleted the fix-validate-block branch October 25, 2023 06:43
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant