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

Queries for getting which accounts have scheduled releases or cooldowns. #67

Merged
merged 2 commits into from
Nov 27, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,11 @@
events to `BakerEvent`.
- Add `GetConsensusDetailedStatus` endpoint for querying detailed consensus
status information.
- Add `GetScheduledReleaseAccounts` endpoint for querying the list of accounts that
have scheduled releases.
- Add `GetCooldownAccounts`, `GetPreCooldownAccounts` and `GetPrePreCooldownAccounts`
endpoints for querying the lists of account that have pending cooldowns in protocol
td202 marked this conversation as resolved.
Show resolved Hide resolved
version 7 onwards.

## Node 7.0 API

Expand Down
19 changes: 19 additions & 0 deletions v2/concordium/service.proto
Original file line number Diff line number Diff line change
Expand Up @@ -174,6 +174,25 @@ service Queries {
// Get next available sequence numbers for updating chain parameters after a given block.
rpc GetNextUpdateSequenceNumbers (BlockHashInput) returns (NextUpdateSequenceNumbers);

// Get all accounts that have scheduled releases, with the timestamp of the first pending
// scheduled release for that account. (Note, this only identifies accounts by index, and
td202 marked this conversation as resolved.
Show resolved Hide resolved
// only indicates the first pending release for each account.)
rpc GetScheduledReleaseAccounts (BlockHashInput) returns (stream AccountPending);

// Get all accounts that have stake in cooldown, with the timestamp of the first pending
// cooldown expiry for each account. (Note, this only identifies accounts by index,
// and only indicates the first pending cooldown for each account.)
// Prior to protocol version 7, the resulting stream will always be empty.
rpc GetCooldownAccounts (BlockHashInput) returns (stream AccountPending);

// Get all accounts (by account index) that have stake in pre-cooldown.
td202 marked this conversation as resolved.
Show resolved Hide resolved
// Prior to protocol version 7, the resulting stream will always be empty.
rpc GetPreCooldownAccounts (BlockHashInput) returns (stream AccountIndex);

// Get all accounts (by account index) that have stake in pre-pre-cooldown.
td202 marked this conversation as resolved.
Show resolved Hide resolved
// Prior to protocol version 7, the resulting stream will always be empty.
rpc GetPrePreCooldownAccounts (BlockHashInput) returns (stream AccountIndex);

// Get the projected earliest time at which a particular baker will be required to bake a block.
// If the current consensus version is 0, this returns the status 'Unavailable', as the endpoint
// is only supported by consensus version 1.
Expand Down
7 changes: 7 additions & 0 deletions v2/concordium/types.proto
Original file line number Diff line number Diff line change
Expand Up @@ -3929,3 +3929,10 @@ message ConsensusDetailedStatus {
// If a protocol update has occurred, this is the hash of the terminal block.
optional BlockHash terminal_block = 16;
}

// Indicates that an account is pending -- either a scheduled release or a cooldown -- and
// when the first release or cooldown will elapse.
message AccountPending {
AccountIndex account_index = 1;
Timestamp first_timestamp = 2;
}