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

feat(internal/ethapi): historical-proof-query-window option for archive nodes eth_getProof #719

Merged
merged 22 commits into from
Jan 15, 2025

Conversation

qdm12
Copy link
Collaborator

@qdm12 qdm12 commented Dec 26, 2024

Why this should be merged

Resolves #714

How this works

  • New option historical-proof-query-window for archive nodes only which:
    • can be set to a strictly positive number to accept get proof queries for a block number above the last accepted block number - historical-proof-query-window
    • defaults to 43200 to accept get proof queries for blocks dating from the last 24 hours approximately
    • can be set to 0 to accept any block number get proof query
  • For non-archive nodes, only the last 32 blocks before the accepted block are accepted for get proof queries (as before pretty much)

How this was tested

  • TestBlockChainAPI_stateQueryBlockNumberAllowed

Need to be documented?

Need to update RELEASES.md?

  • Done in RELEASES.md for the v0.14.1 release

eth/ethconfig/config.go Outdated Show resolved Hide resolved
internal/ethapi/api.go Outdated Show resolved Hide resolved
internal/ethapi/api.go Outdated Show resolved Hide resolved
internal/ethapi/api.go Outdated Show resolved Hide resolved
internal/ethapi/api.go Outdated Show resolved Hide resolved
internal/ethapi/api.go Outdated Show resolved Hide resolved
internal/ethapi/api_test.go Outdated Show resolved Hide resolved
internal/ethapi/mocks_generate_test.go Outdated Show resolved Hide resolved
plugin/evm/config.go Outdated Show resolved Hide resolved
internal/ethapi/api_test.go Outdated Show resolved Hide resolved
@qdm12 qdm12 force-pushed the qdm12/historical-proofs-options branch from 6deaa8a to bdfbbcd Compare December 26, 2024 15:59
@qdm12 qdm12 marked this pull request as ready for review December 26, 2024 16:36
@qdm12 qdm12 requested review from ceyonur, darioush and a team as code owners December 26, 2024 16:36
@qdm12 qdm12 force-pushed the qdm12/historical-proofs-options branch 2 times, most recently from 1d1a1a1 to 3a7ba07 Compare December 27, 2024 12:39
internal/ethapi/api_extra.go Outdated Show resolved Hide resolved
internal/ethapi/mocks_generate_test.go Outdated Show resolved Hide resolved
license_header Outdated Show resolved Hide resolved
@qdm12 qdm12 requested a review from darioush December 30, 2024 17:44
plugin/evm/vm.go Outdated Show resolved Hide resolved
eth/ethconfig/config.go Outdated Show resolved Hide resolved
internal/ethapi/api.go Outdated Show resolved Hide resolved
eth/ethconfig/config.go Outdated Show resolved Hide resolved
eth/ethconfig/config.go Outdated Show resolved Hide resolved
internal/ethapi/api_extra.go Outdated Show resolved Hide resolved
internal/ethapi/api_extra.go Outdated Show resolved Hide resolved
internal/ethapi/api_extra.go Outdated Show resolved Hide resolved
@qdm12 qdm12 force-pushed the qdm12/historical-proofs-options branch 4 times, most recently from 5920832 to 534a73e Compare January 3, 2025 13:38
eth/ethconfig/config.go Outdated Show resolved Hide resolved
plugin/evm/config/config.go Outdated Show resolved Hide resolved
plugin/evm/vm_test.go Outdated Show resolved Hide resolved
@qdm12 qdm12 force-pushed the qdm12/historical-proofs-options branch from 6cea7d1 to 8a89462 Compare January 3, 2025 14:44
@qdm12 qdm12 requested review from ceyonur and darioush January 3, 2025 14:49
RELEASES.md Outdated Show resolved Hide resolved
eth/ethconfig/config.go Outdated Show resolved Hide resolved
eth/ethconfig/config.go Outdated Show resolved Hide resolved
internal/ethapi/api.go Outdated Show resolved Hide resolved
internal/ethapi/api_extra.go Outdated Show resolved Hide resolved
eth/backend.go Outdated Show resolved Hide resolved
plugin/evm/vm.go Outdated Show resolved Hide resolved
@qdm12 qdm12 changed the title feat(internal/ethapi): historical-proofs and recent-blocks-window options for GetProofs feat(internal/ethapi): historical-state-query-window option for GetProofs Jan 7, 2025
@qdm12 qdm12 force-pushed the qdm12/historical-proofs-options branch 2 times, most recently from 76d1f74 to 8948854 Compare January 8, 2025 14:02
RELEASES.md Outdated Show resolved Hide resolved
plugin/evm/vm.go Outdated Show resolved Hide resolved
RELEASES.md Outdated Show resolved Hide resolved
@qdm12 qdm12 force-pushed the qdm12/historical-proofs-options branch from 8948854 to 6e83e97 Compare January 8, 2025 15:54
RELEASES.md Outdated Show resolved Hide resolved
plugin/evm/config/config.go Outdated Show resolved Hide resolved
plugin/evm/vm.go Outdated Show resolved Hide resolved
darioush
darioush previously approved these changes Jan 9, 2025
@qdm12 qdm12 changed the title feat(internal/ethapi): historical-state-query-window option for GetProofs feat(internal/ethapi): historical-proof-query-window option for archive nodes get_proof Jan 9, 2025
@qdm12 qdm12 changed the title feat(internal/ethapi): historical-proof-query-window option for archive nodes get_proof feat(internal/ethapi): historical-proof-query-window option for archive nodes eth_getProof Jan 9, 2025
qdm12 added 20 commits January 10, 2025 15:49
- Dynamic default depending if pruning is true or false
- Replace `historical-proofs` with `historical-state-query-window` set to `0` to allow any block number state query
- Replace `recent-blocks-window` with `historical-state-query-window` which is only applicable for archive nodes
- For non-archive nodes, `historical-state-query-window` defaults to the tip buffer size of 32
- Set eth default HistoricalStateQueryWindow to 43200 (is this necessary?)
- Export core.tipBufferSize
- Update release notes
- remove the need to modify config after reading it
- remove the need to import core from config package
- core.TipBufferSize is used if running in non-archive mode within the function `isHistoricalStateQueryAllowed`
- rename `defaultBlocksWindow` -> `defaultHistoricalProofQueryWindow`
- Chain calls with `s.b.LastAcceptedBlock().NumberU64()`
@qdm12 qdm12 force-pushed the qdm12/historical-proofs-options branch from 1633751 to d09eabb Compare January 10, 2025 14:51
@qdm12 qdm12 enabled auto-merge (squash) January 10, 2025 14:52
@qdm12 qdm12 requested review from darioush and ceyonur January 10, 2025 14:52
@darioush darioush disabled auto-merge January 13, 2025 15:26
@qdm12 qdm12 merged commit 5013851 into master Jan 15, 2025
8 checks passed
@qdm12 qdm12 deleted the qdm12/historical-proofs-options branch January 15, 2025 15:28
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.

Deprecate historical proofs in eth_getProof API.
3 participants