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

Cache not found keys #2744

Merged
merged 6 commits into from
May 21, 2022
Merged

Cache not found keys #2744

merged 6 commits into from
May 21, 2022

Conversation

erikzhang
Copy link
Member

Fix #2720

@roman-khimov
Copy link
Contributor

Does it really solve #2720? One can just use random unique hash/group in each rule entry.

@erikzhang
Copy link
Member Author

One can just use random unique hash/group in each rule entry.

But we only search for the ExecutingScriptHash and CallingScriptHash.

@@ -95,6 +95,7 @@ public void Add(StorageKey key, StorageItem value)
{
TrackState.Deleted => TrackState.Changed,
TrackState.NotFound => TrackState.Added,
TrackState.Added => TrackState.Added,
Copy link
Member Author

@erikzhang erikzhang May 20, 2022

Choose a reason for hiding this comment

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

It is incorrect. If the state is Added, we should throw. Because Add requires the key doesn't exist.

Copy link
Member

@shargon shargon May 20, 2022

Choose a reason for hiding this comment

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

But if someone use add twice? what's the sense of throw an exception, if it could be added?

@erikzhang erikzhang merged commit e7cc1fd into master May 21, 2022
@erikzhang erikzhang deleted the cache-notfound branch May 21, 2022 01:02
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.

GAS price for CheckWitness is too cheap: cost 13 mins with 20GAS
3 participants