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

test(boot): Fast USDC chain impact #10931

Draft
wants to merge 53 commits into
base: master
Choose a base branch
from
Draft

test(boot): Fast USDC chain impact #10931

wants to merge 53 commits into from

Conversation

dckc
Copy link
Member

@dckc dckc commented Feb 3, 2025

refs:

Description / Scaling / Testing Considerations

Demonstrate that impact on the chain is sustainable:

  • vm integration test with a repeated iteration. In each iteration:
    • lp deposit
    • advance (oracle submit x3, IBC ack)
    • settle (IBC hook)
    • lp withdraw
  • Capture metrics for each iteration (details in comments below)
  • fix some seat leaks in the contract: moving to fix(fast-usdc): .exit() all internal temporary seats #10939
  • fix a couple leaks in test harnesses

Security / Documentation Considerations

not much.

Upgrade Considerations

preparation for deployment.
not yet deployed.

Copy link

cloudflare-workers-and-pages bot commented Feb 3, 2025

Deploying agoric-sdk with  Cloudflare Pages  Cloudflare Pages

Latest commit: 73461e1
Status: ✅  Deploy successful!
Preview URL: https://7d31b522.agoric-sdk.pages.dev
Branch Preview URL: https://dc-fu-impact.agoric-sdk.pages.dev

View logs

mergify bot pushed a commit that referenced this pull request Feb 4, 2025
refs: #10890
refs: #10931

## Description
Add a driver to update the block height in fake vstorage cells.

Add test of `sequence: false` based deletion.

### Security Considerations
None

### Scaling Considerations
None

### Documentation Considerations
Internal test hooks

### Testing Considerations
Updated unit tests of fake storage

### Upgrade Considerations
None
@dckc dckc force-pushed the dc-fu-impact branch 2 times, most recently from a137519 to dd649ce Compare February 4, 2025 18:09
@dckc
Copy link
Member Author

dckc commented Feb 4, 2025

I looked at the output using a jupyter notebook.
Exported source: fu-fun.py

VStorage: ~Flat (64 iterations)

image

lin(impact.vstorageTotalSize[13:])
intercept slope
169303.86892 14.858679

Exported objects: ~Flat

image

lin(impact.kernelObjects[20:])
intercept slope
596.86039 0.108578
lin(impact.clistEntries[20:])
intercept slope
1908.711039 0.227136

@dckc
Copy link
Member Author

dckc commented Feb 5, 2025

Heap Sizes: ~Flat

image

That's the 25 largest vats, excluding vat1, which is so large it's an outlier:

image

32 iterations, reaping every 4th.

@dckc
Copy link
Member Author

dckc commented Feb 5, 2025

Computrons: ~Flat

image

def unitize(s):
    return s / s.max()

lin(unitize(impact1.computrons.dropna())[10:])
intercept slope
0.902157 0.000069

Note: techniques for measuring this were drawn from...

@dckc
Copy link
Member Author

dckc commented Feb 6, 2025

Heap Size: investigating some growth

  • v35 = smartWallet
  • v41 = fastUsdc

image

p.s. escalated to a separate issue: #10955

@dckc dckc force-pushed the dc-fu-impact branch 5 times, most recently from 54aba99 to 5eae563 Compare February 6, 2025 22:28
@dckc
Copy link
Member Author

dckc commented Feb 7, 2025

Diagnosing kernel metric leaks: some in test harness, some in contract

Initial measurements showed neither kernelObjects nor kernelPromises were flat:

image

We diagnosed kernelPromises as a test harness problem:

For kernelObjects, we spot-checked individual objects, grabbing their kref and looking for it in a .slog file. The first deliveries where these objects were found had methods such as makeNoEscrowSeat:

{"type":"syscall","crankNum":381,"vatID":"v12","deliveryNum":4,"syscallNum":115,"replay":false,"ksc":["send","ko107",{"methargs":{"body":"#[\"makeNoEscrowSeat\",[{},{\"exit\":{\"onDemand\":null},\"give\":{},\"want\":{}},\"$0.Alleged: ExitObject\",\"$1.Alleged: SeatHandle\"]]","slots":["ko110","ko111"]},"result":"kp134"}],"vsc":["send","o-52",{"methargs":{"body":"#[\"makeNoEscrowSeat\",[{},{\"exit\":{\"onDemand\":null},\"give\":{},\"want\":{}},\"$0.Alleged: ExitObject\",\"$1.Alleged: SeatHandle\"]]","slots":["o+d11/1","o+d10/1"]},"result":"p+7"}],"time":1738634347.628174,"monotime":13.78046653}

Some searching for makeNoEscrowSeat reminded me that the contract makes some temporary seats with makeEmptySeatKit(), and if we don't .exit() such seats, they leak.

@dckc
Copy link
Member Author

dckc commented Feb 7, 2025

Diagnosing VStorage Growth: test harness limitation

Initial measurements of vstorage were nowhere near flat either:

image

We diagnosed this as a limitation of the storage mock:

mergify bot added a commit that referenced this pull request Feb 7, 2025
closes #10890

refs:
  - #10931

## Description

mainly:

 - fix: .exit() all internal temporary seats

Also, to exercise pruning vstorage:

 - feat: core eval script to deleteCompletedTxs
    - expose deleteCompletedTx via creatorFacet

To speed up testing and match it with expected deployment:

 - chore: don't write-chain-info when testing Fast USDC

Plus a misc type refinement:
 
 - chore: refine return type of Offers.deposit


### Security / Scaling Considerations

Reducing leaks improves scalability which improves availability.

### Documentation Considerations

I don't think so.

### Testing Considerations

Tests are in #10931 ; they're somewhat rough and not included in this PR.

### Upgrade Considerations

Some undiagnosed heap growth remains. A fix for that might go out in a future upgrade.
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