Skip to content

[cache] BlockAccessor with caching separate from StateAccessor#980

Open
dmtrskv wants to merge 1 commit into
mainfrom
block-accessor
Open

[cache] BlockAccessor with caching separate from StateAccessor#980
dmtrskv wants to merge 1 commit into
mainfrom
block-accessor

Conversation

@dmtrskv

@dmtrskv dmtrskv commented Jun 25, 2025

Copy link
Copy Markdown
Contributor

A lot of usages of state accessor require only blocks, so we can introduce a simpler block accessor.
The state accessor is modified in another PR: #958

Block: block,
ConfigAccessor: configAccessor,
StateAccessor: api.accessor,
BlockAccessor: execution.NewBlockAccessor(32), // todo: use shared accessor

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

will be fixed in state accessor PR

func (b *BlockHashByNumberAccessor) Get(tx db.RoTx, shardId types.ShardId, num types.BlockNumber) (common.Hash, error) {
key := shardAndBlockId{shardId, num}
// todo: use cache
// currently, the block can be somehow updated

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

This problem is reproduced in #981
Not caching here is no problem for now

@dmtrskv dmtrskv marked this pull request as ready for review June 25, 2025 17:23
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.

1 participant