Skip to content

accounting: complete user history coverage - #153

Merged
uniyalabhishek merged 2 commits into
masterfrom
uniyalabhishek/feat/accounting-history
Jun 15, 2026
Merged

accounting: complete user history coverage#153
uniyalabhishek merged 2 commits into
masterfrom
uniyalabhishek/feat/accounting-history

Conversation

@uniyalabhishek

@uniyalabhishek uniyalabhishek commented May 22, 2026

Copy link
Copy Markdown
Contributor

Fixes #149.

Completes user history coverage in Accounting directly. The delegatecall history module is unnecessary now that oasisprotocol/oasis-sdk#2471 raised Sapphire's code limit to 64 KiB.

  • HistoryKind gains ModifyLock, UnlockLock, and directional transfer kinds TransferFromLockOut/In and TransferBalanceOut/In. Nothing durable is deployed, so it is renumbered cleanly with no legacy decode path.
  • transferFromLock/transferBalance write one 84-byte tokenId|amount|counterparty row per participant. The sender's Out row carries the recipient, the recipient's In row the sender. The In row is skipped for zero-address and self transfers.
  • modifyLock records the locked-amount delta (0 for expiry-only changes). Single and batch unlocks record one UnlockLock per lock.
  • Backend decodes every non-deposit kind through one 84-byte path, dropping from_address/to_address since direction now lives in the kind. Unrecognized kinds degrade to unknown.
  • Accounting is 27,024 bytes, over EIP-170 but well under the 64 KiB limit now live on Sapphire Testnet 1.3.0-testnet.
  • Emergency withdrawals still write no history (possible follow-up if needed).

@uniyalabhishek
uniyalabhishek marked this pull request as ready for review May 22, 2026 20:59
Comment thread solidity/contracts/Accounting.sol Outdated
Comment thread solidity/contracts/Accounting.sol Outdated
Comment thread solidity/contracts/Accounting.sol Outdated
Comment thread solidity/contracts/AccountingHistoryModule.sol Outdated
Comment thread solidity/contracts/AccountingHistory.sol Outdated
@uniyalabhishek uniyalabhishek changed the title accounting: add sidecar history tracking accounting: add delegatecall history module May 26, 2026
@uniyalabhishek
uniyalabhishek requested a review from matevz May 26, 2026 09:42
Comment thread solidity/contracts/Accounting.sol Outdated
Comment thread solidity/contracts/Accounting.sol Outdated
@uniyalabhishek
uniyalabhishek requested a review from matevz May 26, 2026 12:11
@uniyalabhishek
uniyalabhishek force-pushed the uniyalabhishek/feat/accounting-history branch 2 times, most recently from 2d6a467 to 662a649 Compare June 1, 2026 08:24
@uniyalabhishek
uniyalabhishek force-pushed the uniyalabhishek/feat/accounting-history branch from 662a649 to 7fc8dc5 Compare June 11, 2026 07:55
@uniyalabhishek
uniyalabhishek marked this pull request as draft June 11, 2026 08:01
@uniyalabhishek
uniyalabhishek force-pushed the uniyalabhishek/feat/accounting-history branch from 7fc8dc5 to 05e7402 Compare June 11, 2026 09:50
@uniyalabhishek uniyalabhishek changed the title accounting: add delegatecall history module accounting: record modifyLock, unlock, and paired transfer history Jun 11, 2026
@uniyalabhishek uniyalabhishek changed the title accounting: record modifyLock, unlock, and paired transfer history accounting: complete user history coverage Jun 11, 2026
@uniyalabhishek

Copy link
Copy Markdown
Contributor Author

Rebuilt from scratch on master, see the updated description.

@uniyalabhishek
uniyalabhishek force-pushed the uniyalabhishek/feat/accounting-history branch from 05e7402 to 93531de Compare June 11, 2026 13:59
@uniyalabhishek
uniyalabhishek marked this pull request as ready for review June 11, 2026 13:59
@uniyalabhishek
uniyalabhishek force-pushed the uniyalabhishek/feat/accounting-history branch from 93531de to 79a9cd5 Compare June 11, 2026 19:12

@matevz matevz left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

I suggest some further simplifications.

Comment thread solidity/contracts/Accounting.sol Outdated
Comment thread solidity/contracts/test/MockAccountingHelper.sol Outdated
Comment thread solidity/contracts/test/MockAccountingPrevious.sol Outdated
@uniyalabhishek
uniyalabhishek force-pushed the uniyalabhishek/feat/accounting-history branch from fb47f13 to 9b7367d Compare June 15, 2026 07:59
@uniyalabhishek
uniyalabhishek requested a review from matevz June 15, 2026 08:02

@matevz matevz left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Looks good, thanks!

@uniyalabhishek
uniyalabhishek merged commit 548d624 into master Jun 15, 2026
3 checks passed
@uniyalabhishek
uniyalabhishek deleted the uniyalabhishek/feat/accounting-history branch June 15, 2026 08:19
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.

A few functions move user funds without recording history

2 participants