Skip to content

Oracle midblock#464

Merged
udpatil merged 4 commits intomasterfrom
oracle-midblock
Dec 22, 2022
Merged

Oracle midblock#464
udpatil merged 4 commits intomasterfrom
oracle-midblock

Conversation

@udpatil
Copy link
Collaborator

@udpatil udpatil commented Dec 22, 2022

Describe your changes and provide context

Perform oracle consensus logic in Midblock instead of endblock

Testing performed to validate your change

Refactored the tests to call midblock instead of endblock

@github-actions
Copy link

Code Coverage

Package Line Rate Complexity Health
github.com/sei-protocol/sei-chain/aclmapping/bank 100% 0
github.com/sei-protocol/sei-chain/aclmapping/dex 97% 0
github.com/sei-protocol/sei-chain/aclmapping/oracle 100% 0
github.com/sei-protocol/sei-chain/aclmapping/staking 82% 0
github.com/sei-protocol/sei-chain/aclmapping/tokenfactory 96% 0
github.com/sei-protocol/sei-chain/aclmapping/utils 0% 0
github.com/sei-protocol/sei-chain/aclmapping/wasm 83% 0
github.com/sei-protocol/sei-chain/app 59% 0
github.com/sei-protocol/sei-chain/app/antedecorators 74% 0
github.com/sei-protocol/sei-chain/oracle/price-feeder/config 85% 0
github.com/sei-protocol/sei-chain/oracle/price-feeder/oracle 73% 0
github.com/sei-protocol/sei-chain/oracle/price-feeder/oracle/provider 48% 0
github.com/sei-protocol/sei-chain/oracle/price-feeder/router/v1 45% 0
github.com/sei-protocol/sei-chain/store/whitelist/cachemulti 100% 0
github.com/sei-protocol/sei-chain/store/whitelist/kv 100% 0
github.com/sei-protocol/sei-chain/store/whitelist/multi 100% 0
github.com/sei-protocol/sei-chain/utils 46% 0
github.com/sei-protocol/sei-chain/utils/datastructures 90% 0
github.com/sei-protocol/sei-chain/x/dex 59% 0
github.com/sei-protocol/sei-chain/x/dex/cache 86% 0
github.com/sei-protocol/sei-chain/x/dex/client/cli/query 23% 0
github.com/sei-protocol/sei-chain/x/dex/contract 52% 0
github.com/sei-protocol/sei-chain/x/dex/exchange 89% 0
github.com/sei-protocol/sei-chain/x/dex/keeper 61% 0
github.com/sei-protocol/sei-chain/x/dex/keeper/abci 30% 0
github.com/sei-protocol/sei-chain/x/dex/keeper/msgserver 78% 0
github.com/sei-protocol/sei-chain/x/dex/keeper/query 82% 0
github.com/sei-protocol/sei-chain/x/dex/migrations 85% 0
github.com/sei-protocol/sei-chain/x/dex/types 1% 0
github.com/sei-protocol/sei-chain/x/dex/types/utils 100% 0
github.com/sei-protocol/sei-chain/x/dex/types/wasm 83% 0
github.com/sei-protocol/sei-chain/x/epoch 11% 0
github.com/sei-protocol/sei-chain/x/epoch/keeper 66% 0
github.com/sei-protocol/sei-chain/x/epoch/types 2% 0
github.com/sei-protocol/sei-chain/x/mint 0% 0
github.com/sei-protocol/sei-chain/x/mint/keeper 75% 0
github.com/sei-protocol/sei-chain/x/mint/simulation 95% 0
github.com/sei-protocol/sei-chain/x/mint/types 2% 0
github.com/sei-protocol/sei-chain/x/nitro/client/cli 45% 0
github.com/sei-protocol/sei-chain/x/nitro/keeper 80% 0
github.com/sei-protocol/sei-chain/x/nitro/replay 63% 0
github.com/sei-protocol/sei-chain/x/oracle 64% 0
github.com/sei-protocol/sei-chain/x/oracle/keeper 82% 0
github.com/sei-protocol/sei-chain/x/oracle/simulation 18% 0
github.com/sei-protocol/sei-chain/x/oracle/types 3% 0
github.com/sei-protocol/sei-chain/x/tokenfactory/keeper 85% 0
github.com/sei-protocol/sei-chain/x/tokenfactory/types 2% 0
Summary 15% (4988 / 33883) 0

@udpatil udpatil merged commit dbb33d4 into master Dec 22, 2022
@udpatil udpatil deleted the oracle-midblock branch December 22, 2022 16:52
masih pushed a commit that referenced this pull request Sep 29, 2025
…y deleted (#464)

## Describe your changes and provide context
If we have a cacheKV that has a dirty cache of 1->a and a parent with an
entry 2->b, the previous implementation of `DeleteAll` would only call
cacheKV.Delete on key 1 but not affecting 2 at all (i.e. if someone
queries key 2 on the cacheKV they would still get `b`, but the
expectation is for 2 to be deleted as appearing on the cacheKV level).
This PR fixes that by first getting all the keys to be (marked as)
deleted recursively and then delete all those keys one-by-one; note that
this recursion should be fairly efficient since it's not subject to the
exponential latency that merge iterators have.

This PR also fixed DeleteAll for `mvkv` so that it doesn't actually
touch parent store's value but only change the writeset (as a single
`Delete` would have done).

## Testing performed to validate your change
unit test
masih pushed a commit that referenced this pull request Sep 30, 2025
…y deleted (#464)

## Describe your changes and provide context
If we have a cacheKV that has a dirty cache of 1->a and a parent with an
entry 2->b, the previous implementation of `DeleteAll` would only call
cacheKV.Delete on key 1 but not affecting 2 at all (i.e. if someone
queries key 2 on the cacheKV they would still get `b`, but the
expectation is for 2 to be deleted as appearing on the cacheKV level).
This PR fixes that by first getting all the keys to be (marked as)
deleted recursively and then delete all those keys one-by-one; note that
this recursion should be fairly efficient since it's not subject to the
exponential latency that merge iterators have.

This PR also fixed DeleteAll for `mvkv` so that it doesn't actually
touch parent store's value but only change the writeset (as a single
`Delete` would have done).

## Testing performed to validate your change
unit test
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.

2 participants