-
Notifications
You must be signed in to change notification settings - Fork 68
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
[OCC] change incarnation metric type #433
base: occ-main
Are you sure you want to change the base?
Commits on Jan 31, 2024
-
Add occ todos / comments (#317)
This adds some comments with some useful code pointers for existing logic and discussing future OCC work NA
Configuration menu - View commit details
-
Copy full SHA for 1923a47 - Browse repository at this point
Copy the full SHA 1923a47View commit details -
Multiversion Item Implementation and Tests (#318)
## Describe your changes and provide context Add multiversion store data structures file, and implement the multiversioned item ## Testing performed to validate your change Added unit tests to verify behavior
Configuration menu - View commit details
-
Copy full SHA for 5ad76e0 - Browse repository at this point
Copy the full SHA 5ad76e0View commit details -
[occ] Add incarnation field (#321)
## Describe your changes and provide context This adds the incarnation field to the multiversion item data structure. ## Testing performed to validate your change updated unit tests
Configuration menu - View commit details
-
Copy full SHA for 5e5b4ce - Browse repository at this point
Copy the full SHA 5e5b4ceView commit details -
[occ] Implement basic multiversion store (#322)
## Describe your changes and provide context This implements the multiversion with basic functionality, but still needs additional work to implement the iterator functionality and/or persisting readsets for validation ## Testing performed to validate your change Added unit tests for basic multiversion store
Configuration menu - View commit details
-
Copy full SHA for cda8c31 - Browse repository at this point
Copy the full SHA cda8c31View commit details -
[occ] Add concurrency worker configuration (#324)
## Describe your changes and provide context - `ConcurrencyWorkers` represents the number of workers to use for concurrent transactions - since concurrrency-workers is a baseapp-level setting, implementations (like sei-chain) shouldn't have to pass it (but can) - it defaults to 10 if not set (via cli default value) - it defaults to 10 in app.toml only if that file is being created (and doesn't exist) - if explicitly set to zero on command line, it will override with the default (for safety) - cli takes precedence over the config file - no one has to do anything to get it to be 10 (no config changes no sei-chain changes required (aside from new cosmos version)) ## Testing performed to validate your change - Unit Tests for setting the value - Manually testing scenarios with sei-chain
Configuration menu - View commit details
-
Copy full SHA for 703b28a - Browse repository at this point
Copy the full SHA 703b28aView commit details -
[occ] Occ multiversion store (#326)
## Describe your changes and provide context This adds in functionality to write the latest multiversion values to another store (to be used for writing to parent after transaction execution), and also adds in helpers for writeset management such as setting, invalidating, and setting estimated writesets. ## Testing performed to validate your change Unit testing for added functionality
Configuration menu - View commit details
-
Copy full SHA for 1e60246 - Browse repository at this point
Copy the full SHA 1e60246View commit details -
[occ] Add batch tx delivery interface (#327)
## Describe your changes and provide context - `sei-cosmos` will receive a list of transactions, so that sei-chain does not need to hold the logic for OCC - This will make the logic easier to test, as sei-cosmos will be fairly self-contained - Types can be extended within a tx and within request/response Example interaction: <img src="https://github.com/sei-protocol/sei-cosmos/assets/6051744/58c9a263-7bc6-4ede-83ab-5e34794510b1" width=50% height=50%> ## Testing performed to validate your change - This is a skeleton for a batch interface
Configuration menu - View commit details
-
Copy full SHA for a3aec8a - Browse repository at this point
Copy the full SHA a3aec8aView commit details -
[occ] MVKV store implementation and tests (#323)
## Describe your changes and provide context This implements an mvkv store that will manage access from a transaction execution to the underlying multiversion store and underlying parent store if the multiversion store doesn't have that key. It will first serve any reads from its own writeset and readset, but if it does have to fall through to multiversion store or parent store, it will add those values to the readset. ## Testing performed to validate your change Unit tests
Configuration menu - View commit details
-
Copy full SHA for 0520ced - Browse repository at this point
Copy the full SHA 0520cedView commit details -
[occ] Add validation function for transaction state to multiversionst…
…ore (#330) ## Describe your changes and provide context This adds in validation for transaction state to multiversion store, and implements readset validation for it as well. ## Testing performed to validate your change Unit Test
Configuration menu - View commit details
-
Copy full SHA for 0864c32 - Browse repository at this point
Copy the full SHA 0864c32View commit details -
[occ] Add basic worker task and scheduler shell (#328)
## Describe your changes and provide context - Adds a basic scheduler shell (see TODOs) - Adds a basic task definition with request/response/index - Listens to abort channel after an execution to determine conflict ## Testing performed to validate your change - Compiles (holding off until shape is validated) - Basic Unit Test for ProcessAll
Configuration menu - View commit details
-
Copy full SHA for de92cbc - Browse repository at this point
Copy the full SHA de92cbcView commit details -
[occ] Implement iterator for mvkv (#329)
## Describe your changes and provide context This implements Iterator and ReverseIterator for mvkv for the KVStore interface. The memiterator will be composed of versionindexedstore and multiversionstore, and will yield values in a cascading fashion firstly from the writeset, and then second from the multiversion store. This still needs optimization to persisted sorted keys instead of reconstructing sorted keys each time. ## Testing performed to validate your change Unit test to verify basic functionality
Configuration menu - View commit details
-
Copy full SHA for 6406dd9 - Browse repository at this point
Copy the full SHA 6406dd9View commit details -
## Describe your changes and provide context This fixes a dependency that was refactored, and enables commit push CI for occ-main ## Testing performed to validate your change CI
Configuration menu - View commit details
-
Copy full SHA for f6b0b9f - Browse repository at this point
Copy the full SHA f6b0b9fView commit details -
[occ] Iterateset tracking and validation implementation (#337)
## Describe your changes and provide context This implements a tracked iterator that is used to keep track of keys that have been iterated, and to also save metadata about the iteration for LATER validation. The iterator will be replayed and if there are any new keys / any keys missing within the iteration range, it will fail validation. the actual values served by the iterator are covered by readset validation. Additionally, the early stop behavior allows the iterateset to ONLY be sensitive to changes to the keys available WITHIN the iteration range. In the event that we perform iteration, and THEN write a key within the range of iteration, this will not fail iteration because we take a snapshot of the mvkv writeset at the moment of iteration, so when we replay the iterator, we populate that iterator with the writeset at that time, so we appropriately replicate the iterator behavior. In the case that we encounter an ESTIMATE, we have to terminate the iterator validation and mark it as failed because it is impossible to know whether that ESTIMATE represents a value change or a delete, since the latter, will affect the keys available for iteration. This change also implements handlers that iterators receive for updating readset and iterateset in the `mvkv` ## Testing performed to validate your change Unit tests for various iteration scenarios
Configuration menu - View commit details
-
Copy full SHA for f3a6cf4 - Browse repository at this point
Copy the full SHA f3a6cf4View commit details -
[occ] Add scheduler logic for validation (#336)
- This was copied from #332 which became unwieldy due to commit history (merges/rebases) - Adds scheduler logic for validation - In this initial version it completes all executions then performs validations (which feed retries) - Once we start benchmarking we can make performance improvements to this - Retries tasks that fail validation and have no dependencies - Scheduler Test verifies multi-worker with conflicts
Configuration menu - View commit details
-
Copy full SHA for 60b2113 - Browse repository at this point
Copy the full SHA 60b2113View commit details -
[occ] Fix situation where no stores causes a panic (#338)
## Describe your changes and provide context Some tests from sei-chain don't inject a store, and while I'm not sure if that's a valid scenario I made the scheduler.go tolerant to the situation to avoid introducing this assumption to the system. ## Testing performed to validate your change New unit test confirming lack of crash
Configuration menu - View commit details
-
Copy full SHA for 1178e0b - Browse repository at this point
Copy the full SHA 1178e0bView commit details -
Add occ flag check to context (#340)
## Describe your changes and provide context - Allows sei-chain to ask isOCCEnabled() so that it can choose to use the OCC logic - Sei-chain can set this to true according to desired logic ## Testing performed to validate your change - unit test that sets flag and verifies value
Configuration menu - View commit details
-
Copy full SHA for 6ec1620 - Browse repository at this point
Copy the full SHA 6ec1620View commit details -
[occ] Add struct field and helpers for estimate prefills (#341)
## Describe your changes and provide context This adds in the ability to prefill estimates based on metadata passed along with deliverTxBatch ## Testing performed to validate your change Unit Test to verify that multiversion store initialization is now idempotent, and works properly regardless of whether estimate prefill is enabled
Configuration menu - View commit details
-
Copy full SHA for 9530aeb - Browse repository at this point
Copy the full SHA 9530aebView commit details -
## Describe your changes and provide context - `CollectIteratorItems` needs to hold an RLock to avoid a concurrent access panic ## Testing performed to validate your change - Reproduced through a sei-chain-side test (concurrent instantiates)
Configuration menu - View commit details
-
Copy full SHA for 3bdbc96 - Browse repository at this point
Copy the full SHA 3bdbc96View commit details -
## Describe your changes and provide context This adds the accesscontrol module behavior to add the tx writeset generation ## Testing performed to validate your change Unit tests + integration with sei-chain and loadtest cluster testing
Configuration menu - View commit details
-
Copy full SHA for 954c5a9 - Browse repository at this point
Copy the full SHA 954c5a9View commit details -
[OCC] Add trace spans to scheduler (#347)
## Describe your changes and provide context - Adds trace span for `SchedulerValidate` - Adds trace span for `SchedulerExecute` - Mild refactor (extracted methods) to make it easier to defer span ending ## Testing performed to validate your change Example trace (run locally) ![image](https://github.com/sei-protocol/sei-cosmos/assets/6051744/b8a032f1-71b1-4e95-b12e-357455ebcc6d) Example attributes of SchedulerExecute operation ![image](https://github.com/sei-protocol/sei-cosmos/assets/6051744/68992e84-4000-44c1-8597-9d4c10583a66)
Configuration menu - View commit details
-
Copy full SHA for be45bb5 - Browse repository at this point
Copy the full SHA be45bb5View commit details -
[occ] Fix parent store readset validation (#348)
## Describe your changes and provide context This fixes the validation to remove a panic for a case that can actually occur if a transaction writes a key that is later read, and that writing transaction is reverted and then the readset validation reads from parent store. In this case, the readset would have a conflict based on the data available in parent store, so we shouldn't panic. This also adds in the resource types needed for the new DEX_MEM keys ## Testing performed to validate your change Tested in loadtest cluster
Configuration menu - View commit details
-
Copy full SHA for 061ef70 - Browse repository at this point
Copy the full SHA 061ef70View commit details -
[occ] OCC scheduler and validation fixes (#359)
This makes optimizations to the scheduler and validation --------- Co-authored-by: Steven Landers <steven.landers@gmail.com>
Configuration menu - View commit details
-
Copy full SHA for f9541fb - Browse repository at this point
Copy the full SHA f9541fbView commit details -
[occ] Add optimizations for multiversion and mvkv (#361)
Add optimizations to reduce mutex lock contention and refactor with sync Maps. This also removes telemetry that was added liberally, and we can later add in telemetry more mindfully and feature flagged. loadtest chain testing
Configuration menu - View commit details
-
Copy full SHA for 30b7fab - Browse repository at this point
Copy the full SHA 30b7fabView commit details -
[OCC] Add scheduler goroutine pool and optimizations (#362)
## Describe your changes and provide context - adds pool optimizations (bounds by tasks / workers) - adds validateAll shortcut (starts at first non-validated entry) - adds invalidation of future tasks on invalidation ## Testing performed to validate your change - unit tests are passing with full conflicting txs
Configuration menu - View commit details
-
Copy full SHA for 4d12564 - Browse repository at this point
Copy the full SHA 4d12564View commit details -
update concurrency workers (#380)
## Describe your changes and provide context Update concurrency workers ## Testing performed to validate your change
Configuration menu - View commit details
-
Copy full SHA for a780a58 - Browse repository at this point
Copy the full SHA a780a58View commit details -
[OCC] Fix hang where abort channel blocks iterator (#379)
## Describe your changes and provide context - instead of assuming one thing will arrive to the abort channel, drain it ## Testing performed to validate your change - new unit test captures situation (tests iterator)
Configuration menu - View commit details
-
Copy full SHA for cb02f7e - Browse repository at this point
Copy the full SHA cb02f7eView commit details -
## Describe your changes and provide context This change serves to improve the way we track the values of the keys we iterate over when running iterators. Previously, the iterateset would only track the keys that were iterated, and the behavior of the iterator was thought to not include keys that didn't have values present, OR that the readset would be appropriately updated when reading the value from the iterateset. (I'm not yet 100% sure that updating readset WITHIN the tracked iterator is fully necessary, since it may be the case that the readset modifications may have been sufficient to mitigate this issue, but the change is currently in the PR since this is the version of code running on the loadtest cluster for stability testing. However, in cases when an earlier transaction was writing to the range that would be iterated, it was possible that the stale value was read by the transaction handler, BUT the value that got into the readset was the newer one. I believe this has to do with the readset updating based on directly querying values from underlying stores, and overwriting the prior readset value that indicated that the transaction used a stale value. The fix I have made is that during tx execution, the cache memiterator now reads directly form MVKV instead of individually reading from underlying stores. The key difference here is that IF the key is already in the readset, it will serve that STALE value instead of reading into the underlying store where the value may have since mutated. As a result, the behavior we now expect is that one a key is read, ONLY that value that was read will be utilized for the duration of the transaction. This way, we won't potentially mutate the readset by overwriting the key entry with the later value only to have it incorrectly pass validation. Additionally, to more rigorously enforce this behavior, updating the readset now will only update the map IFF the key doesnt already exist in the readset. This should provide better guarantees around catching any stale reads that occur over the lifespan of the transacation execution. ## Testing performed to validate your change Running a lot of iterator heavy workloads on a loadtest cluster to verify that no nondeterminism remains in the iterator workflow
Configuration menu - View commit details
-
Copy full SHA for fa4b76d - Browse repository at this point
Copy the full SHA fa4b76dView commit details -
Configuration menu - View commit details
-
Copy full SHA for 6bf4d72 - Browse repository at this point
Copy the full SHA 6bf4d72View commit details -
fix deleteIterateSet and leave some comments (#395)
## Describe your changes and provide context ## Testing performed to validate your change
Configuration menu - View commit details
-
Copy full SHA for 6878b96 - Browse repository at this point
Copy the full SHA 6878b96View commit details -
## Describe your changes and provide context This adds `occ-enabled` as a config for baseapp to control whether to execute transactions with OCC parallelism. ## Testing performed to validate your change Tested on sei-chain
Configuration menu - View commit details
-
Copy full SHA for d08b8f0 - Browse repository at this point
Copy the full SHA d08b8f0View commit details -
Remove block gas meter in occ (#407)
## Describe your changes and provide context This removes the block gas meter for occ, and will eventually be rebased out with a corresponding change that will end up in main ## Testing performed to validate your change loadtest cluster testing
Configuration menu - View commit details
-
Copy full SHA for 75d1151 - Browse repository at this point
Copy the full SHA 75d1151View commit details
Commits on Feb 9, 2024
-
Relax locking contention (#427)
## Describe your changes and provide context This reduces some of the locking contention experienced when executing transactions with OCC. Additionally, undoes an earlier revert that reintroduced some locking for event emission ## Testing performed to validate your change
Configuration menu - View commit details
-
Copy full SHA for 48dfff5 - Browse repository at this point
Copy the full SHA 48dfff5View commit details -
## Describe your changes and provide context ## Testing performed to validate your change --------- Co-authored-by: Yiming Zang <50607998+yzang2019@users.noreply.github.com>
Configuration menu - View commit details
-
Copy full SHA for f9805fe - Browse repository at this point
Copy the full SHA f9805feView commit details -
fix assignment to not cause panic (#429)
## Describe your changes and provide context ## Testing performed to validate your change
Configuration menu - View commit details
-
Copy full SHA for 6b43421 - Browse repository at this point
Copy the full SHA 6b43421View commit details
Commits on Feb 13, 2024
-
[OCC] add metrics for scheduler (#431)
## Describe your changes and provide context - **retries** represents number of tx attempts beyond the first attempt - **max_incarnation** is the highest incarnation seen in a given block ## Testing performed to validate your change - lower environment
Configuration menu - View commit details
-
Copy full SHA for 5a05027 - Browse repository at this point
Copy the full SHA 5a05027View commit details -
Configuration menu - View commit details
-
Copy full SHA for 00cc70d - Browse repository at this point
Copy the full SHA 00cc70dView commit details