Skip to content

Commit b65cdc6

Browse files
authored
changelog for SDK v0.5.5 & CLI v0.1.6 (#50)
* docs for SDK v0.5.5 & CLI v0.1.6 * add details on action max size enforcement * update changelog for latest changes in CLI v0.1.6 * improve sequencer strategy example * apply review suggestion
1 parent 89e8d68 commit b65cdc6

File tree

7 files changed

+55
-93
lines changed

7 files changed

+55
-93
lines changed

docs/pages/build/changelog.mdx

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,31 @@
11
# Changelog [What's new]
22

3+
## v0.5.5
4+
5+
#### Breaking changes
6+
7+
- The [`getOrderedActions`](/build/framework/sequencer#custom-ordering-strategy) method of a sequencer strategy now accepts a list of actions
8+
as a `Readonly<AcknowledgedAction[]>` type and is supposed only to return the ordered list of action hashes as opposed to `Action` objects earlier.
9+
10+
#### Bug Fixes
11+
12+
- Fix BigInt handling for PostgreSQL.
13+
14+
#### Improvements
15+
16+
- Enable [WAL](https://www.sqlite.org/draft/wal.html) for SQLite. This enables better concurrency between readers and writers.
17+
- Optimized execution time by removing duplicate calculation of state root before and after applying all of the block's actions.
18+
- Enforce max size on action's payload during submission (~128kb). This limit is also enforced when collecting actions for block building.
19+
20+
#### Other changes
21+
22+
- Bumps dependencies version to address high-security vulnerabilities
23+
24+
## CLI v0.1.6
25+
26+
- Remove the `add hook` command.
27+
- Perform lint checks in `compile` command before building Wasm. This makes use of [`@stackr/eslint-plugin`](https://github.com/stackrlabs/eslint-stackr), an ESLint plugin with few rules to prevent devs from adding non-deterministic code in transition functions.
28+
329
## CLI v0.1.5
430

531
- The EIP-712 domain for the app is now injected into the `stf.wasm`.

docs/pages/build/cli/add-bridge.mdx

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ USAGE
1010
$ stackr add [ENTITY] [CONTRACT] [--envFile <value>]
1111

1212
ARGUMENTS
13-
ENTITY (bridge|hook) Entity to add to your App Inbox
13+
ENTITY (bridge) Entity to add to your App Inbox
1414
CONTRACT Contract Address of the entity to add to your App Inbox
1515

1616
FLAGS
@@ -19,9 +19,7 @@ FLAGS
1919
EXAMPLES
2020
$ stackr add bridge 0x1234567890abcdef1234567890abcdef12345678
2121

22-
$ stackr add hook 0x1234567890abcdef1234567890abcdef12345678
23-
24-
$ stackr add hook 0x1234567890abcdef1234567890abcdef12345678 --envFile=<relative path to file>
22+
$ stackr add bridge 0x1234567890abcdef1234567890abcdef12345678 --envFile=<relative path to file>
2523
```
2624

2725
## Example

docs/pages/build/cli/add-hook.mdx

Lines changed: 0 additions & 69 deletions
This file was deleted.

docs/pages/build/cli/compile.mdx

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,8 @@
22

33
The `compile` command is used to compile your Micro-Rollup's State Machine to portable WebAssembly (Wasm) binary.
44

5+
Before compiling, it also performs lint checks using the [`@stackr/eslint-plugin`](https://github.com/stackrlabs/eslint-stackr), an ESLint plugin with few rules to prevent devs from adding non-deterministic code in transition functions.
6+
57
:::info
68
Generally, you wouldn't use this command manually since the [`deploy`]((/build/cli/deploy)) command takes care of this step internally.
79
:::
@@ -11,10 +13,14 @@ Generally, you wouldn't use this command manually since the [`deploy`]((/build/c
1113
```bash
1214
» stackr compile --help
1315
USAGE
14-
$ stackr compile
16+
$ stackr compile [--skipLintChecks]
17+
18+
FLAGS
19+
--skipLintChecks Whether to skip lint checks before compiling (default: false)
1520

1621
EXAMPLES
1722
$ stackr compile
23+
$ stackr compile --skipLintChecks
1824
```
1925

2026
## Example

docs/pages/build/framework/action/introduction.mdx

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -87,6 +87,10 @@ These are state transition functions that you will be defining in the `src/stack
8787
On succesful submission, you will recieve an `Acknowledment` object that acts like a transaction receipt and is also considered a `C0` confirmation.
8888
This is proof of the action being successfully submitted to the state machine.
8989

90+
:::note
91+
An action's payload size should not exceed ~128kb. This limit is enforced to keep batch size well within the means of different DA layer's maximum supported blob size.
92+
:::
93+
9094
## EIP-712 Signing
9195

9296
EIP 712 is a standard for signing structured data. It is used to sign actions in this version of Stackr.

docs/pages/build/framework/sequencer.mdx

Lines changed: 15 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -43,38 +43,39 @@ This is done by defining a new class that extends `BaseStrategy` class with the
4343
:::code-group
4444

4545
```ts [strategy.ts]
46-
import { BaseStrategy, Action } from "@stackr/sdk";
46+
import { AcknowledgedAction, BaseStrategy, Keccak256 } from "@stackr/sdk";
4747

4848
/**
49-
* RandomStrategy is responsible for ordering actions in a random order.
49+
* TimestampOrderStrategy is responsible for ordering actions based on timestamp.
5050
*/
51-
export class RandomStrategy extends BaseStrategy {
51+
export class TimestampOrderStrategy extends BaseStrategy {
5252
/**
53-
* Create a new instance of RandomStrategy
53+
* Create a new instance of TimestampOrderStrategy
5454
*/
5555
constructor() {
56-
super("RandomOrder");
56+
super("TimestampOrder");
5757
}
5858

5959
/**
60-
* Custom ordering logic for actions
61-
* returns the actions in a random order
60+
* Returns the action hashes in chronological order of timestamp.
6261
* @param actions - Unordered List of actions
63-
* @returns - Ordered list of actions
62+
* @returns - Ordered list of action hashes
6463
*/
65-
async getOrderedActions(actions: Action[]): Promise<Action[]> {
66-
return Promise.resolve(
67-
actions.sort(() => {
68-
return 0.5 - Math.random();
69-
})
64+
async getOrderedActions(
65+
actions: Readonly<AcknowledgedAction[]>
66+
): Promise<Keccak256[]> {
67+
const orderedActions = actions.sort(
68+
(a, b) => a.acknowledgement.timestamp - b.acknowledgement.timestamp
7069
);
70+
const orderedActionHashes = orderedActions.map(({ action }) => action.hash);
71+
return orderedActionHashes;
7172
}
7273
}
7374
```
7475

7576
```ts [rollup.ts]
7677
// use the custom strategy class in your Micro-Rollup
77-
rollup.sequencer.setStrategy(new RandomStrategy());
78+
rollup.sequencer.setStrategy(new TimestampOrderStrategy());
7879
```
7980

8081
:::

vocs.config.ts

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@ export default defineConfig({
3636
link: "https://litepaper.stf.xyz",
3737
},
3838
{
39-
text: "v0.5.4",
39+
text: "v0.5.5",
4040
items: [
4141
{
4242
text: "Changelog",
@@ -372,10 +372,6 @@ export default defineConfig({
372372
text: "Add Bridge",
373373
link: "/build/cli/add-bridge",
374374
},
375-
{
376-
text: "Add Hook",
377-
link: "/build/cli/add-hook",
378-
},
379375
{
380376
text: "Transfer Ownership",
381377
link: "/build/cli/transfer-ownership",

0 commit comments

Comments
 (0)