-
Notifications
You must be signed in to change notification settings - Fork 976
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
fix iter prefix #913
Merged
Merged
fix iter prefix #913
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
tzemanovic
force-pushed
the
tomas+brent/fix-iter-prefix
branch
4 times, most recently
from
December 28, 2022 16:15
8575db6
to
e4838e2
Compare
tzemanovic
force-pushed
the
tomas+brent/fix-iter-prefix
branch
3 times, most recently
from
January 12, 2023 10:10
ab33c84
to
df2be3a
Compare
pls update wasm |
tzemanovic
added a commit
that referenced
this pull request
Jan 12, 2023
Merged
brentstone
pushed a commit
that referenced
this pull request
Jan 23, 2023
brentstone
force-pushed
the
tomas+brent/fix-iter-prefix
branch
from
January 23, 2023 07:28
76ec13e
to
4319e46
Compare
brentstone
previously approved these changes
Jan 23, 2023
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
brentstone
pushed a commit
that referenced
this pull request
Jan 30, 2023
brentstone
pushed a commit
that referenced
this pull request
Jan 30, 2023
The expected keys previously omitted a newly written value, because iter prefix wasn't able to find it
To use storage_api, use WlStorage instead
tzemanovic
force-pushed
the
tomas+brent/fix-iter-prefix
branch
from
February 1, 2023 17:46
4319e46
to
1bcfb71
Compare
pls update wasm |
juped
added a commit
that referenced
this pull request
Feb 10, 2023
* tomas+brent/fix-iter-prefix: [ci] wasm checksums update changelog: add #913 fix documentation fix IBC VP tests tests: update tests to use WlStorage use storage PrefixIter instead of DB iterator that respects write log use WlStorage in Shell and in queries RequestCtx core: remove storage_api StorageRead and StorageWrite from Storage make -C wasm_for_tests/wasm_source vp_host_fns: fix has_key_pre to see keys from prev txs (not yet in DB) test/vm_host_env: fix expected keys in VP iter prefix storage: extend iter_prefix test storage: rename `fn commit` to `commit_block` write_log: allow to commit genesis txs write_log: add prefix iter shared: Add WlStorage, combining WriteLog with Storage move write_log core/storage: add a warning to `iter_prefix`
bengtlofgren
pushed a commit
that referenced
this pull request
May 11, 2023
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
fixes #165
based on v0.13.3
We're adding
WlStorage
(combined WriteLog and Storage) to be able to fix the prefix iter function to match uncommitted changes. This directly replaceswrite_log
andstorage
in theShell
(butwrite_log
andstorage
can still be accessed directly inside it) and in the queriesRequestCtx
.With this, the
Storage
type no longer implementsstorage_api
StorageRead
andStorageWrite
traits, because it's not possible to have fully working iter prefix on it and instead these are implemented onWlStorage
. This is reflected in tests that were usingTestStorage
, now withTestWlStorage
.We attempted to re-use the
WlStorage
in multiple ways for host env that ended up in untypable lifetimes dead ends. In the end, we're just re-using theprefix_iter
provided by the newwl_storage
module, which is not as nice, but it works and is simpler with gas handling, which is needed in host env, but not in the shell. TheStorageRead/Write
inWlStorage
ignores any gas as that's for non-tx logic which doesn't count it and theStorageRead/Write
in the tx and VPs account the gas automatically in the host env function calls.There was also an issue in
has_key_pre
VpEnv method, which was potentially missing keys written by previous txs in the same block, discovered in another test. This is fixed in b8f8d39.