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

XS fxGrowKeys should delegate to a new fxAllocateKeys, track with a meter #7509

Open
warner opened this issue Apr 25, 2023 · 0 comments
Open
Labels
enhancement New feature or request metering charging for execution (was: package: tame-metering and transform-metering) vaults_triage DO NOT USE xsnap the XS execution tool

Comments

@warner
Copy link
Member

warner commented Apr 25, 2023

What is the Problem Being Solved?

Per agoric-labs/moddable#9 (comment) :

fxGrowSlots uses c_realloc() directly, unlike slots/chunks which go through an intermediate fxAllocateChunks/fxAllocateSlots, which xsnapPlatform.c overrides to track in the space meter. So the space used by keys won't be tracked.

This keyArray wants to use re-alloc, which is not quite as easy to wrap/track. But when we start trying to meter space allocation in earnest, we should consider creating an fxReallocKeys(), which can be controlled by the platform, and which can compare the old size (i.e. it can somehow learn the old size, maybe it should accept a third arg with the old size, maybe the->keyCount?) and new size, and apply the difference to the meter.

Description of the Design

Security Considerations

Scaling Considerations

Test Plan

@warner warner added enhancement New feature or request metering charging for execution (was: package: tame-metering and transform-metering) xsnap the XS execution tool labels Apr 25, 2023
@ivanlei ivanlei added the vaults_triage DO NOT USE label Apr 27, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request metering charging for execution (was: package: tame-metering and transform-metering) vaults_triage DO NOT USE xsnap the XS execution tool
Projects
None yet
Development

No branches or pull requests

2 participants