Skip to content

Standardize emission events naming#900

Draft
guilherme-brandao wants to merge 9 commits into
devfrom
guilherme/engn-4381-standardize-nonce-properties-in-events
Draft

Standardize emission events naming#900
guilherme-brandao wants to merge 9 commits into
devfrom
guilherme/engn-4381-standardize-nonce-properties-in-events

Conversation

@guilherme-brandao

@guilherme-brandao guilherme-brandao commented Jan 14, 2026

Copy link
Copy Markdown
Contributor

Purpose of Changes and their Description

This PR standardizes emission event naming conventions to make nonce vs tx block height explicit and align "Set" suffix usage.

Changes

1. Nonce field standardization

  • Normalize nonce-related fields to nonce (from block_height or nonce_block_height) in events where the field represents the work-cycle nonce.
  • Keep block_height_tx for transaction block height where applicable (for example, EventRewardsSettled).
  • Remove the redundant block_height field from last-commit and previous-percentage events (reserved field numbers and names).

2. "Set" suffix alignment

  • Remove the "Set" suffix from single-value events; keep it only for collection events.

Affected Events

Nonce field rename to nonce

Event Old field New field
EventScoresSet block_height nonce
EventRewardsSettled block_height nonce
EventForecastTaskScore nonce_block_height nonce
EventListeningCoefficientsSet block_height nonce
EventInfererNetworkRegretSet block_height nonce
EventForecasterNetworkRegretSet block_height nonce
EventNaiveInfererNetworkRegretSet block_height nonce
EventTopicInitialRegret block_height nonce
EventTopicInitialEmaScore block_height nonce
EventRegretStdNorm block_height nonce
EventInfererWeightsSet block_height nonce
EventForecasterWeightsSet block_height nonce
EventActiveReputersSet nonce_block_height nonce
EventActiveInferersSet nonce_block_height nonce
EventActiveForecastersSet nonce_block_height nonce
EventNetworkInferenceInfererWeightsSet nonce_block_height nonce
EventNetworkInferenceForecasterWeightsSet nonce_block_height nonce
EventNetworkInferenceInfererRegretsUsedSet nonce_block_height nonce
EventNetworkInferenceForecasterRegretsUsedSet nonce_block_height nonce
EventWorkerSubmissionWindowOpened nonce_block_height nonce
EventWorkerSubmissionWindowClosed nonce_block_height nonce
EventReputerSubmissionWindowOpened nonce_block_height nonce
EventReputerSubmissionWindowClosed nonce_block_height nonce

block_height field removed (reserved)

Event Change
EventWorkerLastCommit removed block_height (reserved)
EventReputerLastCommit removed block_height (reserved)
EventPreviousPercentageRewardToStakedReputers removed block_height (reserved)

"Set" suffix removal (single value events)

Old Name New Name
EventParamsSet EventParams
EventForecastTaskScoreSet EventForecastTaskScore
EventWorkerLastCommitSet EventWorkerLastCommit
EventReputerLastCommitSet EventReputerLastCommit
EventTopicInitialRegretSet EventTopicInitialRegret
EventTopicInitialEmaScoreSet EventTopicInitialEmaScore
EventRegretStdNormSet EventRegretStdNorm
EventPreviousPercentageRewardToStakedReputersSet EventPreviousPercentageRewardToStakedReputers

Are these changes tested and documented?

  • If tested, please describe how. If not, why tests are not needed.
  • If documented, please describe where. If not, describe why docs are not needed.
  • Added to Unreleased section of CHANGELOG.md?

@github-actions

github-actions Bot commented Jan 14, 2026

Copy link
Copy Markdown

The latest Buf updates on your PR. Results from workflow Buf Linter / buf (pull_request).

BuildFormatLintBreakingUpdated (UTC)
✅ passed✅ passed✅ passed⏩ skippedFeb 3, 2026, 6:54 PM

@guilherme-brandao guilherme-brandao changed the title Standardizes nonce field in events Standardize emission events naming Jan 15, 2026

@xmariachi xmariachi left a comment

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.

  • Please use "nonce" instead of "nonce_block_height".
  • Needs a rebase

@guilherme-brandao guilherme-brandao force-pushed the guilherme/engn-4381-standardize-nonce-properties-in-events branch from 3c3b61b to 7508b33 Compare February 2, 2026 19:33
@xmariachi

Copy link
Copy Markdown
Contributor

Also - this should come with changes in the consumers, especially producer, right?

@xmariachi xmariachi left a comment

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.

Left a comment about deprecating field / pushing version

ActorType actor_type = 1;
uint64 topic_id = 2;
int64 block_height = 3;
int64 nonce = 3;

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.

The new field on an existing needs to have a new unused number at the end (6 in this case), adding the number 3 (and the name) as reserved. However if we keep this v9 version, this block_height field and its number 3 should be kept, but as "deprecated" to keep compat with previous v9 events. If we maintain v9 version, they should be compatible.

... But maybe we want to generate a new version in general for all of these changes? This change in particular does not require it, but we are changing event names, which makes the old events not being emitted anymore, making it a breaking change to consumers.

So I think we should just add a v10?

@Kouteki Kouteki marked this pull request as draft March 30, 2026 13:10
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.

2 participants