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

Add GetTransactionExecutionMetricsAfter #1501

Merged
83 changes: 74 additions & 9 deletions protobuf/flow/execution/execution.proto
Original file line number Diff line number Diff line change
Expand Up @@ -50,18 +50,22 @@ service ExecutionAPI {
rpc GetTransactionResultsByBlockID(GetTransactionsByBlockIDRequest)
returns (GetTransactionResultsResponse);

// GetTransactionErrorMessage gets the error messages of a failed transaction by id.
// GetTransactionErrorMessage gets the error messages of a failed transaction
// by id.
rpc GetTransactionErrorMessage(GetTransactionErrorMessageRequest)
returns (GetTransactionErrorMessageResponse);
returns (GetTransactionErrorMessageResponse);

// GetTransactionErrorMessageByIndex gets the error messages of a failed transaction at the index.
rpc GetTransactionErrorMessageByIndex(GetTransactionErrorMessageByIndexRequest)
returns (GetTransactionErrorMessageResponse);
// GetTransactionErrorMessageByIndex gets the error messages of a failed
// transaction at the index.
rpc GetTransactionErrorMessageByIndex(
GetTransactionErrorMessageByIndexRequest)
returns (GetTransactionErrorMessageResponse);

// GetTransactionErrorMessagesByBlockID gets the error messages of all failed transactions in the
// block ordered by transaction index.
rpc GetTransactionErrorMessagesByBlockID(GetTransactionErrorMessagesByBlockIDRequest)
returns (GetTransactionErrorMessagesResponse);
// GetTransactionErrorMessagesByBlockID gets the error messages of all failed
// transactions in the block ordered by transaction index.
rpc GetTransactionErrorMessagesByBlockID(
GetTransactionErrorMessagesByBlockIDRequest)
returns (GetTransactionErrorMessagesResponse);

// Registers

Expand All @@ -75,9 +79,24 @@ service ExecutionAPI {
// GetLatestBlockHeader gets the latest sealed or unsealed block header.
rpc GetLatestBlockHeader(GetLatestBlockHeaderRequest)
returns (BlockHeaderResponse);

// GetBlockHeaderByID gets a block header by ID.
rpc GetBlockHeaderByID(GetBlockHeaderByIDRequest)
returns (BlockHeaderResponse);

// GetTransactionExecutionMetricsAfter gets the transaction execution metrics
// for blocks after the given block height. The blocks will be sorted by
// descending block height.
// If no data is available for the given block height, the response will be
// empty. The execution node will only store metrics for a limited number of
// blocks,  so the request may return an empty response if the requested
// block height is too far in the past.
//
// Errors:
// - No errors are expected.
rpc GetTransactionExecutionMetricsAfter(
GetTransactionExecutionMetricsAfterRequest)
returns (GetTransactionExecutionMetricsAfterResponse);
}

// Ping
Expand Down Expand Up @@ -211,3 +230,49 @@ message GetBlockHeaderByIDRequest {
message BlockHeaderResponse {
entities.BlockHeader block = 1;
}


// The request for GetTransactionExecutionMetricsAfter
message GetTransactionExecutionMetricsAfterRequest {
// Block height after which to get transaction execution metrics.
// this block height will not be included in the response.
uint64 block_height = 1;
}

// The response for GetTransactionExecutionMetricsAfter
// The response contains the execution metrics for transactions in each block
// after the requested block height. The execution node only keeps a limited
janezpodhostnik marked this conversation as resolved.
Show resolved Hide resolved
// number of blocks in memory, so the response may not contain metrics for all
// blocks. Only finalized and executed blocks will be in the response.
// The blocks are sorted by block height in descending order.
message GetTransactionExecutionMetricsAfterResponse {
// the execution effort weight of a computation kind
message ExecutionEffortWeight {
// computation kind id
uint64 kind = 1;
// the weight of the computation kind
uint64 weight = 2;
}

// the data for one transaction
message Transaction {
// the transaction id
bytes transaction_id = 1;
// the execution time of the transaction in nanoseconds
uint64 execution_time = 2;
// the execution effort weights of the transaction
repeated ExecutionEffortWeight execution_effort_weights = 3;
}

// the data for one block
message Result {
// the block height of the block
uint64 block_height = 1;
// the list of transactions in the block
repeated Transaction transactions = 2;
}

// a list of results for each block sorted by block height in
// descending order
repeated Result results = 1;
}
Loading
Loading