@aztec-labs/stdlib 6.0.0-rc.2 → 6.0.0-rc.4
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dest/abi/abi.d.ts +2 -1
- package/dest/abi/abi.d.ts.map +1 -1
- package/dest/abi/abi.js +1 -0
- package/dest/abi/authorization_selector.d.ts +2 -1
- package/dest/abi/authorization_selector.d.ts.map +1 -1
- package/dest/abi/authorization_selector.js +1 -0
- package/dest/abi/buffer.d.ts +2 -1
- package/dest/abi/buffer.d.ts.map +1 -1
- package/dest/abi/buffer.js +1 -0
- package/dest/abi/contract_artifact.d.ts +2 -1
- package/dest/abi/contract_artifact.d.ts.map +1 -1
- package/dest/abi/contract_artifact.js +1 -0
- package/dest/abi/encoder.d.ts +1 -1
- package/dest/abi/encoder.d.ts.map +1 -1
- package/dest/abi/encoder.js +1 -0
- package/dest/abi/event_selector.d.ts +2 -1
- package/dest/abi/event_selector.d.ts.map +1 -1
- package/dest/abi/event_selector.js +1 -0
- package/dest/abi/function_selector.d.ts +2 -1
- package/dest/abi/function_selector.d.ts.map +1 -1
- package/dest/abi/function_selector.js +1 -0
- package/dest/abi/note_selector.d.ts +2 -1
- package/dest/abi/note_selector.d.ts.map +1 -1
- package/dest/abi/note_selector.js +1 -0
- package/dest/abi/selector.d.ts +2 -2
- package/dest/abi/selector.d.ts.map +1 -1
- package/dest/abi/selector.js +1 -1
- package/dest/abi/utils.d.ts +2 -1
- package/dest/abi/utils.d.ts.map +1 -1
- package/dest/abi/utils.js +1 -0
- package/dest/avm/avm.d.ts +212 -211
- package/dest/avm/avm.d.ts.map +1 -1
- package/dest/avm/avm.js +1 -0
- package/dest/avm/avm_accumulated_data.d.ts +2 -2
- package/dest/avm/avm_accumulated_data.d.ts.map +1 -1
- package/dest/avm/avm_accumulated_data.js +1 -1
- package/dest/avm/avm_circuit_public_inputs.d.ts +2 -2
- package/dest/avm/avm_circuit_public_inputs.d.ts.map +1 -1
- package/dest/avm/avm_circuit_public_inputs.js +1 -1
- package/dest/avm/message_pack.js +1 -1
- package/dest/avm/revert_code.d.ts +3 -2
- package/dest/avm/revert_code.d.ts.map +1 -1
- package/dest/avm/revert_code.js +2 -1
- package/dest/aztec-address/index.d.ts +3 -2
- package/dest/aztec-address/index.d.ts.map +1 -1
- package/dest/aztec-address/index.js +2 -1
- package/dest/block/block_hash.d.ts +2 -2
- package/dest/block/block_hash.d.ts.map +1 -1
- package/dest/block/block_hash.js +1 -1
- package/dest/block/body.d.ts +2 -2
- package/dest/block/body.d.ts.map +1 -1
- package/dest/block/body.js +1 -1
- package/dest/block/l2_block_source.d.ts +19 -3
- package/dest/block/l2_block_source.d.ts.map +1 -1
- package/dest/block/proposal/attestations_and_signers.d.ts +2 -1
- package/dest/block/proposal/attestations_and_signers.d.ts.map +1 -1
- package/dest/block/proposal/attestations_and_signers.js +1 -0
- package/dest/block/proposal/committee_attestation.d.ts +2 -1
- package/dest/block/proposal/committee_attestation.d.ts.map +1 -1
- package/dest/block/proposal/committee_attestation.js +1 -0
- package/dest/checkpoint/checkpoint_data.d.ts +11 -3
- package/dest/checkpoint/checkpoint_data.d.ts.map +1 -1
- package/dest/checkpoint/checkpoint_data.js +3 -2
- package/dest/config/network-consensus-config.d.ts +1 -1
- package/dest/config/network-consensus-config.d.ts.map +1 -1
- package/dest/config/network-consensus-config.js +3 -2
- package/dest/contract/artifact_hash.d.ts +2 -1
- package/dest/contract/artifact_hash.d.ts.map +1 -1
- package/dest/contract/artifact_hash.js +1 -0
- package/dest/contract/complete_address.d.ts +2 -1
- package/dest/contract/complete_address.d.ts.map +1 -1
- package/dest/contract/complete_address.js +1 -0
- package/dest/contract/contract_address.d.ts +1 -1
- package/dest/contract/contract_address.js +1 -1
- package/dest/contract/contract_class.d.ts +1 -1
- package/dest/contract/contract_class.d.ts.map +1 -1
- package/dest/contract/contract_class.js +1 -0
- package/dest/contract/contract_class_id.js +1 -1
- package/dest/contract/interfaces/contract_class.d.ts +2 -1
- package/dest/contract/interfaces/contract_class.d.ts.map +1 -1
- package/dest/contract/interfaces/contract_class.js +1 -0
- package/dest/database-version/database_version.d.ts +2 -1
- package/dest/database-version/database_version.d.ts.map +1 -1
- package/dest/database-version/database_version.js +1 -0
- package/dest/fees/transaction_fee.js +1 -1
- package/dest/file-store/http.d.ts +2 -1
- package/dest/file-store/http.d.ts.map +1 -1
- package/dest/file-store/http.js +1 -0
- package/dest/file-store/memory.d.ts +2 -1
- package/dest/file-store/memory.d.ts.map +1 -1
- package/dest/file-store/memory.js +1 -0
- package/dest/file-store/s3.d.ts +2 -1
- package/dest/file-store/s3.d.ts.map +1 -1
- package/dest/file-store/s3.js +3 -1
- package/dest/gas/fee_math.d.ts +2 -2
- package/dest/gas/fee_math.js +2 -2
- package/dest/gas/gas.d.ts +2 -2
- package/dest/gas/gas.d.ts.map +1 -1
- package/dest/gas/gas.js +1 -1
- package/dest/gas/gas_fees.d.ts +2 -2
- package/dest/gas/gas_fees.d.ts.map +1 -1
- package/dest/gas/gas_fees.js +1 -1
- package/dest/ha-signing/config.d.ts +4 -2
- package/dest/ha-signing/config.d.ts.map +1 -1
- package/dest/ha-signing/config.js +5 -3
- package/dest/ha-signing/index.d.ts +2 -2
- package/dest/ha-signing/index.d.ts.map +1 -1
- package/dest/ha-signing/index.js +1 -1
- package/dest/interfaces/aztec-node-admin.d.ts +9 -1
- package/dest/interfaces/aztec-node-admin.d.ts.map +1 -1
- package/dest/interfaces/aztec-node-admin.js +3 -1
- package/dest/interfaces/configs.d.ts +7 -1
- package/dest/interfaces/configs.d.ts.map +1 -1
- package/dest/interfaces/configs.js +1 -0
- package/dest/kernel/claimed_length_array.d.ts +2 -2
- package/dest/kernel/claimed_length_array.d.ts.map +1 -1
- package/dest/kernel/claimed_length_array.js +1 -1
- package/dest/kernel/hints/transient_data_squashing_hint.d.ts +2 -2
- package/dest/kernel/hints/transient_data_squashing_hint.d.ts.map +1 -1
- package/dest/kernel/hints/transient_data_squashing_hint.js +1 -1
- package/dest/kernel/log_hash.d.ts +2 -2
- package/dest/kernel/log_hash.d.ts.map +1 -1
- package/dest/kernel/log_hash.js +1 -1
- package/dest/kernel/private_log_data.d.ts +2 -2
- package/dest/kernel/private_log_data.d.ts.map +1 -1
- package/dest/kernel/private_log_data.js +1 -1
- package/dest/kernel/private_to_avm_accumulated_data.d.ts +2 -2
- package/dest/kernel/private_to_avm_accumulated_data.d.ts.map +1 -1
- package/dest/kernel/private_to_avm_accumulated_data.js +1 -1
- package/dest/kernel/private_to_public_accumulated_data.d.ts +2 -2
- package/dest/kernel/private_to_public_accumulated_data.d.ts.map +1 -1
- package/dest/kernel/private_to_public_accumulated_data.js +1 -1
- package/dest/kernel/private_to_rollup_accumulated_data.d.ts +2 -2
- package/dest/kernel/private_to_rollup_accumulated_data.d.ts.map +1 -1
- package/dest/kernel/private_to_rollup_accumulated_data.js +1 -1
- package/dest/kernel/private_validation_requests.d.ts +2 -2
- package/dest/kernel/private_validation_requests.d.ts.map +1 -1
- package/dest/kernel/private_validation_requests.js +1 -1
- package/dest/kernel/public_call_request.d.ts +2 -2
- package/dest/kernel/public_call_request.d.ts.map +1 -1
- package/dest/kernel/public_call_request.js +1 -1
- package/dest/keys/derivation.js +2 -2
- package/dest/keys/public_keys.d.ts +2 -1
- package/dest/keys/public_keys.d.ts.map +1 -1
- package/dest/keys/public_keys.js +1 -0
- package/dest/logs/contract_class_log.d.ts +2 -2
- package/dest/logs/contract_class_log.d.ts.map +1 -1
- package/dest/logs/contract_class_log.js +1 -1
- package/dest/logs/log_cursor.d.ts +2 -1
- package/dest/logs/log_cursor.d.ts.map +1 -1
- package/dest/logs/log_cursor.js +1 -0
- package/dest/logs/private_log.d.ts +2 -2
- package/dest/logs/private_log.d.ts.map +1 -1
- package/dest/logs/private_log.js +1 -1
- package/dest/logs/public_log.d.ts +2 -2
- package/dest/logs/public_log.d.ts.map +1 -1
- package/dest/logs/public_log.js +1 -1
- package/dest/messaging/l1_to_l2_message.d.ts +21 -1
- package/dest/messaging/l1_to_l2_message.d.ts.map +1 -1
- package/dest/messaging/l1_to_l2_message.js +31 -8
- package/dest/messaging/l2_to_l1_membership.d.ts +1 -1
- package/dest/messaging/l2_to_l1_membership.d.ts.map +1 -1
- package/dest/messaging/l2_to_l1_membership.js +1 -0
- package/dest/messaging/out_hash.d.ts +1 -1
- package/dest/messaging/out_hash.d.ts.map +1 -1
- package/dest/messaging/out_hash.js +1 -0
- package/dest/note/note_dao.d.ts +2 -1
- package/dest/note/note_dao.d.ts.map +1 -1
- package/dest/note/note_dao.js +1 -0
- package/dest/proofs/chonk_proof.d.ts +2 -1
- package/dest/proofs/chonk_proof.d.ts.map +1 -1
- package/dest/proofs/chonk_proof.js +1 -0
- package/dest/proofs/proof.d.ts +2 -1
- package/dest/proofs/proof.d.ts.map +1 -1
- package/dest/proofs/proof.js +2 -1
- package/dest/rollup/block_headers_hash.d.ts +1 -1
- package/dest/rollup/block_headers_hash.d.ts.map +1 -1
- package/dest/rollup/block_headers_hash.js +1 -0
- package/dest/rollup/checkpoint_constant_data.d.ts +2 -2
- package/dest/rollup/checkpoint_constant_data.d.ts.map +1 -1
- package/dest/rollup/checkpoint_constant_data.js +1 -1
- package/dest/rollup/checkpoint_header.d.ts +2 -2
- package/dest/rollup/checkpoint_header.d.ts.map +1 -1
- package/dest/rollup/checkpoint_header.js +1 -1
- package/dest/rollup/checkpoint_root_rollup_private_inputs.d.ts +2 -1
- package/dest/rollup/checkpoint_root_rollup_private_inputs.d.ts.map +1 -1
- package/dest/rollup/checkpoint_root_rollup_private_inputs.js +1 -0
- package/dest/slashing/votes.d.ts +2 -1
- package/dest/slashing/votes.d.ts.map +1 -1
- package/dest/slashing/votes.js +1 -0
- package/dest/snapshots/download.d.ts +2 -2
- package/dest/snapshots/download.d.ts.map +1 -1
- package/dest/snapshots/download.js +8 -2
- package/dest/snapshots/index.d.ts +2 -2
- package/dest/snapshots/index.d.ts.map +1 -1
- package/dest/snapshots/index.js +1 -1
- package/dest/snapshots/upload.d.ts +1 -1
- package/dest/snapshots/upload.d.ts.map +1 -1
- package/dest/snapshots/upload.js +1 -0
- package/dest/tests/factories.d.ts +2 -1
- package/dest/tests/factories.d.ts.map +1 -1
- package/dest/tests/factories.js +1 -0
- package/dest/tests/mocks.d.ts +1 -1
- package/dest/tests/mocks.d.ts.map +1 -1
- package/dest/tests/mocks.js +1 -0
- package/dest/trees/append_only_tree_snapshot.d.ts +2 -2
- package/dest/trees/append_only_tree_snapshot.d.ts.map +1 -1
- package/dest/trees/append_only_tree_snapshot.js +1 -1
- package/dest/trees/nullifier_leaf.d.ts +2 -1
- package/dest/trees/nullifier_leaf.d.ts.map +1 -1
- package/dest/trees/nullifier_leaf.js +1 -0
- package/dest/trees/public_data_leaf.d.ts +2 -1
- package/dest/trees/public_data_leaf.d.ts.map +1 -1
- package/dest/trees/public_data_leaf.js +1 -0
- package/dest/tx/block_header.d.ts +2 -2
- package/dest/tx/block_header.d.ts.map +1 -1
- package/dest/tx/block_header.js +1 -1
- package/dest/tx/call_context.d.ts +2 -2
- package/dest/tx/call_context.d.ts.map +1 -1
- package/dest/tx/call_context.js +1 -1
- package/dest/tx/global_variables.d.ts +2 -2
- package/dest/tx/global_variables.d.ts.map +1 -1
- package/dest/tx/global_variables.js +1 -1
- package/dest/tx/profiling.d.ts +1 -1
- package/dest/tx/profiling.d.ts.map +1 -1
- package/dest/tx/profiling.js +1 -0
- package/dest/tx/public_call_request_with_calldata.d.ts +2 -2
- package/dest/tx/public_call_request_with_calldata.d.ts.map +1 -1
- package/dest/tx/public_call_request_with_calldata.js +1 -1
- package/dest/tx/state_reference.d.ts +2 -2
- package/dest/tx/state_reference.d.ts.map +1 -1
- package/dest/tx/state_reference.js +1 -1
- package/dest/tx/tree_snapshots.d.ts +2 -2
- package/dest/tx/tree_snapshots.d.ts.map +1 -1
- package/dest/tx/tree_snapshots.js +1 -1
- package/dest/tx/tx.d.ts +7 -1
- package/dest/tx/tx.d.ts.map +1 -1
- package/dest/tx/tx.js +8 -1
- package/dest/tx/tx_effect.d.ts +2 -2
- package/dest/tx/tx_effect.d.ts.map +1 -1
- package/dest/tx/tx_effect.js +1 -1
- package/dest/tx/tx_execution_request.d.ts +2 -2
- package/dest/tx/tx_execution_request.d.ts.map +1 -1
- package/dest/tx/tx_execution_request.js +1 -1
- package/dest/tx/validator/error_texts.d.ts +2 -1
- package/dest/tx/validator/error_texts.d.ts.map +1 -1
- package/dest/tx/validator/error_texts.js +13 -0
- package/dest/vks/verification_key.d.ts +2 -1
- package/dest/vks/verification_key.d.ts.map +1 -1
- package/dest/vks/verification_key.js +1 -0
- package/dest/zkpassport/index.d.ts +2 -1
- package/dest/zkpassport/index.d.ts.map +1 -1
- package/dest/zkpassport/index.js +1 -0
- package/package.json +10 -9
- package/src/abi/abi.ts +1 -0
- package/src/abi/authorization_selector.ts +1 -0
- package/src/abi/buffer.ts +1 -0
- package/src/abi/contract_artifact.ts +1 -0
- package/src/abi/encoder.ts +1 -0
- package/src/abi/event_selector.ts +1 -0
- package/src/abi/function_selector.ts +1 -0
- package/src/abi/note_selector.ts +1 -0
- package/src/abi/selector.ts +1 -1
- package/src/abi/utils.ts +2 -0
- package/src/avm/avm.ts +1 -0
- package/src/avm/avm_accumulated_data.ts +1 -1
- package/src/avm/avm_circuit_public_inputs.ts +1 -1
- package/src/avm/message_pack.ts +1 -1
- package/src/avm/revert_code.ts +2 -1
- package/src/aztec-address/index.ts +2 -1
- package/src/block/block_hash.ts +1 -1
- package/src/block/body.ts +1 -1
- package/src/block/l2_block_source.ts +19 -2
- package/src/block/proposal/attestations_and_signers.ts +1 -0
- package/src/block/proposal/committee_attestation.ts +1 -0
- package/src/checkpoint/checkpoint_data.ts +9 -1
- package/src/config/network-consensus-config.ts +3 -2
- package/src/contract/artifact_hash.ts +1 -0
- package/src/contract/complete_address.ts +1 -0
- package/src/contract/contract_address.ts +1 -1
- package/src/contract/contract_class.ts +1 -0
- package/src/contract/contract_class_id.ts +1 -1
- package/src/contract/interfaces/contract_class.ts +1 -0
- package/src/database-version/database_version.ts +1 -0
- package/src/fees/transaction_fee.ts +1 -1
- package/src/file-store/http.ts +1 -0
- package/src/file-store/memory.ts +1 -0
- package/src/file-store/s3.ts +3 -1
- package/src/gas/README.md +2 -2
- package/src/gas/fee_math.ts +2 -2
- package/src/gas/gas.ts +1 -1
- package/src/gas/gas_fees.ts +1 -1
- package/src/ha-signing/config.ts +8 -4
- package/src/ha-signing/index.ts +1 -0
- package/src/interfaces/aztec-node-admin.ts +8 -0
- package/src/interfaces/configs.ts +6 -0
- package/src/kernel/claimed_length_array.ts +1 -1
- package/src/kernel/hints/transient_data_squashing_hint.ts +1 -1
- package/src/kernel/log_hash.ts +1 -1
- package/src/kernel/private_log_data.ts +1 -1
- package/src/kernel/private_to_avm_accumulated_data.ts +1 -1
- package/src/kernel/private_to_public_accumulated_data.ts +1 -1
- package/src/kernel/private_to_rollup_accumulated_data.ts +1 -1
- package/src/kernel/private_validation_requests.ts +1 -1
- package/src/kernel/public_call_request.ts +1 -1
- package/src/keys/derivation.ts +2 -2
- package/src/keys/public_keys.ts +1 -0
- package/src/logs/contract_class_log.ts +1 -1
- package/src/logs/log_cursor.ts +1 -0
- package/src/logs/private_log.ts +1 -1
- package/src/logs/public_log.ts +1 -1
- package/src/messaging/l1_to_l2_message.ts +40 -11
- package/src/messaging/l2_to_l1_membership.ts +1 -0
- package/src/messaging/out_hash.ts +1 -0
- package/src/note/note_dao.ts +1 -0
- package/src/proofs/chonk_proof.ts +1 -0
- package/src/proofs/proof.ts +2 -1
- package/src/rollup/block_headers_hash.ts +1 -0
- package/src/rollup/checkpoint_constant_data.ts +1 -1
- package/src/rollup/checkpoint_header.ts +1 -1
- package/src/rollup/checkpoint_root_rollup_private_inputs.ts +1 -0
- package/src/slashing/votes.ts +1 -0
- package/src/snapshots/download.ts +28 -19
- package/src/snapshots/index.ts +7 -1
- package/src/snapshots/upload.ts +1 -0
- package/src/tests/factories.ts +1 -0
- package/src/tests/mocks.ts +1 -0
- package/src/trees/append_only_tree_snapshot.ts +1 -1
- package/src/trees/nullifier_leaf.ts +1 -0
- package/src/trees/public_data_leaf.ts +1 -0
- package/src/tx/block_header.ts +1 -1
- package/src/tx/call_context.ts +1 -1
- package/src/tx/global_variables.ts +1 -1
- package/src/tx/profiling.ts +1 -0
- package/src/tx/public_call_request_with_calldata.ts +1 -1
- package/src/tx/state_reference.ts +1 -1
- package/src/tx/tree_snapshots.ts +1 -1
- package/src/tx/tx.ts +10 -0
- package/src/tx/tx_effect.ts +1 -1
- package/src/tx/tx_execution_request.ts +1 -1
- package/src/tx/validator/error_texts.ts +18 -0
- package/src/vks/verification_key.ts +1 -0
- package/src/zkpassport/index.ts +1 -0
|
@@ -391,6 +391,21 @@ export interface L2BlockSink {
|
|
|
391
391
|
* prefix reference does not match the sink's canonical messages at the block's L1-to-L2 leaf count.
|
|
392
392
|
*/
|
|
393
393
|
addBlock(block: L2Block, inboxPrefixRef: InboxMessagePrefixRef): Promise<void>;
|
|
394
|
+
|
|
395
|
+
/**
|
|
396
|
+
* Prunes the proposed blocks of a checkpoint its proposer abandoned before enclosing them in a proposed checkpoint,
|
|
397
|
+
* instead of leaving them on the local chain until the orphan prune notices that no checkpoint ever came. Removes
|
|
398
|
+
* every block after `afterBlockNumber`, the block the abandoned checkpoint built on, and notifies subscribers exactly
|
|
399
|
+
* as an orphan prune does.
|
|
400
|
+
*
|
|
401
|
+
* Prunes nothing when the range no longer holds the caller's blocks: when the block after `afterBlockNumber` is not
|
|
402
|
+
* `firstBlockHash`, or when a proposed or L1 checkpoint already covers it. Also prunes nothing when a checkpoint
|
|
403
|
+
* proposal for the block's slot has been received, since another proposer may still be proposing these blocks.
|
|
404
|
+
* @param afterBlockNumber - The parent block of the abandoned checkpoint; it and everything before it are kept.
|
|
405
|
+
* @param firstBlockHash - The hash of the abandoned checkpoint's first block, as the caller pushed it.
|
|
406
|
+
* @returns The numbers of the pruned blocks, empty when the guard left the chain untouched.
|
|
407
|
+
*/
|
|
408
|
+
pruneAbandonedProposedBlocks(afterBlockNumber: BlockNumber, firstBlockHash: BlockHash): Promise<BlockNumber[]>;
|
|
394
409
|
}
|
|
395
410
|
|
|
396
411
|
/**
|
|
@@ -629,8 +644,8 @@ export type InvalidCheckpointDetectedEvent = {
|
|
|
629
644
|
};
|
|
630
645
|
|
|
631
646
|
/**
|
|
632
|
-
* Emitted when a local proposed checkpoint is found to disagree with the L1-confirmed
|
|
633
|
-
*
|
|
647
|
+
* Emitted when a local proposed checkpoint is found to disagree with the L1-confirmed checkpoint at the same slot, and
|
|
648
|
+
* both were signed by the same proposer — equivocation.
|
|
634
649
|
*/
|
|
635
650
|
export type CheckpointEquivocationDetectedEvent = {
|
|
636
651
|
type: 'checkpointEquivocationDetected';
|
|
@@ -638,6 +653,8 @@ export type CheckpointEquivocationDetectedEvent = {
|
|
|
638
653
|
checkpointNumber: CheckpointNumber;
|
|
639
654
|
l1ArchiveRoot: Fr;
|
|
640
655
|
proposedArchiveRoot: Fr;
|
|
656
|
+
/** The proposer whose key signed both the local proposed checkpoint and the L1 checkpoint. */
|
|
657
|
+
signer: EthAddress;
|
|
641
658
|
};
|
|
642
659
|
|
|
643
660
|
/**
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import type { ViemCommitteeAttestations } from '@aztec-labs/ethereum/contracts';
|
|
2
2
|
import { bufferToHex, hexToBuffer } from '@aztec-labs/foundation/string';
|
|
3
|
+
import { Buffer } from 'buffer';
|
|
3
4
|
import { encodeAbiParameters, parseAbiParameters } from 'viem';
|
|
4
5
|
import { z } from 'zod';
|
|
5
6
|
|
|
@@ -3,6 +3,7 @@ import { Buffer32 } from '@aztec-labs/foundation/buffer';
|
|
|
3
3
|
import { EthAddress } from '@aztec-labs/foundation/eth-address';
|
|
4
4
|
import { Signature } from '@aztec-labs/foundation/eth-signature';
|
|
5
5
|
import { BufferReader, serializeToBuffer } from '@aztec-labs/foundation/serialize';
|
|
6
|
+
import { Buffer } from 'buffer';
|
|
6
7
|
import { z } from 'zod';
|
|
7
8
|
|
|
8
9
|
export { EthAddress, Signature };
|
|
@@ -9,7 +9,8 @@ import {
|
|
|
9
9
|
CheckpointNumberSchema,
|
|
10
10
|
} from '@aztec-labs/foundation/branded-types';
|
|
11
11
|
import { Fr } from '@aztec-labs/foundation/curves/bn254';
|
|
12
|
-
import {
|
|
12
|
+
import type { EthAddress } from '@aztec-labs/foundation/eth-address';
|
|
13
|
+
import { optional, schemas } from '@aztec-labs/foundation/schemas';
|
|
13
14
|
import { z } from 'zod';
|
|
14
15
|
|
|
15
16
|
import { CommitteeAttestation } from '../block/proposal/committee_attestation.js';
|
|
@@ -48,6 +49,12 @@ export type StorageEnrichedCheckpointData = {
|
|
|
48
49
|
export type ProposedOnlyCheckpointData = {
|
|
49
50
|
totalManaUsed: bigint;
|
|
50
51
|
feeAssetPriceModifier: bigint;
|
|
52
|
+
/**
|
|
53
|
+
* Address recovered from the signature of the checkpoint proposal this checkpoint came from. Undefined when unknown
|
|
54
|
+
* (a checkpoint built without a signed proposal, or one stored before signers were recorded), in which case a
|
|
55
|
+
* divergence from L1 is never attributed to anyone as equivocation.
|
|
56
|
+
*/
|
|
57
|
+
signer?: EthAddress;
|
|
51
58
|
};
|
|
52
59
|
|
|
53
60
|
/** Inbox consumption record of a proposed checkpoint, mirroring what `propose` writes for it on L1. */
|
|
@@ -83,6 +90,7 @@ export const ProposedCheckpointDataSchema = z.object({
|
|
|
83
90
|
totalManaUsed: schemas.BigInt,
|
|
84
91
|
feeAssetPriceModifier: schemas.BigInt,
|
|
85
92
|
inboxMsgTotal: schemas.BigInt,
|
|
93
|
+
signer: optional(schemas.EthAddress),
|
|
86
94
|
});
|
|
87
95
|
|
|
88
96
|
export const CheckpointDataSchema = z
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import { type L1ContractsConfig, l1ContractsConfigMappings, validateSlotDurations } from '@aztec-labs/ethereum/config';
|
|
2
2
|
import { type EnvVar, pickConfigMappings } from '@aztec-labs/foundation/config';
|
|
3
|
+
import { getEnv } from '@aztec-labs/foundation/config/env';
|
|
3
4
|
|
|
4
5
|
import { MAX_ATTESTABLE_BLOCKS_PER_CHECKPOINT } from '../deserialization/index.js';
|
|
5
6
|
import type { SequencerConfig } from '../interfaces/configs.js';
|
|
@@ -260,7 +261,7 @@ export function validateNetworkConsensusConfig(config: NetworkConsensusConfig):
|
|
|
260
261
|
*/
|
|
261
262
|
export function checkConsensusEnvOverrides(
|
|
262
263
|
networkConfig: Record<string, string | number | boolean>,
|
|
263
|
-
env: { [key: string]: string | undefined } =
|
|
264
|
+
env: { [key: string]: string | undefined } = getEnv(),
|
|
264
265
|
log?: (msg: string) => void,
|
|
265
266
|
): Record<string, string> {
|
|
266
267
|
const allowOverride = allowsNetworkConfigOverride(env);
|
|
@@ -357,7 +358,7 @@ function getProposerTxLimitConflict(
|
|
|
357
358
|
}
|
|
358
359
|
|
|
359
360
|
/** Whether the env opts into overriding network-wide consensus values (`ALLOW_OVERRIDING_NETWORK_CONFIG`). */
|
|
360
|
-
export function allowsNetworkConfigOverride(env: { [key: string]: string | undefined } =
|
|
361
|
+
export function allowsNetworkConfigOverride(env: { [key: string]: string | undefined } = getEnv()): boolean {
|
|
361
362
|
const value = env.ALLOW_OVERRIDING_NETWORK_CONFIG;
|
|
362
363
|
return value === '1' || value?.toLowerCase() === 'true';
|
|
363
364
|
}
|
|
@@ -3,6 +3,7 @@ import { Fr, reduceFn } from '@aztec-labs/foundation/curves/bn254';
|
|
|
3
3
|
import { createLogger } from '@aztec-labs/foundation/log';
|
|
4
4
|
import { numToUInt8 } from '@aztec-labs/foundation/serialize';
|
|
5
5
|
import { MerkleTree, MerkleTreeCalculator } from '@aztec-labs/foundation/trees';
|
|
6
|
+
import { Buffer } from 'buffer';
|
|
6
7
|
import deterministicStringify from 'json-stringify-deterministic';
|
|
7
8
|
|
|
8
9
|
import {
|
|
@@ -2,6 +2,7 @@ import { Fr } from '@aztec-labs/foundation/curves/bn254';
|
|
|
2
2
|
import { hexSchemaFor } from '@aztec-labs/foundation/schemas';
|
|
3
3
|
import { BufferReader, serializeToBuffer } from '@aztec-labs/foundation/serialize';
|
|
4
4
|
import { bufferToHex } from '@aztec-labs/foundation/string';
|
|
5
|
+
import { Buffer } from 'buffer';
|
|
5
6
|
|
|
6
7
|
import { AztecAddress } from '../aztec-address/index.js';
|
|
7
8
|
import { computeAddress, computePreaddress, deriveKeys } from '../keys/index.js';
|
|
@@ -16,7 +16,7 @@ import type { PartialAddress } from './partial_address.js';
|
|
|
16
16
|
* ```
|
|
17
17
|
* salted_initialization_hash = poseidon2(DOM_SEP__SALTED_INITIALIZATION_HASH, [salt, initialization_hash, deployer, immutables_hash])
|
|
18
18
|
* partial_address = poseidon2(DOM_SEP__PARTIAL_ADDRESS, [contract_class_id, salted_initialization_hash])
|
|
19
|
-
* address = ((poseidon2(
|
|
19
|
+
* address = ((poseidon2(DOM_SEP__CONTRACT_ADDRESS_V3, [public_keys_hash, partial_address]) * G) + ivpk_m).x <- the x-coordinate of the address point
|
|
20
20
|
* ```
|
|
21
21
|
* @param instance - A contract instance for which to calculate the deployment address.
|
|
22
22
|
*/
|
|
@@ -2,6 +2,7 @@ import { CircuitKind } from '@aztec-foundation/bb.js';
|
|
|
2
2
|
|
|
3
3
|
import { vkAsFields } from '@aztec-labs/foundation/crypto/keys';
|
|
4
4
|
import { Fr } from '@aztec-labs/foundation/curves/bn254';
|
|
5
|
+
import { Buffer } from 'buffer';
|
|
5
6
|
|
|
6
7
|
import { type ContractArtifact, type FunctionArtifact, FunctionSelector, FunctionType } from '../abi/index.js';
|
|
7
8
|
import { hashVK } from '../hash/hash.js';
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { DomainSeparator, MAX_PACKED_PUBLIC_BYTECODE_SIZE_IN_FIELDS } from '@aztec-labs/constants';
|
|
2
2
|
import { poseidon2HashWithSeparator } from '@aztec-labs/foundation/crypto/poseidon';
|
|
3
3
|
import { Fr } from '@aztec-labs/foundation/curves/bn254';
|
|
4
|
-
import {
|
|
4
|
+
import { assert } from '@aztec-labs/foundation/validation';
|
|
5
5
|
|
|
6
6
|
import { bufferAsFields } from '../abi/index.js';
|
|
7
7
|
import type { ContractClass } from './interfaces/contract_class.js';
|
package/src/file-store/http.ts
CHANGED
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import { type Logger, createLogger } from '@aztec-labs/foundation/log';
|
|
2
2
|
import { makeBackoff, retry } from '@aztec-labs/foundation/retry';
|
|
3
3
|
import axios, { type AxiosInstance, type AxiosRequestConfig, type AxiosResponse } from 'axios';
|
|
4
|
+
import { Buffer } from 'buffer';
|
|
4
5
|
import { createWriteStream } from 'fs';
|
|
5
6
|
import { mkdir } from 'fs/promises';
|
|
6
7
|
import { dirname } from 'path';
|
package/src/file-store/memory.ts
CHANGED
package/src/file-store/s3.ts
CHANGED
|
@@ -5,7 +5,9 @@ import {
|
|
|
5
5
|
PutObjectCommand,
|
|
6
6
|
S3Client,
|
|
7
7
|
} from '@aws-sdk/client-s3';
|
|
8
|
+
import { getEnv } from '@aztec-labs/foundation/config/env';
|
|
8
9
|
import { type Logger, createLogger } from '@aztec-labs/foundation/log';
|
|
10
|
+
import { Buffer } from 'buffer';
|
|
9
11
|
import { createReadStream, createWriteStream } from 'fs';
|
|
10
12
|
import { mkdir, mkdtemp, stat, unlink } from 'fs/promises';
|
|
11
13
|
import { tmpdir } from 'os';
|
|
@@ -37,7 +39,7 @@ export class S3FileStore implements FileStore {
|
|
|
37
39
|
private readonly log: Logger = createLogger('stdlib:s3-file-store'),
|
|
38
40
|
) {
|
|
39
41
|
this.endpoint = opts.endpoint;
|
|
40
|
-
this.region = this.endpoint ? 'auto' : (
|
|
42
|
+
this.region = this.endpoint ? 'auto' : (getEnv().AWS_REGION ?? getEnv().AWS_DEFAULT_REGION ?? 'us-east-1');
|
|
41
43
|
this.publicBaseUrl = opts.publicBaseUrl;
|
|
42
44
|
|
|
43
45
|
const clientOptions: any = {};
|
package/src/gas/README.md
CHANGED
|
@@ -208,8 +208,8 @@ itself, before actual teardown consumption is known.
|
|
|
208
208
|
|
|
209
209
|
| Constant | Value |
|
|
210
210
|
| ------------------------------- | -------------- |
|
|
211
|
-
| `L1_GAS_PER_CHECKPOINT_PROPOSED` |
|
|
212
|
-
| `L1_GAS_PER_EPOCH_VERIFIED` |
|
|
211
|
+
| `L1_GAS_PER_CHECKPOINT_PROPOSED` | 520,000 |
|
|
212
|
+
| `L1_GAS_PER_EPOCH_VERIFIED` | 2,500,000 |
|
|
213
213
|
| `BLOBS_PER_CHECKPOINT` (FeeLib) | 3 |
|
|
214
214
|
| `BLOB_GAS_PER_BLOB` | 2^17 |
|
|
215
215
|
| `MINIMUM_CONGESTION_MULTIPLIER` | 1e9 |
|
package/src/gas/fee_math.ts
CHANGED
|
@@ -5,8 +5,8 @@
|
|
|
5
5
|
|
|
6
6
|
// Constants matching FeeLib.sol
|
|
7
7
|
export const MINIMUM_CONGESTION_MULTIPLIER = 1_000_000_000n;
|
|
8
|
-
export const L1_GAS_PER_CHECKPOINT_PROPOSED =
|
|
9
|
-
export const L1_GAS_PER_EPOCH_VERIFIED =
|
|
8
|
+
export const L1_GAS_PER_CHECKPOINT_PROPOSED = 520_000n;
|
|
9
|
+
export const L1_GAS_PER_EPOCH_VERIFIED = 2_500_000n;
|
|
10
10
|
export const BLOBS_PER_CHECKPOINT = 3n;
|
|
11
11
|
export const BLOB_GAS_PER_BLOB = 2n ** 17n;
|
|
12
12
|
export const MAGIC_CONGESTION_VALUE_MULTIPLIER = 854_700_854n;
|
package/src/gas/gas.ts
CHANGED
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { Fr } from '@aztec-labs/foundation/curves/bn254';
|
|
2
|
+
import { inspect } from '@aztec-labs/foundation/inspect';
|
|
2
3
|
import { schemas } from '@aztec-labs/foundation/schemas';
|
|
3
4
|
import {
|
|
4
5
|
BufferReader,
|
|
@@ -8,7 +9,6 @@ import {
|
|
|
8
9
|
serializeToSink,
|
|
9
10
|
} from '@aztec-labs/foundation/serialize';
|
|
10
11
|
import type { FieldsOf } from '@aztec-labs/foundation/types';
|
|
11
|
-
import { inspect } from 'util';
|
|
12
12
|
import { z } from 'zod';
|
|
13
13
|
|
|
14
14
|
import type { UInt32 } from '../types/shared.js';
|
package/src/gas/gas_fees.ts
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import { Fr } from '@aztec-labs/foundation/curves/bn254';
|
|
2
|
+
import { inspect } from '@aztec-labs/foundation/inspect';
|
|
2
3
|
import { schemas } from '@aztec-labs/foundation/schemas';
|
|
3
4
|
import { BufferReader, BufferSink, FieldReader, serializeToFields } from '@aztec-labs/foundation/serialize';
|
|
4
5
|
import type { FieldsOf } from '@aztec-labs/foundation/types';
|
|
5
|
-
import { inspect } from 'util';
|
|
6
6
|
import { z } from 'zod';
|
|
7
7
|
|
|
8
8
|
import type { UInt128 } from '../types/shared.js';
|
package/src/ha-signing/config.ts
CHANGED
|
@@ -16,6 +16,9 @@ import {
|
|
|
16
16
|
import type { ZodFor } from '@aztec-labs/foundation/schemas';
|
|
17
17
|
import { z } from 'zod';
|
|
18
18
|
|
|
19
|
+
/** Default retention for signed duties, in hours. */
|
|
20
|
+
export const DEFAULT_SIGNED_DUTIES_RETENTION_HOURS = 24;
|
|
21
|
+
|
|
19
22
|
/**
|
|
20
23
|
* Base signing protection configuration shared by both HA (Postgres) and local (LMDB) signers.
|
|
21
24
|
*/
|
|
@@ -40,7 +43,7 @@ export type BaseSignerConfig = {
|
|
|
40
43
|
signerCallTimeoutMs?: number;
|
|
41
44
|
/** Maximum age of a stuck duty in ms (defaults to 2x hardcoded Aztec slot duration if not set) */
|
|
42
45
|
maxStuckDutiesAgeMs?: number;
|
|
43
|
-
/**
|
|
46
|
+
/** Duty retention in hours from signing start, with a minimum of two slots (defaults to 24). */
|
|
44
47
|
cleanupOldDutiesAfterHours?: number;
|
|
45
48
|
} & Pick<L1ContractAddresses, 'rollupAddress'>;
|
|
46
49
|
|
|
@@ -72,8 +75,9 @@ export const baseSignerConfigMappings: ConfigMappingsType<BaseSignerConfig> = {
|
|
|
72
75
|
},
|
|
73
76
|
cleanupOldDutiesAfterHours: {
|
|
74
77
|
env: 'VALIDATOR_HA_OLD_DUTIES_MAX_AGE_H',
|
|
75
|
-
description: '
|
|
76
|
-
|
|
78
|
+
description: 'Duty retention in hours from signing start (must be positive; minimum two slots)',
|
|
79
|
+
defaultValue: DEFAULT_SIGNED_DUTIES_RETENTION_HOURS,
|
|
80
|
+
parseEnv: (value: string) => z.coerce.number().int().positive().parse(value),
|
|
77
81
|
},
|
|
78
82
|
...pickL1ContractAddressMappings('rollupAddress'),
|
|
79
83
|
};
|
|
@@ -84,7 +88,7 @@ export const BaseSignerConfigSchema = z.object({
|
|
|
84
88
|
peerSigningTimeoutMs: z.number().min(0),
|
|
85
89
|
signerCallTimeoutMs: z.number().min(0).optional(),
|
|
86
90
|
maxStuckDutiesAgeMs: z.number().min(0).optional(),
|
|
87
|
-
cleanupOldDutiesAfterHours: z.number().
|
|
91
|
+
cleanupOldDutiesAfterHours: z.number().positive().optional(),
|
|
88
92
|
...pickL1ContractAddressesSchema('rollupAddress'),
|
|
89
93
|
}) satisfies ZodFor<BaseSignerConfig>;
|
|
90
94
|
|
package/src/ha-signing/index.ts
CHANGED
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import type { L1ContractAddresses } from '@aztec-labs/ethereum/l1-contract-addresses';
|
|
2
2
|
import { createSafeJsonRpcClient, defaultFetch } from '@aztec-labs/foundation/json-rpc/client';
|
|
3
|
+
import { isValidLogLevelSpec } from '@aztec-labs/foundation/log';
|
|
3
4
|
import { z } from 'zod';
|
|
4
5
|
|
|
5
6
|
import type { ApiSchemaFor } from '../schemas/schemas.js';
|
|
@@ -94,6 +95,12 @@ export type AztecNodeAdminConfig = Omit<ValidatorClientFullConfig, keyof L1Contr
|
|
|
94
95
|
skipIncomingProposals?: boolean;
|
|
95
96
|
// Keep in sync with P2PConfig.preferredPeers (circular dep prevents Pick<P2PConfig, ...> here)
|
|
96
97
|
preferredPeers?: string[];
|
|
98
|
+
/**
|
|
99
|
+
* Log level spec in `LOG_LEVEL` env var format (e.g. `info` or `debug;trace:sequencer,p2p`). Setting it updates
|
|
100
|
+
* all loggers in the node's main thread immediately; worker threads and spawned processes keep their own
|
|
101
|
+
* configuration. Not persisted: a restart reverts to the `LOG_LEVEL` env var.
|
|
102
|
+
*/
|
|
103
|
+
logLevel?: string;
|
|
97
104
|
};
|
|
98
105
|
|
|
99
106
|
export const AztecNodeAdminConfigSchema = SequencerConfigSchema.merge(ProverConfigSchema)
|
|
@@ -111,6 +118,7 @@ export const AztecNodeAdminConfigSchema = SequencerConfigSchema.merge(ProverConf
|
|
|
111
118
|
maxPendingTxCount: z.number(),
|
|
112
119
|
skipIncomingProposals: z.boolean().optional(),
|
|
113
120
|
preferredPeers: z.array(z.string()).optional(),
|
|
121
|
+
logLevel: z.string().refine(isValidLogLevelSpec, 'Invalid log level spec').optional(),
|
|
114
122
|
}),
|
|
115
123
|
);
|
|
116
124
|
|
|
@@ -102,6 +102,11 @@ export interface SequencerConfig {
|
|
|
102
102
|
injectUnrecoverableSignatureAttestation?: boolean;
|
|
103
103
|
/** Inject a non-proposer attestation slot in yParity (v ∈ {0, 1}) form in the packed L1 tuple (for testing only) */
|
|
104
104
|
injectYParityAttestation?: boolean;
|
|
105
|
+
/**
|
|
106
|
+
* Publish the checkpoint with a fake attestation first, then invalidate it and publish it again with the collected
|
|
107
|
+
* attestations within the same slot (for testing only)
|
|
108
|
+
*/
|
|
109
|
+
republishAfterFakeAttestation?: boolean;
|
|
105
110
|
/** Whether to run in fisherman mode: builds blocks on every slot for validation without publishing */
|
|
106
111
|
fishermanMode?: boolean;
|
|
107
112
|
/** Shuffle attestation ordering to create invalid ordering (for testing only) */
|
|
@@ -185,6 +190,7 @@ export const SequencerConfigSchema = zodFor<SequencerConfig>()(
|
|
|
185
190
|
injectHighSValueAttestation: z.boolean().optional(),
|
|
186
191
|
injectUnrecoverableSignatureAttestation: z.boolean().optional(),
|
|
187
192
|
injectYParityAttestation: z.boolean().optional(),
|
|
193
|
+
republishAfterFakeAttestation: z.boolean().optional(),
|
|
188
194
|
fishermanMode: z.boolean().optional(),
|
|
189
195
|
shuffleAttestationOrdering: z.boolean().optional(),
|
|
190
196
|
blockDurationMs: z.number().positive().optional(),
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import type { Fr } from '@aztec-labs/foundation/curves/bn254';
|
|
2
|
+
import { inspect } from '@aztec-labs/foundation/inspect';
|
|
2
3
|
import {
|
|
3
4
|
BufferReader,
|
|
4
5
|
FieldReader,
|
|
@@ -7,7 +8,6 @@ import {
|
|
|
7
8
|
serializeToBuffer,
|
|
8
9
|
serializeToFields,
|
|
9
10
|
} from '@aztec-labs/foundation/serialize';
|
|
10
|
-
import { inspect } from 'util';
|
|
11
11
|
|
|
12
12
|
export class ClaimedLengthArray<T extends Serializable, N extends number> {
|
|
13
13
|
constructor(
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { Fr } from '@aztec-labs/foundation/curves/bn254';
|
|
2
|
+
import { inspect } from '@aztec-labs/foundation/inspect';
|
|
2
3
|
import { BufferReader, FieldReader, serializeToBuffer } from '@aztec-labs/foundation/serialize';
|
|
3
|
-
import { inspect } from 'util';
|
|
4
4
|
|
|
5
5
|
export class TransientDataSquashingHint {
|
|
6
6
|
constructor(
|
package/src/kernel/log_hash.ts
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { Fr } from '@aztec-labs/foundation/curves/bn254';
|
|
2
|
+
import { inspect } from '@aztec-labs/foundation/inspect';
|
|
2
3
|
import { BufferReader, BufferSink, FieldReader, serializeToSink } from '@aztec-labs/foundation/serialize';
|
|
3
4
|
import type { FieldsOf } from '@aztec-labs/foundation/types';
|
|
4
|
-
import { inspect } from 'util';
|
|
5
5
|
|
|
6
6
|
import { AztecAddress } from '../aztec-address/index.js';
|
|
7
7
|
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import { PRIVATE_LOG_DATA_LENGTH } from '@aztec-labs/constants';
|
|
2
2
|
import type { Fr } from '@aztec-labs/foundation/curves/bn254';
|
|
3
|
+
import { inspect } from '@aztec-labs/foundation/inspect';
|
|
3
4
|
import { BufferReader, FieldReader, serializeToBuffer, serializeToFields } from '@aztec-labs/foundation/serialize';
|
|
4
5
|
import type { FieldsOf } from '@aztec-labs/foundation/types';
|
|
5
|
-
import { inspect } from 'util';
|
|
6
6
|
|
|
7
7
|
import { AztecAddress } from '../aztec-address/index.js';
|
|
8
8
|
import { PrivateLog } from '../logs/private_log.js';
|
|
@@ -7,6 +7,7 @@ import {
|
|
|
7
7
|
import { type FieldsOf, makeTuple } from '@aztec-labs/foundation/array';
|
|
8
8
|
import { arraySerializedSizeOfNonEmpty } from '@aztec-labs/foundation/collection';
|
|
9
9
|
import { Fr } from '@aztec-labs/foundation/curves/bn254';
|
|
10
|
+
import { inspect } from '@aztec-labs/foundation/inspect';
|
|
10
11
|
import { schemas } from '@aztec-labs/foundation/schemas';
|
|
11
12
|
import {
|
|
12
13
|
BufferReader,
|
|
@@ -17,7 +18,6 @@ import {
|
|
|
17
18
|
serializeToFields,
|
|
18
19
|
serializeToSink,
|
|
19
20
|
} from '@aztec-labs/foundation/serialize';
|
|
20
|
-
import { inspect } from 'util';
|
|
21
21
|
import { z } from 'zod';
|
|
22
22
|
|
|
23
23
|
import { ScopedL2ToL1Message } from '../messaging/l2_to_l1_message.js';
|
|
@@ -10,6 +10,7 @@ import {
|
|
|
10
10
|
import { type FieldsOf, makeTuple } from '@aztec-labs/foundation/array';
|
|
11
11
|
import { arraySerializedSizeOfNonEmpty } from '@aztec-labs/foundation/collection';
|
|
12
12
|
import { Fr } from '@aztec-labs/foundation/curves/bn254';
|
|
13
|
+
import { inspect } from '@aztec-labs/foundation/inspect';
|
|
13
14
|
import {
|
|
14
15
|
BufferReader,
|
|
15
16
|
BufferSink,
|
|
@@ -18,7 +19,6 @@ import {
|
|
|
18
19
|
serializeToFields,
|
|
19
20
|
serializeToSink,
|
|
20
21
|
} from '@aztec-labs/foundation/serialize';
|
|
21
|
-
import { inspect } from 'util';
|
|
22
22
|
|
|
23
23
|
import { PrivateLog } from '../logs/private_log.js';
|
|
24
24
|
import { ScopedL2ToL1Message } from '../messaging/l2_to_l1_message.js';
|
|
@@ -9,6 +9,7 @@ import {
|
|
|
9
9
|
import { type FieldsOf, makeTuple } from '@aztec-labs/foundation/array';
|
|
10
10
|
import { arraySerializedSizeOfNonEmpty } from '@aztec-labs/foundation/collection';
|
|
11
11
|
import { Fr } from '@aztec-labs/foundation/curves/bn254';
|
|
12
|
+
import { inspect } from '@aztec-labs/foundation/inspect';
|
|
12
13
|
import { bufferSchemaFor } from '@aztec-labs/foundation/schemas';
|
|
13
14
|
import {
|
|
14
15
|
BufferReader,
|
|
@@ -18,7 +19,6 @@ import {
|
|
|
18
19
|
serializeToSink,
|
|
19
20
|
} from '@aztec-labs/foundation/serialize';
|
|
20
21
|
import { bufferToHex, hexToBuffer } from '@aztec-labs/foundation/string';
|
|
21
|
-
import { inspect } from 'util';
|
|
22
22
|
|
|
23
23
|
import { PrivateLog } from '../logs/private_log.js';
|
|
24
24
|
import { ScopedL2ToL1Message } from '../messaging/l2_to_l1_message.js';
|
|
@@ -3,9 +3,9 @@ import {
|
|
|
3
3
|
MAX_NOTE_HASH_READ_REQUESTS_PER_TX,
|
|
4
4
|
MAX_NULLIFIER_READ_REQUESTS_PER_TX,
|
|
5
5
|
} from '@aztec-labs/constants';
|
|
6
|
+
import { inspect } from '@aztec-labs/foundation/inspect';
|
|
6
7
|
import { BufferReader, serializeToBuffer } from '@aztec-labs/foundation/serialize';
|
|
7
8
|
import { bufferToHex, hexToBuffer } from '@aztec-labs/foundation/string';
|
|
8
|
-
import { inspect } from 'util';
|
|
9
9
|
|
|
10
10
|
import { ScopedKeyValidationRequestAndSeparator } from '../kernel/hints/scoped_key_validation_request_and_separator.js';
|
|
11
11
|
import { ClaimedLengthArray, ClaimedLengthArrayFromBuffer } from './claimed_length_array.js';
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import { COUNTED_PUBLIC_CALL_REQUEST_LENGTH, PUBLIC_CALL_REQUEST_LENGTH } from '@aztec-labs/constants';
|
|
2
2
|
import { Fr } from '@aztec-labs/foundation/curves/bn254';
|
|
3
|
+
import { inspect } from '@aztec-labs/foundation/inspect';
|
|
3
4
|
import { schemas } from '@aztec-labs/foundation/schemas';
|
|
4
5
|
import {
|
|
5
6
|
BufferReader,
|
|
@@ -9,7 +10,6 @@ import {
|
|
|
9
10
|
serializeToSink,
|
|
10
11
|
} from '@aztec-labs/foundation/serialize';
|
|
11
12
|
import type { FieldsOf } from '@aztec-labs/foundation/types';
|
|
12
|
-
import { inspect } from 'util';
|
|
13
13
|
import { z } from 'zod';
|
|
14
14
|
|
|
15
15
|
import { AztecAddress } from '../aztec-address/index.js';
|
package/src/keys/derivation.ts
CHANGED
|
@@ -51,12 +51,12 @@ export function deriveMasterFallbackSecretKey(secretKey: Fr): GrumpkinScalar {
|
|
|
51
51
|
}
|
|
52
52
|
|
|
53
53
|
export function computePreaddress(publicKeysHash: Fr, partialAddress: Fr) {
|
|
54
|
-
return poseidon2HashWithSeparator([publicKeysHash, partialAddress], DomainSeparator.
|
|
54
|
+
return poseidon2HashWithSeparator([publicKeysHash, partialAddress], DomainSeparator.CONTRACT_ADDRESS_V3);
|
|
55
55
|
}
|
|
56
56
|
|
|
57
57
|
export async function computeAddress(publicKeys: PublicKeys, partialAddress: Fr): Promise<AztecAddress> {
|
|
58
58
|
// Given public keys and a partial address, we can compute our address in the following steps.
|
|
59
|
-
// 1. preaddress = poseidon2([publicKeysHash, partialAddress], DomainSeparator.
|
|
59
|
+
// 1. preaddress = poseidon2([publicKeysHash, partialAddress], DomainSeparator.CONTRACT_ADDRESS_V3);
|
|
60
60
|
// 2. addressPoint = (preaddress * G) + ivpk_m
|
|
61
61
|
// 3. address = addressPoint.x
|
|
62
62
|
const preaddress = await computePreaddress(await publicKeys.hash(), partialAddress);
|
package/src/keys/public_keys.ts
CHANGED
|
@@ -14,6 +14,7 @@ import { schemas } from '@aztec-labs/foundation/schemas';
|
|
|
14
14
|
import { BufferReader, FieldReader, serializeToBuffer } from '@aztec-labs/foundation/serialize';
|
|
15
15
|
import { bufferToHex, withoutHexPrefix } from '@aztec-labs/foundation/string';
|
|
16
16
|
import type { FieldsOf } from '@aztec-labs/foundation/types';
|
|
17
|
+
import { Buffer } from 'buffer';
|
|
17
18
|
import { z } from 'zod';
|
|
18
19
|
|
|
19
20
|
import { PublicKey, hashPublicKey } from './public_key.js';
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import { CONTRACT_CLASS_LOG_LENGTH, CONTRACT_CLASS_LOG_SIZE_IN_FIELDS } from '@aztec-labs/constants';
|
|
2
2
|
import { poseidon2Hash } from '@aztec-labs/foundation/crypto/poseidon';
|
|
3
3
|
import { Fr } from '@aztec-labs/foundation/curves/bn254';
|
|
4
|
+
import { inspect } from '@aztec-labs/foundation/inspect';
|
|
4
5
|
import { schemas } from '@aztec-labs/foundation/schemas';
|
|
5
6
|
import {
|
|
6
7
|
BufferReader,
|
|
@@ -10,7 +11,6 @@ import {
|
|
|
10
11
|
serializeToSink,
|
|
11
12
|
} from '@aztec-labs/foundation/serialize';
|
|
12
13
|
import type { FieldsOf } from '@aztec-labs/foundation/types';
|
|
13
|
-
import { inspect } from 'util';
|
|
14
14
|
import { z } from 'zod';
|
|
15
15
|
|
|
16
16
|
import { AztecAddress } from '../aztec-address/index.js';
|
package/src/logs/log_cursor.ts
CHANGED
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import { BlockNumber, BlockNumberSchema } from '@aztec-labs/foundation/branded-types';
|
|
2
2
|
import { BufferReader, numToUInt32BE } from '@aztec-labs/foundation/serialize';
|
|
3
|
+
import { Buffer } from 'buffer';
|
|
3
4
|
import { z } from 'zod';
|
|
4
5
|
|
|
5
6
|
import { schemas } from '../schemas/schemas.js';
|
package/src/logs/private_log.ts
CHANGED
|
@@ -2,6 +2,7 @@ import { PRIVATE_LOG_LENGTH, PRIVATE_LOG_SIZE_IN_FIELDS } from '@aztec-labs/cons
|
|
|
2
2
|
import { type FieldsOf, makeTuple } from '@aztec-labs/foundation/array';
|
|
3
3
|
import { padArrayEnd } from '@aztec-labs/foundation/collection';
|
|
4
4
|
import { Fr } from '@aztec-labs/foundation/curves/bn254';
|
|
5
|
+
import { inspect } from '@aztec-labs/foundation/inspect';
|
|
5
6
|
import { schemas } from '@aztec-labs/foundation/schemas';
|
|
6
7
|
import {
|
|
7
8
|
BufferReader,
|
|
@@ -11,7 +12,6 @@ import {
|
|
|
11
12
|
serializeToFields,
|
|
12
13
|
serializeToSink,
|
|
13
14
|
} from '@aztec-labs/foundation/serialize';
|
|
14
|
-
import { inspect } from 'util';
|
|
15
15
|
import { z } from 'zod';
|
|
16
16
|
|
|
17
17
|
export class PrivateLog {
|
package/src/logs/public_log.ts
CHANGED
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import { FLAT_PUBLIC_LOGS_PAYLOAD_LENGTH, PUBLIC_LOG_HEADER_LENGTH } from '@aztec-labs/constants';
|
|
2
2
|
import type { FieldsOf } from '@aztec-labs/foundation/array';
|
|
3
3
|
import { Fr } from '@aztec-labs/foundation/curves/bn254';
|
|
4
|
+
import { inspect } from '@aztec-labs/foundation/inspect';
|
|
4
5
|
import { type ZodFor, schemas } from '@aztec-labs/foundation/schemas';
|
|
5
6
|
import { BufferReader, FieldReader, serializeToBuffer } from '@aztec-labs/foundation/serialize';
|
|
6
|
-
import { inspect } from 'util';
|
|
7
7
|
import { z } from 'zod';
|
|
8
8
|
|
|
9
9
|
import { AztecAddress } from '../aztec-address/index.js';
|