-
Notifications
You must be signed in to change notification settings - Fork 270
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
refactor: nuking old BlockHeader
#4154
Changes from 51 commits
dd33ee7
e59708b
e23fec9
0bbdeb7
50c5333
28f7f65
87734eb
f1fd093
c2d3243
42d1a44
55cb1ab
d4555bf
53e227b
0700543
e4c37ae
8889d3d
eb9e6a7
a7fa10d
8e725ae
0461b84
1f9c99d
4969f5f
cbb25d5
a381696
b5bb32c
9a44485
f98e1ee
5996733
332cbcb
6de111d
44c8dcd
e780288
af48a96
35d8c8c
b375a69
16e829d
40a0db7
816531d
5e43492
9ccac5b
4a5b4bf
21b0cd6
b86a8e8
d31f10d
40c21a2
48047e5
e2637e7
7ff2af2
fce94dc
2e817f2
19bd066
4f0eb2a
eea6b83
8df308a
9a72c78
d8e4131
e39d8ce
9ad0708
68cab09
4d31d69
6342a9a
e92a7a5
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,9 +1,9 @@ | ||
import { | ||
BlockHeader, | ||
CallContext, | ||
ContractDeploymentData, | ||
FunctionData, | ||
GlobalVariables, | ||
Header, | ||
PrivateCallStackItem, | ||
PrivateCircuitPublicInputs, | ||
PublicCallRequest, | ||
|
@@ -103,19 +103,11 @@ export function toACVMContractDeploymentData(contractDeploymentData: ContractDep | |
|
||
/** | ||
* Converts a block header into ACVM fields. | ||
* @param blockHeader - The block header object to convert. | ||
* @param header - The block header object to convert. | ||
* @returns The ACVM fields. | ||
*/ | ||
export function toACVMBlockHeader(blockHeader: BlockHeader): ACVMField[] { | ||
return [ | ||
toACVMField(blockHeader.noteHashTreeRoot), | ||
toACVMField(blockHeader.nullifierTreeRoot), | ||
toACVMField(blockHeader.contractTreeRoot), | ||
toACVMField(blockHeader.l1ToL2MessageTreeRoot), | ||
toACVMField(blockHeader.archiveRoot), | ||
toACVMField(blockHeader.publicDataTreeRoot), | ||
toACVMField(blockHeader.globalVariablesHash), | ||
]; | ||
export function toACVMHeader(header: Header): ACVMField[] { | ||
return header.toFieldArray().map(toACVMField); | ||
} | ||
|
||
/** | ||
|
@@ -157,7 +149,7 @@ export function toACVMPublicInputs(publicInputs: PrivateCircuitPublicInputs): AC | |
toACVMField(publicInputs.encryptedLogPreimagesLength), | ||
toACVMField(publicInputs.unencryptedLogPreimagesLength), | ||
|
||
...toACVMBlockHeader(publicInputs.blockHeader), | ||
...toACVMHeader(publicInputs.historicalHeader), | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. If I recall, at some point you would like to have There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Yes, I had a plan to do it in this issue (might split it to a separate issue now that I think about it). In general it seems to be a good idea to have all the serialization in the classes themselves so I would probably implement a FieldReader in foundation/serialize (akin to BufferReader) and use that in these types which are passed in the witness. |
||
|
||
...toACVMContractDeploymentData(publicInputs.contractDeploymentData), | ||
|
||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The changes to this file were made by bootstrap after rebase.