Skip to content

Commit

Permalink
Merge pull request #4836 from onflow/leo/storehouse-in-memory-regsite…
Browse files Browse the repository at this point in the history
…r-store

[Storehouse] Storehouse in memory regsiter store
  • Loading branch information
zhangchiqing authored Nov 10, 2023
2 parents e4011e4 + 87b7c0a commit 23c304d
Show file tree
Hide file tree
Showing 8 changed files with 993 additions and 15 deletions.
4 changes: 2 additions & 2 deletions engine/execution/mock/executed_finalized_wal.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 2 additions & 2 deletions engine/execution/mock/in_memory_register_store.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 2 additions & 2 deletions engine/execution/mock/register_store.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

10 changes: 5 additions & 5 deletions engine/execution/mock/wal_reader.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

8 changes: 4 additions & 4 deletions engine/execution/storehouse.go
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ type RegisterStore interface {
// - exception if the block is below the pruned height
// - exception if the save block is saved again
// - exception for any other exception
SaveRegisters(header *flow.Header, registers []flow.RegisterEntry) error
SaveRegisters(header *flow.Header, registers flow.RegisterEntries) error

// Depend on FinalizedReader's GetFinalizedBlockIDAtHeight
// Depend on ExecutedFinalizedWAL.Append
Expand Down Expand Up @@ -72,7 +72,7 @@ type InMemoryRegisterStore interface {
height uint64,
blockID flow.Identifier,
parentID flow.Identifier,
registers []flow.RegisterEntry,
registers flow.RegisterEntries,
) error

IsBlockExecuted(height uint64, blockID flow.Identifier) (bool, error)
Expand All @@ -81,7 +81,7 @@ type InMemoryRegisterStore interface {
type OnDiskRegisterStore = storage.RegisterIndex

type ExecutedFinalizedWAL interface {
Append(height uint64, registers []flow.RegisterEntry) error
Append(height uint64, registers flow.RegisterEntries) error

// Latest returns the latest height in the WAL.
Latest() (uint64, error)
Expand All @@ -92,5 +92,5 @@ type ExecutedFinalizedWAL interface {
type WALReader interface {
// Next returns the next height and trie updates in the WAL.
// It returns EOF when there are no more entries.
Next() (height uint64, registers []flow.RegisterEntry, err error)
Next() (height uint64, registers flow.RegisterEntries, err error)
}
Loading

0 comments on commit 23c304d

Please sign in to comment.