Skip to content

Commit

Permalink
grpc deferred call quote
Browse files Browse the repository at this point in the history
  • Loading branch information
modship committed Sep 25, 2024
1 parent 20a40b2 commit 4b10def
Show file tree
Hide file tree
Showing 3 changed files with 184 additions and 14 deletions.
114 changes: 108 additions & 6 deletions doc/api.html
Original file line number Diff line number Diff line change
Expand Up @@ -437,6 +437,14 @@ <h2>Table of Contents</h2>
<a href="#massa.api.v1.CycleInfos"><span class="badge">M</span>CycleInfos</a>
</li>

<li>
<a href="#massa.api.v1.DeferredCallQuote"><span class="badge">M</span>DeferredCallQuote</a>
</li>

<li>
<a href="#massa.api.v1.DeferredCallQuoteResponse"><span class="badge">M</span>DeferredCallQuoteResponse</a>
</li>

<li>
<a href="#massa.api.v1.DeferredCreditsEntry"><span class="badge">M</span>DeferredCreditsEntry</a>
</li>
Expand Down Expand Up @@ -2424,8 +2432,10 @@ <h3 id="massa.api.v1.AsyncPoolChangesFilter">AsyncPoolChangesFilter</h3>
<td>can_be_executed</td>
<td><a href="#bool">bool</a></td>
<td></td>
<td><p>Boolean that determine if the message can be executed. For messages without filter this boolean is always true.
For messages with filter, this boolean is true if the filter has been matched between `validity_start` and current slot. </p></td>
<td><p>Boolean that determine if the message can be executed. For messages
without filter this boolean is always true. For messages with filter,
this boolean is true if the filter has been matched between
`validity_start` and current slot. </p></td>
</tr>

</tbody>
Expand Down Expand Up @@ -2456,7 +2466,84 @@ <h3 id="massa.api.v1.CycleInfos">CycleInfos</h3>
<td>restrict_to_addresses</td>
<td><a href="#string">string</a></td>
<td>repeated</td>
<td><p>Addresses to restrict the query (if None, info for all addresses will be returned) </p></td>
<td><p>Addresses to restrict the query (if None, info for all addresses will be
returned) </p></td>
</tr>

</tbody>
</table>





<h3 id="massa.api.v1.DeferredCallQuote">DeferredCallQuote</h3>
<p>Deferred call quote</p>


<table class="field-table">
<thead>
<tr><td>Field</td><td>Type</td><td>Label</td><td>Description</td></tr>
</thead>
<tbody>

<tr>
<td>target_slot</td>
<td><a href="#massa.model.v1.Slot">massa.model.v1.Slot</a></td>
<td></td>
<td><p> </p></td>
</tr>

<tr>
<td>max_gas_request</td>
<td><a href="#uint64">uint64</a></td>
<td></td>
<td><p> </p></td>
</tr>

</tbody>
</table>





<h3 id="massa.api.v1.DeferredCallQuoteResponse">DeferredCallQuoteResponse</h3>
<p>deferred call quote response</p>


<table class="field-table">
<thead>
<tr><td>Field</td><td>Type</td><td>Label</td><td>Description</td></tr>
</thead>
<tbody>

<tr>
<td>target_slot</td>
<td><a href="#massa.model.v1.Slot">massa.model.v1.Slot</a></td>
<td></td>
<td><p>the slot requested </p></td>
</tr>

<tr>
<td>max_gas_request</td>
<td><a href="#uint64">uint64</a></td>
<td></td>
<td><p>The gas requested </p></td>
</tr>

<tr>
<td>available</td>
<td><a href="#bool">bool</a></td>
<td></td>
<td><p>if the quote is available </p></td>
</tr>

<tr>
<td>price</td>
<td><a href="#massa.model.v1.NativeAmount">massa.model.v1.NativeAmount</a></td>
<td></td>
<td><p>The amount </p></td>
</tr>

</tbody>
Expand Down Expand Up @@ -2936,6 +3023,13 @@ <h3 id="massa.api.v1.ExecutionQueryRequestItem">ExecutionQueryRequestItem</h3>
<td><p>Gets filtered events </p></td>
</tr>

<tr>
<td>deferred_call_quote</td>
<td><a href="#massa.api.v1.DeferredCallQuote">DeferredCallQuote</a></td>
<td></td>
<td><p>Deferred call quote </p></td>
</tr>

</tbody>
</table>

Expand Down Expand Up @@ -3047,6 +3141,13 @@ <h3 id="massa.api.v1.ExecutionQueryResponseItem">ExecutionQueryResponseItem</h3>
<td><p>Events </p></td>
</tr>

<tr>
<td>deferred_call_quote</td>
<td><a href="#massa.api.v1.DeferredCallQuoteResponse">DeferredCallQuoteResponse</a></td>
<td></td>
<td><p>Deferred call quote </p></td>
</tr>

</tbody>
</table>

Expand Down Expand Up @@ -3752,7 +3853,7 @@ <h3 id="massa.api.v1.GetTransactionsThroughputRequest">GetTransactionsThroughput


<h3 id="massa.api.v1.GetTransactionsThroughputResponse">GetTransactionsThroughputResponse</h3>
<p>GetTransactionsThroughputResponse holds response from GetTransactionsThroughput</p>
<p>GetTransactionsThroughputResponse holds response from</p><p>GetTransactionsThroughput</p>


<table class="field-table">
Expand Down Expand Up @@ -5321,7 +5422,7 @@ <h3 id="massa.api.v1.ExecutionQueryExecutionStatus">ExecutionQueryExecutionStatu
<tr>
<td>EXECUTION_QUERY_EXECUTION_STATUS_EXECUTABLE_OR_EXPIRED</td>
<td>3</td>
<td><p>The operation or denunciation was not executed recently but can still be executed unless expired</p></td>
<td><p>The operation or denunciation was not executed recently but can</p></td>
</tr>

</tbody>
Expand Down Expand Up @@ -5484,7 +5585,8 @@ <h3 id="massa.api.v1.PublicService">PublicService</h3>
<td>GetSlotABICallStacks</td>
<td><a href="#massa.api.v1.GetSlotABICallStacksRequest">GetSlotABICallStacksRequest</a></td>
<td><a href="#massa.api.v1.GetSlotABICallStacksResponse">GetSlotABICallStacksResponse</a></td>
<td><p>Get ABI call stack of all asynchronous executions and all operations for a given slot</p></td>
<td><p>Get ABI call stack of all asynchronous executions and all operations for a
given slot</p></td>
</tr>

<tr>
Expand Down
43 changes: 41 additions & 2 deletions doc/api.md
Original file line number Diff line number Diff line change
Expand Up @@ -69,6 +69,8 @@
- [AddressRollsFinal](#massa-api-v1-AddressRollsFinal)
- [AsyncPoolChangesFilter](#massa-api-v1-AsyncPoolChangesFilter)
- [CycleInfos](#massa-api-v1-CycleInfos)
- [DeferredCallQuote](#massa-api-v1-DeferredCallQuote)
- [DeferredCallQuoteResponse](#massa-api-v1-DeferredCallQuoteResponse)
- [DeferredCreditsEntry](#massa-api-v1-DeferredCreditsEntry)
- [DeferredCreditsEntryWrapper](#massa-api-v1-DeferredCreditsEntryWrapper)
- [DenunciationExecutionStatusCandidate](#massa-api-v1-DenunciationExecutionStatusCandidate)
Expand Down Expand Up @@ -1054,6 +1056,40 @@ Request to get all information for a given cycle



<a name="massa-api-v1-DeferredCallQuote"></a>

### DeferredCallQuote
Deferred call quote


| Field | Type | Label | Description |
| ----- | ---- | ----- | ----------- |
| target_slot | [massa.model.v1.Slot](#massa-model-v1-Slot) | | |
| max_gas_request | [uint64](#uint64) | | |






<a name="massa-api-v1-DeferredCallQuoteResponse"></a>

### DeferredCallQuoteResponse
deferred call quote response


| Field | Type | Label | Description |
| ----- | ---- | ----- | ----------- |
| target_slot | [massa.model.v1.Slot](#massa-model-v1-Slot) | | the slot requested |
| max_gas_request | [uint64](#uint64) | | The gas requested |
| available | [bool](#bool) | | if the quote is available |
| price | [massa.model.v1.NativeAmount](#massa-model-v1-NativeAmount) | | The amount |






<a name="massa-api-v1-DeferredCreditsEntry"></a>

### DeferredCreditsEntry
Expand Down Expand Up @@ -1255,6 +1291,7 @@ Query state query item
| address_deferred_credits_final | [AddressDeferredCreditsFinal](#massa-api-v1-AddressDeferredCreditsFinal) | | Gets the deferred credits (final) of an address |
| cycle_infos | [CycleInfos](#massa-api-v1-CycleInfos) | | Gets all information for a given cycle |
| events | [Events](#massa-api-v1-Events) | | Gets filtered events |
| deferred_call_quote | [DeferredCallQuote](#massa-api-v1-DeferredCallQuote) | | Deferred call quote |



Expand Down Expand Up @@ -1294,6 +1331,7 @@ Execution state query response item
| execution_status | [ExecutionQueryExecutionStatus](#massa-api-v1-ExecutionQueryExecutionStatus) | | Execution status value |
| cycle_infos | [ExecutionQueryCycleInfos](#massa-api-v1-ExecutionQueryCycleInfos) | | Cycle infos value |
| events | [ScOutputEventsWrapper](#massa-api-v1-ScOutputEventsWrapper) | | Events |
| deferred_call_quote | [DeferredCallQuoteResponse](#massa-api-v1-DeferredCallQuoteResponse) | | Deferred call quote |



Expand Down Expand Up @@ -1742,7 +1780,8 @@ GetTransactionsThroughputRequest holds request for GetTransactionsThroughput
<a name="massa-api-v1-GetTransactionsThroughputResponse"></a>

### GetTransactionsThroughputResponse
GetTransactionsThroughputResponse holds response from GetTransactionsThroughput
GetTransactionsThroughputResponse holds response from
GetTransactionsThroughput


| Field | Type | Label | Description |
Expand Down Expand Up @@ -2561,7 +2600,7 @@ Execution status of an operation or denunciation
| EXECUTION_QUERY_EXECUTION_STATUS_UNSPECIFIED | 0 | Default enum value |
| EXECUTION_QUERY_EXECUTION_STATUS_ALREADY_EXECUTED_WITH_SUCCESS | 1 | The operation or denunciation was executed recently with success |
| EXECUTION_QUERY_EXECUTION_STATUS_ALREADY_EXECUTED_WITH_FAILURE | 2 | The operation or denunciation was executed recently with failure |
| EXECUTION_QUERY_EXECUTION_STATUS_EXECUTABLE_OR_EXPIRED | 3 | The operation or denunciation was not executed recently but can still be executed unless expired |
| EXECUTION_QUERY_EXECUTION_STATUS_EXECUTABLE_OR_EXPIRED | 3 | The operation or denunciation was not executed recently but can |



Expand Down
41 changes: 35 additions & 6 deletions proto/apis/massa/api/v1/public.proto
Original file line number Diff line number Diff line change
Expand Up @@ -159,7 +159,8 @@ service PublicService {
};
}

// Get ABI call stack of all asynchronous executions and all operations for a given slot
// Get ABI call stack of all asynchronous executions and all operations for a
// given slot
rpc GetSlotABICallStacks(GetSlotABICallStacksRequest) returns (GetSlotABICallStacksResponse) {
option (google.api.http) = {
post: "/v1/get_slot_abi_call_stacks"
Expand Down Expand Up @@ -384,7 +385,8 @@ message GetStakersResponse {
// GetTransactionsThroughputRequest holds request for GetTransactionsThroughput
message GetTransactionsThroughputRequest {}

// GetTransactionsThroughputResponse holds response from GetTransactionsThroughput
// GetTransactionsThroughputResponse holds response from
// GetTransactionsThroughput
message GetTransactionsThroughputResponse {
// Transactions throughput
uint32 throughput = 1;
Expand Down Expand Up @@ -439,6 +441,8 @@ message ExecutionQueryRequestItem {
CycleInfos cycle_infos = 19;
// Gets filtered events
Events events = 20;
// Deferred call quote
DeferredCallQuote deferred_call_quote = 21;
}
}

Expand Down Expand Up @@ -562,7 +566,8 @@ message AddressDeferredCreditsFinal {
message CycleInfos {
// Cycle to query
uint64 cycle = 1;
// Addresses to restrict the query (if None, info for all addresses will be returned)
// Addresses to restrict the query (if None, info for all addresses will be
// returned)
repeated string restrict_to_addresses = 2;
}

Expand All @@ -572,6 +577,25 @@ message Events {
repeated ScExecutionEventsFilter filters = 1;
}

// Deferred call quote
message DeferredCallQuote {
massa.model.v1.Slot target_slot = 1;

uint64 max_gas_request = 2;
}

// deferred call quote response
message DeferredCallQuoteResponse {
// the slot requested
massa.model.v1.Slot target_slot = 1;
// The gas requested
uint64 max_gas_request = 2;
// if the quote is available
bool available = 3;
// The amount
massa.model.v1.NativeAmount price = 4;
}

// Response to atomically execute a batch of execution state queries
message QueryStateResponse {
// Final cursor position
Expand Down Expand Up @@ -616,6 +640,8 @@ message ExecutionQueryResponseItem {
ExecutionQueryCycleInfos cycle_infos = 8;
// Events
ScOutputEventsWrapper events = 9;
// Deferred call quote
DeferredCallQuoteResponse deferred_call_quote = 10;
}
}

Expand All @@ -638,7 +664,8 @@ enum ExecutionQueryExecutionStatus {
EXECUTION_QUERY_EXECUTION_STATUS_UNSPECIFIED = 0; // Default enum value
EXECUTION_QUERY_EXECUTION_STATUS_ALREADY_EXECUTED_WITH_SUCCESS = 1; // The operation or denunciation was executed recently with success
EXECUTION_QUERY_EXECUTION_STATUS_ALREADY_EXECUTED_WITH_FAILURE = 2; // The operation or denunciation was executed recently with failure
EXECUTION_QUERY_EXECUTION_STATUS_EXECUTABLE_OR_EXPIRED = 3; // The operation or denunciation was not executed recently but can still be executed unless expired
EXECUTION_QUERY_EXECUTION_STATUS_EXECUTABLE_OR_EXPIRED = 3; // The operation or denunciation was not executed recently but can
// still be executed unless expired
}

// Cycle information for execution query
Expand Down Expand Up @@ -830,8 +857,10 @@ message AsyncPoolChangesFilter {
string destination_address = 4;
// The address that sent the message
string emitter_address = 5;
// Boolean that determine if the message can be executed. For messages without filter this boolean is always true.
// For messages with filter, this boolean is true if the filter has been matched between `validity_start` and current slot.
// Boolean that determine if the message can be executed. For messages
// without filter this boolean is always true. For messages with filter,
// this boolean is true if the filter has been matched between
// `validity_start` and current slot.
bool can_be_executed = 6;
}
}
Expand Down

0 comments on commit 4b10def

Please sign in to comment.