Skip to content

feat: add trustPeriod and backfillBlocks to configure-state-sync#28

Merged
bdchatham merged 2 commits intomainfrom
ftr-state-sync-params
Mar 15, 2026
Merged

feat: add trustPeriod and backfillBlocks to configure-state-sync#28
bdchatham merged 2 commits intomainfrom
ftr-state-sync-params

Conversation

@bdchatham
Copy link
Contributor

@bdchatham bdchatham commented Mar 15, 2026

Summary

  • Extends the configure-state-sync task to accept trustPeriod and backfillBlocks parameters from the controller
  • Allows the controller to derive sane defaults based on the node bootstrap strategy (local snapshot vs network state-sync) rather than requiring users to set these in the CRD
  • Introduces StateSyncParams struct to group the optional parameters passed to Configure()

Changes

  • sidecar/client/tasks.go: Add TrustPeriod and BackfillBlocks fields to ConfigureStateSyncTask, conditionally include in task request params
  • sidecar/tasks/statesync.go: Add fields to StateSyncConfig, refactor Configure() to accept StateSyncParams, write trust-period and backfill-blocks to config.toml when set
  • sidecar/tasks/statesync_test.go: Update existing tests for new signature, add TestStateSyncConfigurer_NetworkWithBackfill

Test plan

  • Existing unit tests updated and passing
  • New test for network state-sync with backfill parameters
  • Integration test with controller passing derived parameters

@bdchatham bdchatham force-pushed the ftr-state-sync-params branch from b054b76 to f032771 Compare March 15, 2026 21:34
@bdchatham bdchatham marked this pull request as ready for review March 15, 2026 21:35
Extend the configure-state-sync task to accept trustPeriod and
backfillBlocks parameters from the controller. This allows the
controller to derive sane defaults based on the node bootstrap
strategy rather than requiring users to set these values.

- Add TrustPeriod and BackfillBlocks to ConfigureStateSyncTask
- Refactor Configure() to accept StateSyncParams struct
- Write trust-period and backfill-blocks to config.toml when set
- Add TestStateSyncConfigurer_NetworkWithBackfill test
@bdchatham bdchatham force-pushed the ftr-state-sync-params branch from f032771 to b534842 Compare March 15, 2026 21:39
@github-actions
Copy link

Suggested version: v0.0.14

Comparing to: v0.0.13 (diff)

Changes in go.mod file(s):

(empty)

gorelease says:

The following panic happened checking types near:
	/opt/hostedtoolcache/go/1.26.1/x64/src/internal/godebugs/table.go:28:5
panic: runtime error: invalid memory address or nil pointer dereference [recovered, repanicked]
[signal SIGSEGV: segmentation violation code=0x1 addr=0x0 pc=0x60a0f2]

goroutine 445 [running]:
go/types.(*Checker).handleBailout(0x3f7804969000, 0x3f7805567c38)
	/opt/hostedtoolcache/go/1.26.1/x64/src/go/types/check.go:473 +0x91
panic({0x6e9840?, 0x98dba0?})
	/opt/hostedtoolcache/go/1.26.1/x64/src/runtime/panic.go:860 +0x13a
go/types.(*Checker).objDecl.func1()
	/opt/hostedtoolcache/go/1.26.1/x64/src/go/types/decl.go:55 +0x5c
panic({0x6e9840?, 0x98dba0?})
	/opt/hostedtoolcache/go/1.26.1/x64/src/runtime/panic.go:860 +0x13a
go/types.(*StdSizes).Sizeof(0x0, {0x758c68, 0x991360})
	/opt/hostedtoolcache/go/1.26.1/x64/src/go/types/sizes.go:229 +0x312
go/types.(*Config).sizeof(...)
	/opt/hostedtoolcache/go/1.26.1/x64/src/go/types/sizes.go:334
go/types.representableConst.func1(...)
	/opt/hostedtoolcache/go/1.26.1/x64/src/go/types/const.go:77
go/types.representableConst({0x75aa60, 0x7669b8}, 0x3f7804969000, 0x991360, 0x3f7804e927f0)
	/opt/hostedtoolcache/go/1.26.1/x64/src/go/types/const.go:93 +0x1e9
go/types.(*Checker).representation(0x3f7804969000, 0x3f7805606840, 0x991360)
	/opt/hostedtoolcache/go/1.26.1/x64/src/go/types/const.go:257 +0x5f
go/types.(*Checker).implicitTypeAndValue(0x3f7804969000, 0x3f7805606840, {0x758c68?, 0x991360?})
	/opt/hostedtoolcache/go/1.26.1/x64/src/go/types/expr.go:404 +0x3ed
go/types.(*Checker).assignment(0x3f7804969000, 0x3f7805606840, {0x758c68, 0x991360}, {0x73e03b, 0xe})
	/opt/hostedtoolcache/go/1.26.1/x64/src/go/types/assignments.go:70 +0x445
go/types.(*Checker).compositeLit(0x3f7804969000, 0x3f7805606840, 0x3f780547c600, {0x758bf0?, 0x3f7804da4a00?})
	/opt/hostedtoolcache/go/1.26.1/x64/src/go/types/literals.go:189 +0x12c5
go/types.(*Checker).exprInternal(0x3f7804969000, 0x0, 0x3f7805606840, {0x759df8, 0x3f780547c600}, {0x758bf0?, 0x3f7804da4a00?})
	/opt/hostedtoolcache/go/1.26.1/x64/src/go/types/expr.go:1076 +0x20f
go/types.(*Checker).rawExpr(0x3f7804969000, 0x0, 0x3f7805606840, {0x759df8?, 0x3f780547c600?}, {0x758bf0?, 0x3f7804da4a00?}, 0x0)
	/opt/hostedtoolcache/go/1.26.1/x64/src/go/types/expr.go:982 +0x18c
go/types.(*Checker).exprWithHint(0x3f7804969000, 0x3f7805606840, {0x759df8, 0x3f780547c600}, {0x758bf0, 0x3f7804da4a00})
	/opt/hostedtoolcache/go/1.26.1/x64/src/go/types/expr.go:1326 +0x65
go/types.(*Checker).indexedElts(0x3f7804969000, {0x3f7804b24908, 0x36, 0x5f764e?}, {0x758bf0, 0x3f7804da4a00}, 0xffffffffffffffff)
	/opt/hostedtoolcache/go/1.26.1/x64/src/go/types/literals.go:362 +0x130
go/types.(*Checker).compositeLit(0x3f7804969000, 0x3f7805606700, 0x3f780547dc80, {0x0?, 0x0?})
	/opt/hostedtoolcache/go/1.26.1/x64/src/go/types/literals.go:246 +0x41b
go/types.(*Checker).exprInternal(0x3f7804969000, 0x0, 0x3f7805606700, {0x759df8, 0x3f780547dc80}, {0x0?, 0x0?})
	/opt/hostedtoolcache/go/1.26.1/x64/src/go/types/expr.go:1076 +0x20f
go/types.(*Checker).rawExpr(0x3f7804969000, 0x0, 0x3f7805606700, {0x759df8?, 0x3f780547dc80?}, {0x0?, 0x0?}, 0x0)
	/opt/hostedtoolcache/go/1.26.1/x64/src/go/types/expr.go:982 +0x18c
go/types.(*Checker).expr(0x3f7804969000, 0x0?, 0x3f7805606700, {0x759df8?, 0x3f780547dc80?})
	/opt/hostedtoolcache/go/1.26.1/x64/src/go/types/expr.go:1276 +0x30
go/types.(*Checker).varDecl(0x3f7804969000, 0x3f78049defc0, {0x3f780496c380, 0x1, 0x1}, {0x0, 0x0}, {0x759df8, 0x3f780547dc80})
	/opt/hostedtoolcache/go/1.26.1/x64/src/go/types/decl.go:482 +0x178
go/types.(*Checker).objDecl(0x3f7804969000, {0x760530, 0x3f78049defc0})
	/opt/hostedtoolcache/go/1.26.1/x64/src/go/types/decl.go:156 +0xa7d
go/types.(*Checker).packageObjects(0x3f7804969000)
	/opt/hostedtoolcache/go/1.26.1/x64/src/go/types/resolver.go:690 +0x3ea
go/types.(*Checker).checkFiles(0x3f7804969000, {0x3f7804a02010?, 0x5c405b?, 0x72a2e0?})
	/opt/hostedtoolcache/go/1.26.1/x64/src/go/types/check.go:534 +0x385
go/types.(*Checker).Files(0x3f7804ada0e0?, {0x3f7804a02010?, 0x3f7804a521e0?, 0x6?})
	/opt/hostedtoolcache/go/1.26.1/x64/src/go/types/check.go:491 +0x75
golang.org/x/tools/go/packages.(*loader).loadPackage(0x3f7804ada0e0, 0x3f7804e95950)
	/home/runner/go/pkg/mod/golang.org/x/tools@v0.2.0/go/packages/packages.go:1037 +0x8ef
golang.org/x/tools/go/packages.(*loader).loadRecursive.func1()
	/home/runner/go/pkg/mod/golang.org/x/tools@v0.2.0/go/packages/packages.go:847 +0x1a7
sync.(*Once).doSlow(0x706f5f6970612209?, 0x617061437465475f?)
	/opt/hostedtoolcache/go/1.26.1/x64/src/sync/once.go:78 +0xac
sync.(*Once).Do(...)
	/opt/hostedtoolcache/go/1.26.1/x64/src/sync/once.go:69
golang.org/x/tools/go/packages.(*loader).loadRecursive(0x7974696361706143?, 0x4d726567616e614d?)
	/home/runner/go/pkg/mod/golang.org/x/tools@v0.2.0/go/packages/packages.go:835 +0x3b
golang.org/x/tools/go/packages.(*loader).loadRecursive.func1.1(0x617061437465475f?)
	/home/runner/go/pkg/mod/golang.org/x/tools@v0.2.0/go/packages/packages.go:842 +0x26
created by golang.org/x/tools/go/packages.(*loader).loadRecursive.func1 in goroutine 442
	/home/runner/go/pkg/mod/golang.org/x/tools@v0.2.0/go/packages/packages.go:841 +0x8c

gocompat says:

Your branch is up to date with 'origin/main'.

Cutting a Release (and modifying non-markdown files)

This PR is modifying both version.json and non-markdown files.
The Release Checker is not able to analyse files that are not checked in to main. This might cause the above analysis to be inaccurate.
Please consider performing all the code changes in a separate PR before cutting the release.

Automatically created GitHub Release

A draft GitHub Release has been created.
It is going to be published when this PR is merged.
You can modify its' body to include any release notes you wish to include with the release.

@bdchatham bdchatham merged commit 2a118bf into main Mar 15, 2026
4 checks passed
@bdchatham bdchatham deleted the ftr-state-sync-params branch March 15, 2026 21:41
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