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

polygon/heimdall: refactor into txReadStore and txStore #10130

Merged
merged 5 commits into from
May 1, 2024

Conversation

taratorio
Copy link
Member

@taratorio taratorio commented Apr 29, 2024

Will be using NewTxReadStore in #10124

Idea is simple - split the current store in 2:

  • txReadStore
  • txStore

These 2 stores wrap around a tx with snapshots reader.
The txStore wraps around the txReadStore for code re-use.
This split removes chances of unexpected tx is read only errors when calling the store update methods.

Also, opens up a possibility to introduce a dbStore and dbReadStore wrappers around txStore and txReadStore if we decide to go down this path. The dbStore in particular can have ownership over the lifetime of a tester - make sure only 1 is open at a time for example by using a channel/mutex/semaphore or some other idea and call Rollback and/or Commit.

We may need to look into transitioning these to TemporalTx at some point - for now let's just get this to work first.

polygon/heimdall/store.go Outdated Show resolved Hide resolved
@taratorio taratorio changed the title polygon/heimdall: refactor into roTxStore and rwTxStore polygon/heimdall: refactor into txReadStore and txStore Apr 30, 2024
@taratorio taratorio merged commit 7e3ea3a into e35 May 1, 2024
8 checks passed
@taratorio taratorio deleted the e35-astrid-refactor-heimdall-tx-stores branch May 1, 2024 06:09
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants