Skip to content

Proof Provider: Persistent TaskExecutorId#874

Merged
zadykian merged 2 commits intomainfrom
sync-committee/executor-id
May 5, 2025
Merged

Proof Provider: Persistent TaskExecutorId#874
zadykian merged 2 commits intomainfrom
sync-committee/executor-id

Conversation

@zadykian
Copy link
Copy Markdown
Contributor

@zadykian zadykian commented May 1, 2025

Proof Provider: Persistent TaskExecutorId

Refactor TaskExecutor and related components to use executor.IdSource for generating TaskExecutorId

Previously, both Prover and ProofProvider used random "nonce" IDs that were regenerated on each service startup. While it's fine for Prover to use a volatile identifier, ProofProvider requires a persistent ID to support top-level task result submission after a restart

Introduced IdSource implementations:

  • InMemoryIdSource – used by Prover
  • PersistentIdSource – backed by a database and used by ProofProvider

return fmt.Errorf("failed to get current executor id: %w", err)
}

isActiveFunc := func(ctx context.Context, id types.TaskId) (bool, error) {
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

What do we mean here by isActive?

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 function checks if a task with the given Id is still active
Renamed to isTaskActiveFunc

@zadykian zadykian force-pushed the sync-committee/executor-id branch from 562a78d to 8005816 Compare May 5, 2025 09:08
Refactor `TaskExecutor` and related components to use `executor.IdSource` for generating `TaskExecutorId`s.

Previously, both `Prover` and `ProofProvider` used randomly generated "nonce" IDs that were regenerated on each service startup.
While it's fine for `Prover` to use a volatile identifier, `ProofProvider` requires a persistent ID to support top-level task result submission after a restart.

Introduced `IdSource` implementations:
* `InMemoryIdSource` – used by `Prover`
* `PersistentIdSource` – backed by a database and used by `ProofProvider`
* Replaced `testaide.RandomExecutorId()` with the new `types.NewRandomExecutorId()` function in tests
* Renaming: `CheckIfTaskExists(...) -> CheckIfTaskIsActive(...)`
@zadykian zadykian force-pushed the sync-committee/executor-id branch from cebf2ac to c92e0aa Compare May 5, 2025 13:36
@zadykian zadykian enabled auto-merge May 5, 2025 13:37
@zadykian zadykian added this pull request to the merge queue May 5, 2025
Merged via the queue into main with commit 34923e4 May 5, 2025
28 of 29 checks passed
@zadykian zadykian deleted the sync-committee/executor-id branch May 5, 2025 14:24
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