Skip to content

Conversation

powerslider
Copy link
Contributor

@powerslider powerslider commented Sep 26, 2025

Why this should be merged

Check #1281

How this works

  • sync/statesync:
    • Options on syncer, NewSyncer requires leafsRequestSize, add WithBatchSize, remove defaults.
  • plugin/evm/atomic/sync:
    • Unexport config, keep WithRequestSize/WithNumWorkers, NewSyncer takes targetHeight.
  • sync/statesync/code_queue.go:
    • Unexport queueConfig, WithCapacity via options.
  • `sync/statesync/code_syncer.go:
    • Options for numWorkers/batchSize.
  • sync/blocksync:
    • Drop Options in favor of required params NewSyncer(client, db, fromHash, fromHeight, blocksToFetch)
  • Update test call sites.
  • Reorder some existing methods to be exported first and all unexported after that.

How this was tested

existing UT

Need to be documented?

no

Need to update RELEASES.md?

no

resolves #1281

Signed-off-by: Tsvetan Dimitrov ([email protected])

@powerslider powerslider self-assigned this Sep 26, 2025
@powerslider powerslider requested a review from a team as a code owner September 26, 2025 16:55
@powerslider powerslider marked this pull request as draft September 26, 2025 16:55
- `sync/statesync`:
  - Options on syncer, NewSyncer requires leafsRequestSize, add WithBatchSize, remove defaults.
- `plugin/evm/atomic/sync`:
  - unexport config,  keep `WithRequestSize/WithNumWorkers`, NewSyncer takes targetHeight.
- `sync/statesync/code_queue.go`:
  - unexport queueConfig,  WithCapacity via options.
- `sync/statesync/code_syncer.go:
  - Options for numWorkers/batchSize.
- `sync/blocksync`:
  - Drop Options in favour of required params `NewSyncer(client, db, fromHash, fromHeight, blocksToFetch)`
- Update test call sites.

resolves #1281

Signed-off-by: Tsvetan Dimitrov ([email protected])
@powerslider powerslider force-pushed the powerslider/1281-libevm-options branch from bfc7582 to 8e65d3d Compare September 26, 2025 17:50
@powerslider powerslider marked this pull request as ready for review September 26, 2025 18:45
…Queue and stateSync

- Inline queueConfig into CodeQueue with a capacity field.
- Change CodeQueueOption to options.Option[CodeQueue] and update WithCapacity to mutate CodeQueue.
- Apply options to CodeQueue before channel creation in NewCodeQueue.
- Inline stateSyncConfig into stateSync and change SyncerOption to options.Option[stateSync].
- Update WithBatchSize to mutate stateSync and apply options to the instance in NewSyncer.
- Construct start key as [8-byte height][32-byte zero blockchainID] in addZeroes.
- Prevent over-fetch by aligning with TrieKeyLength (wrappers.LongLen + common.HashLength).
@powerslider powerslider force-pushed the powerslider/1281-libevm-options branch from 021fa62 to 97530dc Compare September 29, 2025 20:23
@powerslider powerslider force-pushed the powerslider/1281-libevm-options branch from 97530dc to 6a400d6 Compare September 29, 2025 20:28
Copy link
Contributor

@alarso16 alarso16 left a comment

Choose a reason for hiding this comment

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

Aside from my nits about input validation, looks good to me.

@ARR4N ARR4N enabled auto-merge October 3, 2025 14:21
@powerslider powerslider force-pushed the powerslider/1281-libevm-options branch from 2798088 to f3113a5 Compare October 3, 2025 15:13
@ARR4N ARR4N added this pull request to the merge queue Oct 3, 2025
Merged via the queue into master with commit b5c6acf Oct 3, 2025
9 checks passed
@ARR4N ARR4N deleted the powerslider/1281-libevm-options branch October 3, 2025 15:59
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.

Add libevm options support for all config options for all syncers
3 participants