Skip to content

Conversation

jsvisa
Copy link
Contributor

@jsvisa jsvisa commented Jul 1, 2025

Optimize the state history index read by implementing partial offset reading.

@jsvisa jsvisa requested a review from rjl493456442 as a code owner July 1, 2025 18:15
}

// RetrieveBytes retrieves a byte range [offset:offset+length] from the specified ancient item.
func (t *freezerTable) RetrieveBytes(item, offset, length uint64) ([]byte, error) {
Copy link
Member

Choose a reason for hiding this comment

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

so unfortunately, the state history is mostly stored with SNAPPY enabled?

// stateFreezerTableConfigs configures the settings for tables in the state freezer.
var stateFreezerTableConfigs = map[string]freezerTableConfig{
	stateHistoryMeta:         {noSnappy: true, prunable: true},
	stateHistoryAccountIndex: {noSnappy: false, prunable: true},
	stateHistoryStorageIndex: {noSnappy: false, prunable: true},
	stateHistoryAccountData:  {noSnappy: false, prunable: true},
	stateHistoryStorageData:  {noSnappy: false, prunable: true},
}

In this case, the partial read will be useless

Signed-off-by: jsvisa <delweng@gmail.com>
Signed-off-by: jsvisa <delweng@gmail.com>
Signed-off-by: jsvisa <delweng@gmail.com>
Signed-off-by: jsvisa <delweng@gmail.com>
Signed-off-by: jsvisa <delweng@gmail.com>
Signed-off-by: jsvisa <delweng@gmail.com>
Copy link
Member

@rjl493456442 rjl493456442 left a comment

Choose a reason for hiding this comment

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

LGTM

@rjl493456442 rjl493456442 added this to the 1.16.5 milestone Oct 13, 2025
@rjl493456442 rjl493456442 merged commit a7359ce into ethereum:master Oct 13, 2025
5 of 6 checks passed
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.

3 participants