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

[Merged by Bors] - Add "until" field to PoetWaitRound, PoetWaitProof, AtxPublished events #5425

Closed
wants to merge 1 commit into from

Conversation

xearl4
Copy link
Contributor

@xearl4 xearl4 commented Jan 10, 2024

Motivation

Many people currently use the gRPC AdminService's EventStream for simple go-spacemesh monitoring. This PR adds an "until" field to the PoetWaitRound, PoetWaitProof and AtxPublished events to make it a bit easier to see until when the node will wait after those events (related recent discussion in Discord).

Example events after this change:

  "poetWaitRound": {
    "current": 12,                                        
    "publish": 13,                                        
    "wait": "29238.819235612s",
    "until": "2024-01-09T07:00:21.151608967Z"
  }

  "poetWaitProof": {
    "publish": 13,
    "target": 14,
    "wait": "987972.244983544s",
    "until": "2024-01-20T20:00:00.000003843Z"
  }
  
  "atxPublished": {                                                                                                  
    "current": 12,                                                                                                   
    "target": 13,
    "id": "...", 
    "wait": "292017.668117248s",               
    "until": "2024-01-12T08:00:00.000001993Z"
  }

Changes

Set the until field in the PoetWaitRound, PoetWaitProof, AtxPublished event.

This change depends on spacemeshos/api#297. Updates to go.mod/go.sum are pending until a new tagged version of api.

Test Plan

Manual testing

TODO

  • Explain motivation or link existing issue(s)
  • Test changes and document test plan
  • Update documentation as needed
  • Update changelog as needed

events/events.go Outdated Show resolved Hide resolved
events/events.go Outdated Show resolved Hide resolved
events/events.go Outdated Show resolved Hide resolved
@fasmat
Copy link
Member

fasmat commented Jan 21, 2024

To use the updated API you have to update the dependency:

go get github.com/spacemeshos/api/release/go

@xearl4
Copy link
Contributor Author

xearl4 commented Jan 21, 2024

Updated to use the released api 1.26. I incorporated the review comments from fasmat (thanks!).

@xearl4 xearl4 marked this pull request as ready for review January 21, 2024 22:35
@xearl4 xearl4 changed the title WiP: Add "until" field to PoetWaitRound, PoetWaitProof, AtxPublished events Add "until" field to PoetWaitRound, PoetWaitProof, AtxPublished events Jan 21, 2024
@fasmat
Copy link
Member

fasmat commented Jan 21, 2024

LGTM. Thanks @xearl4

bors merge

@spacemesh-bors
Copy link

👎 Rejected by too few approved reviews

@fasmat
Copy link
Member

fasmat commented Jan 21, 2024

bors merge

spacemesh-bors bot pushed a commit that referenced this pull request Jan 21, 2024
#5425)

## Motivation
Many people currently use the gRPC AdminService's EventStream for simple go-spacemesh monitoring. This PR adds an "until" field to the PoetWaitRound, PoetWaitProof and AtxPublished events to make it a bit easier to see until when the node will wait after those events ([related recent discussion in Discord](https://discord.com/channels/623195163510046732/691262184050786305/1194552731378122782)).

Example events after this change:

```json
  "poetWaitRound": {
    "current": 12,                                        
    "publish": 13,                                        
    "wait": "29238.819235612s",
    "until": "2024-01-09T07:00:21.151608967Z"
  }

  "poetWaitProof": {
    "publish": 13,
    "target": 14,
    "wait": "987972.244983544s",
    "until": "2024-01-20T20:00:00.000003843Z"
  }
  
  "atxPublished": {                                                                                                  
    "current": 12,                                                                                                   
    "target": 13,
    "id": "...", 
    "wait": "292017.668117248s",               
    "until": "2024-01-12T08:00:00.000001993Z"
  }
```

## Changes
Set the `until` field in the PoetWaitRound, PoetWaitProof, AtxPublished event.

This change depends on spacemeshos/api#297. ~~Updates to go.mod/go.sum are pending until a new tagged version of `api`.~~

## Test Plan
Manual testing

## TODO
<!-- This section should be removed when all items are complete -->
- [X] Explain motivation or link existing issue(s)
- [X] Test changes and document test plan
- [ ] Update documentation as needed
- [ ] Update [changelog](../CHANGELOG.md) as needed
Copy link

codecov bot commented Jan 21, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Comparison is base (9c9f42f) 77.6% compared to head (68f0343) 77.6%.

Additional details and impacted files
@@           Coverage Diff           @@
##           develop   #5425   +/-   ##
=======================================
  Coverage     77.6%   77.6%           
=======================================
  Files          267     267           
  Lines        30953   30956    +3     
=======================================
+ Hits         24038   24045    +7     
+ Misses        5398    5395    -3     
+ Partials      1517    1516    -1     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@spacemesh-bors
Copy link

Build failed:

@fasmat
Copy link
Member

fasmat commented Jan 22, 2024

bors merge

spacemesh-bors bot pushed a commit that referenced this pull request Jan 22, 2024
#5425)

## Motivation
Many people currently use the gRPC AdminService's EventStream for simple go-spacemesh monitoring. This PR adds an "until" field to the PoetWaitRound, PoetWaitProof and AtxPublished events to make it a bit easier to see until when the node will wait after those events ([related recent discussion in Discord](https://discord.com/channels/623195163510046732/691262184050786305/1194552731378122782)).

Example events after this change:

```json
  "poetWaitRound": {
    "current": 12,                                        
    "publish": 13,                                        
    "wait": "29238.819235612s",
    "until": "2024-01-09T07:00:21.151608967Z"
  }

  "poetWaitProof": {
    "publish": 13,
    "target": 14,
    "wait": "987972.244983544s",
    "until": "2024-01-20T20:00:00.000003843Z"
  }
  
  "atxPublished": {                                                                                                  
    "current": 12,                                                                                                   
    "target": 13,
    "id": "...", 
    "wait": "292017.668117248s",               
    "until": "2024-01-12T08:00:00.000001993Z"
  }
```

## Changes
Set the `until` field in the PoetWaitRound, PoetWaitProof, AtxPublished event.

This change depends on spacemeshos/api#297. ~~Updates to go.mod/go.sum are pending until a new tagged version of `api`.~~

## Test Plan
Manual testing

## TODO
<!-- This section should be removed when all items are complete -->
- [X] Explain motivation or link existing issue(s)
- [X] Test changes and document test plan
- [ ] Update documentation as needed
- [ ] Update [changelog](../CHANGELOG.md) as needed
@spacemesh-bors
Copy link

Pull request successfully merged into develop.

Build succeeded:

@spacemesh-bors spacemesh-bors bot changed the title Add "until" field to PoetWaitRound, PoetWaitProof, AtxPublished events [Merged by Bors] - Add "until" field to PoetWaitRound, PoetWaitProof, AtxPublished events Jan 22, 2024
@spacemesh-bors spacemesh-bors bot closed this Jan 22, 2024
@xearl4 xearl4 deleted the add-until branch January 22, 2024 13:52
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