Skip to content

Conversation

dannywillems
Copy link
Member

No description provided.

@dannywillems dannywillems force-pushed the dw/split-transaction-logic branch from 8120467 to 1fc3d39 Compare October 7, 2025 15:56
@dannywillems dannywillems changed the base branch from develop to dw/zkapp-command-example October 7, 2025 16:04
@dannywillems dannywillems force-pushed the dw/split-transaction-logic branch 3 times, most recently from b8f4c54 to 44341d9 Compare October 7, 2025 16:06
@dannywillems dannywillems force-pushed the dw/zkapp-command-example branch from 0409598 to f0a9746 Compare October 7, 2025 16:16
@dannywillems dannywillems force-pushed the dw/split-transaction-logic branch from 44341d9 to 55e674c Compare October 7, 2025 16:20
Copy link

github-actions bot commented Oct 7, 2025

⚠️ Code Reference Verification Failed

The documentation contains code references that do not match the current state of the codebase on the develop branch.

Issues Found

  • website/docs/developers/documentation-guidelines.md:38 - File not found: ledger/src/scan_state/transaction_logic.rs

Action Required

The code referenced in the documentation must be merged to develop before documentation can be added/modified.

Please follow this workflow:

  1. Merge the code changes to develop first (this PR or a separate code PR)
  2. Create a follow-up PR with the documentation updates that reference the merged code
  3. The verification will pass once the code is available on develop

See the documentation guidelines for more information about the two-PR workflow.

@dannywillems dannywillems changed the base branch from dw/zkapp-command-example to develop October 7, 2025 19:21
@dannywillems dannywillems force-pushed the dw/split-transaction-logic branch 2 times, most recently from ef6193b to 2302910 Compare October 7, 2025 19:56
@dannywillems dannywillems requested a review from 0xMimir October 7, 2025 19:56
@dannywillems dannywillems moved this to Done in Rust node Oct 7, 2025
@dannywillems dannywillems self-assigned this Oct 7, 2025
Convert transaction_logic.rs into a directory with mod.rs and extract
the valid module into valid.rs. This is the first step in splitting the
large transaction_logic module into smaller, more manageable files.

Changes:
- Rename transaction_logic.rs to transaction_logic/mod.rs
- Extract valid module to transaction_logic/valid.rs
- Use explicit imports in valid.rs instead of 'use super::*'
Extract the signed_command module from transaction_logic/mod.rs into its
own file. This module contains signed command types including payment and
stake delegation.

Changes:
- Extract signed_command module to transaction_logic/signed_command.rs
- Use explicit imports instead of 'use super::*'
- Update mod.rs to reference the new module file
Extract the zkapp_command module from transaction_logic/mod.rs into its
own file. This is a large module (~3300 lines) containing zkApp command
types, account updates, events, actions, and verification logic.

Changes:
- Extract zkapp_command module to transaction_logic/zkapp_command.rs
- Use explicit imports instead of 'use super::*'
- Add required trait imports (Zero, Magnitude, Itertools, AppendToInputs)
- Update mod.rs to reference the new module file
…file

Extract the zkapp_statement module from transaction_logic/mod.rs into its
own file. This module contains the TransactionCommitment and ZkappStatement
types used for zkApp transaction commitments.

Changes:
- Extract zkapp_statement module to transaction_logic/zkapp_statement.rs
- Use explicit imports instead of 'use super::*'
- Import zkapp_command module as 'self' to access AccountUpdateRef trait
- Update mod.rs to reference the new module file
Extract the verifiable module from transaction_logic/mod.rs into its own
file. This module contains the verifiable UserCommand enum (with serde
traits) and signature verification functions.

Changes:
- Extract verifiable module to transaction_logic/verifiable.rs
- Use explicit imports instead of 'use super::*'
- Update mod.rs to reference the new module file
…ate file

Extract the transaction_applied module from transaction_logic/mod.rs into
its own file. This module contains types for applied transactions including
SignedCommandApplied, ZkappCommandApplied, FeeTransferApplied, and
CoinbaseApplied.

Changes:
- Extract transaction_applied module to transaction_logic/transaction_applied.rs
- Use explicit imports instead of 'use super::*'
- Add Magnitude trait import for Amount::zero() method
- Update mod.rs to reference the new module file
…ate file

Extract the transaction_witness module from transaction_logic/mod.rs into
its own file. This is a small module containing only the TransactionWitness
struct used for transaction proofs.

Changes:
- Extract transaction_witness module to transaction_logic/transaction_witness.rs
- Use explicit imports instead of 'use super::*'
- Update mod.rs to reference the new module file
Extract the protocol_state module from transaction_logic/mod.rs into its
own file. This module contains protocol state types including
ProtocolStateView, EpochData, EpochLedger, and GlobalState.

Changes:
- Extract protocol_state module to transaction_logic/protocol_state.rs
- Use explicit imports instead of 'use super::*'
- Update mod.rs to reference the new module file
file

Split the large transaction_logic.rs file by extracting the
local_state module (947 lines) into its own file at
ledger/src/scan_state/transaction_logic/local_state.rs.

Changes:
- Created local_state.rs with StackFrame, CallStack, LocalState,
  LocalStateEnv types and zkApp command application functions
- Made apply_zkapp_command_first_pass and
  apply_zkapp_command_second_pass public
- Added module declaration in mod.rs
- Updated import paths in sparse_ledger.rs
- Added all necessary imports (ark_ff::Zero, itertools, BTreeMap,
  AccountIdOrderable, AppendToInputs, zkapps, etc.)
- Removed unused imports from mod.rs (ark_ff::Zero, Itertools)
- Fixed ambiguous Index::zero() call to use IndexInterface::zero()
module to separate file

Split the large transaction_logic.rs file by extracting the
transaction_partially_applied module (1076 lines) into its own file
at ledger/src/scan_state/transaction_logic/transaction_partially_applied.rs.

Changes:
- Created transaction_partially_applied.rs with
  ZkappCommandPartiallyApplied, TransactionPartiallyApplied, and
  FullyApplied types
- Includes apply_transaction_first_pass/second_pass and
  apply_transactions functions
- Includes apply_coinbase, apply_fee_transfer, apply_user_command and
  related helper functions
- Added module declaration and re-exports in mod.rs for
  apply_transaction_first_pass, apply_transaction_second_pass,
  apply_transactions, apply_user_command, set_with_location, and
  AccountState
- Removed self-import statement and extra closing brace from
  extracted file
to separate file

Split the large transaction_logic.rs file by extracting the
transaction_union_payload module (679 lines) into its own file at
ledger/src/scan_state/transaction_logic/transaction_union_payload.rs.

Changes:
- Created transaction_union_payload.rs with TransactionUnionPayload,
  TransactionUnion, Common, Body, Tag types
- Includes timing validation functions (validate_timing,
  validate_nonces, account_check_timing,
  timing_error_to_user_command_status)
- Includes receipt chain hash functions (cons_signed_command_payload,
  checked_cons_signed_command_payload, cons_zkapp_command_commitment)
- Includes helper functions (add_amount, sub_amount,
  get_with_location, set_account, get_account)
- Includes ExistingOrNew and TimingValidation types
- Made helper functions public for use in transaction_partially_applied
- Added module declaration and re-exports in mod.rs for all public
  items
- Added explicit imports including OneOrTwo from
  scan_state::scan_state::transaction_snark
- Removed dangling cfg attribute at end of file
- Added cfg attribute to for_tests module declaration
- Removed duplicate TransactionUnionPayload import from self block
Moved the transaction_logic tests module from
scan_state/transaction_logic/mod.rs (104 lines) to a new integration test
file at ledger/tests/transaction_logic_tests.rs.

Changes:
- Removed inline tests module from mod.rs
- Created transaction_logic_tests.rs in tests directory
- Updated imports to work from integration test context
- All 3 tests pass: test_hash_empty_event, test_cons_receipt_hash_ocaml,
  test_receipt_hash_update
@dannywillems dannywillems force-pushed the dw/split-transaction-logic branch from cb0f89b to 1bedb9e Compare October 7, 2025 20:22
Copy link
Contributor

@0xMimir 0xMimir left a comment

Choose a reason for hiding this comment

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

LGTM

@dannywillems dannywillems merged commit 1f0bacc into develop Oct 9, 2025
60 of 61 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Status: Done
Development

Successfully merging this pull request may close these issues.

2 participants