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

Module cache followup #1375

Merged
merged 19 commits into from
Apr 2, 2024
Merged

Module cache followup #1375

merged 19 commits into from
Apr 2, 2024

Conversation

graydon
Copy link
Contributor

@graydon graydon commented Mar 28, 2024

This is a set of followups to #1359 to cover missing testing and wiring around the module cache. It includes calibration of the VmCachedInstantiation cost type, a shift to using a single shared linker when using a module cache (this turns out to be critical -- the existing code deadlocks on cross-contract calls) and some fairly subtle wiring to patch up costs in recording mode, along with some tests to check that it's mostly working.

Several tests remain broken with --feature=next, so I wouldn't say it's quite ready yet. I tried, but am out of time for tonight.

@graydon graydon requested review from sisuresh and dmkozh as code owners March 28, 2024 06:08
soroban-env-host/src/test/e2e_tests.rs Outdated Show resolved Hide resolved
soroban-env-host/src/e2e_invoke.rs Outdated Show resolved Hide resolved
@graydon graydon force-pushed the module-cache-followup branch from deedd1e to bdbd053 Compare March 28, 2024 19:25
@graydon graydon requested a review from a team as a code owner March 29, 2024 05:31
@graydon graydon force-pushed the module-cache-followup branch 3 times, most recently from 3f3c80b to 6a4db8c Compare March 29, 2024 06:44
@graydon graydon force-pushed the module-cache-followup branch from 6a4db8c to bcd4546 Compare March 29, 2024 07:38
soroban-env-host/src/test/lifecycle.rs Show resolved Hide resolved
soroban-env-host/src/vm.rs Show resolved Hide resolved
soroban-env-host/src/vm.rs Outdated Show resolved Hide resolved
dmkozh
dmkozh previously approved these changes Apr 2, 2024
@dmkozh dmkozh dismissed their stale review April 2, 2024 18:50

There is seemingly one more deadlock that has to be fixed before merging this

@dmkozh
Copy link
Contributor

dmkozh commented Apr 2, 2024

There is seemingly one more deadlock that has to be fixed before merging this

I've actually accidentally picked up the old revision of this PR. I've double-checked that in the current state it doesn't deadlock. Sorry for confusion.

@graydon graydon enabled auto-merge April 2, 2024 21:52
@graydon graydon added this pull request to the merge queue Apr 2, 2024
Merged via the queue into main with commit a1cb3fd Apr 2, 2024
13 checks passed
@graydon graydon deleted the module-cache-followup branch April 2, 2024 22:31
github-merge-queue bot pushed a commit that referenced this pull request Apr 4, 2024
This covers a two cases I failed to cover in #1375 that @dmkozh and
@sisuresh have identified:

- User calls contract without putting wasm for call in footprint or
storage
- User calls `upload_contract` (or its equivalent,
`update_current_contract_wasm`) mid-execution and then calls the
updated-or-new contract

As well as a third case that is, as far as I know, not possible; but it
seems to me it doesn't hurt to be defensive since someone could make it
possible in the future fairly easily and forget to cover this case in
the cache code:

  - User deletes wasm in transaction, and then tries to call it.

As always, there is probably room for a bit more testing here, but I
wanted to get these cases covered and fixed asap.

This should make-redundant PR #1380
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.

3 participants