Skip to content

Commit

Permalink
updates
Browse files Browse the repository at this point in the history
  • Loading branch information
aaronc committed Sep 4, 2024
1 parent 1fafd8b commit 82d80c1
Showing 1 changed file with 17 additions and 1 deletion.
18 changes: 17 additions & 1 deletion docs/rfc/rfc-007-crosslang-state.md
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ The state API defines the following messages:

#### `cosmos.state.v1.new_branch`

Takes no parameters and returns a new volatile state token which branches/caches off the current state token as **output parameter 1**. Retuns an error if the current state token is not in a valid state to branch off of.
Takes no parameters and returns a new volatile state token which branches/caches off the current state token as **output parameter 1**. Returns an error if the current state token is not in a valid state to branch off of.

#### `cosmos.state.v1.commit`

Expand All @@ -41,25 +41,34 @@ Takes no parameters and rolls back any changes to the branched state token in th
* Output Parameter 1: `value`
* Errors: `key_not_found`

A 64kb packet size is suggested with the key at offset 16,384 and the value at offset 32,768.

#### `cosmos.kvstore.v1.set`

* Volatility: Volatile
* Input Parameter 1: `key`
* Input Parameter 2: `value`
* Errors: None
* Suggested packet size: 64kb

The same packet utilization as get is suggested.

#### `cosmos.kvstore.v1.delete`

* Volatility: Volatile
* Input Parameters 1: `key`
* Errors: None (should there be an error for key not found?)

The suggested packet size is 32kb with the key at offset 16,384.

#### `cosmos.kvstore.v1.has`

* Volatility: Readonly
* Input Parameter 1: `key`
* Errors: `not_found`

The same packet utilization as delete is suggested.

### Ordered KV Store API

#### `cosmos.orderedkvstore.v1.iterator`
Expand All @@ -70,6 +79,9 @@ Takes no parameters and rolls back any changes to the branched state token in th
* Output Parameter 1: `iterator` - 32 bytes that are to be used as the next state token
* Errors: None

The suggested packet size is 32kb with the start key at offset 16,384 and the end key at offset 32,768,
and iterator at any offset not otherwise used.

#### `cosmos.orderedkvstore.v1.reverse_iterator`

* Volatility: Readonly
Expand All @@ -78,6 +90,8 @@ Takes no parameters and rolls back any changes to the branched state token in th
* Output Parameter 1: `iterator` - 32 bytes that are to be used as the next state token
* Errors: None

The same packet utilization as iterator is suggested.

#### `cosmos.orderedkvstore.v1.iterator_next`

* Volatility: Readonly
Expand All @@ -86,6 +100,8 @@ Takes no parameters and rolls back any changes to the branched state token in th
* Output Parameter 2: `value`
* Errors: `iterator_done`

The same packet utilization as get is suggested.

#### `cosmos.orderedkvstore.v1.iterator_close`

* Volatility: Readonly
Expand Down

0 comments on commit 82d80c1

Please sign in to comment.