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

Polish mod5 content for publishing #859

Merged
merged 3 commits into from
Aug 14, 2023
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
2 changes: 1 addition & 1 deletion assets/img/5-Substrate/dev-4-1-comms-format.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
2 changes: 1 addition & 1 deletion assets/img/5-Substrate/dev-4-1-substrate-meta.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
1 change: 1 addition & 0 deletions assets/img/5-Substrate/dev-trie-backend-16-with-size.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Original file line number Diff line number Diff line change
Expand Up @@ -348,6 +348,11 @@ _The way to make a protocol truly upgradeable is to design a meta-protocol that

<img src="../../assets/img/5-Substrate/dev-4-1-substrate-meta.svg" />

Note:

In this figure, the meta-protocol, the substrate client, is not forklessly upgrade-able. It can only
be upgraded with a fork. The WASM protocol, though, can be upgraded forklessly.

---v

### 🏦 Governance + Upgradeability
Expand Down Expand Up @@ -588,8 +593,6 @@ bug in it, everyone is affected.
## Consensus <> Runtime 🤔

- Yes, consensus is not a core part of a blockchain runtime. Why?
- Not often customized.
<!-- .element: class="fragment" -->
- Not part of your STF!
<!-- .element: class="fragment" -->
- The consensus protocol is to your runtime what HTTP is to Facebook.
Expand Down Expand Up @@ -996,11 +999,9 @@ exception](https://www.gnu.org/software/classpath/license.html).

- Currently, the Wasm binary spec v1 is used, read more about the new version here: https://webassembly.github.io/spec/core/binary/index.html

### Post Lecture Notes
### Post Lecture Feedback

- a takeaway after each section, more clear path (shawn).
- people confuse that the client is not upgradeable AT ALL. Mention more that it is, just with forks.
- Make the arrow bidirectional in communication paths.

---

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1414,8 +1414,6 @@ SomeExternalities.execute_with(|| {

### Post Lecture Notes

- Resource management (block length, weight) is dictated by the runtime.

---

## Appendix
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -424,6 +424,16 @@ size and the cost of reading/writing/encoding/decoding all these nodes.

### Base 2, Base 16, Base-26?

<img style="width: 1400px;" src="../../assets/img/5-Substrate/dev-trie-backend-16-with-size.svg" />

Note:

Here's a different way to represent it; the nodes are bigger on the base-16 trie.

---v

### Base 2, Base 16, Base-26?

- base-2: Small proofs, more nodes.
- base-8: Bigger proofs, less nodes.

Expand Down Expand Up @@ -614,8 +624,6 @@ with_storage_layer(|| {
Notes:

- implement with zero-copy. So, the size of values is not so important, it is more about the number.
- TODO: This `with_storage_layer` is currently in FRAME, but it could technically be in primitives,
as there is nothing frame specific about it.

---v

Expand Down Expand Up @@ -847,7 +855,9 @@ Notes:
about what a state transition is. The runtime is the state transition function. Recall the formula
of that, and then you will know why this is not allowed.

## Post Lecture
### Post Lecture Feedback

Double check the narrative and example of the `BIG_STUFF` node. An example/exercise of some sort
would be great, where students call a bunch of `sp_io` functions, visualize the trie, and invoke
proof recorder, and see which pars of the trie is exactly part of the proof.

From Shawn: my narrative of big_stuff still seems incorrect; 100% double check it before going any
further.
Original file line number Diff line number Diff line change
Expand Up @@ -185,8 +185,6 @@ note:
imagine that you have a crate that has some additional features that are not always needed. You put
that behind a feature flag called `additional-features`.

TODO: feature flags should be part of the rust entrance exam.

---v

### Cargo Features: Substrate Wasm Crates
Expand Down Expand Up @@ -843,8 +841,6 @@ Notes:

often times, in examples above, you have to use this syntax: https://doc.rust-lang.org/book/ch19-03-advanced-traits.html#fully-qualified-syntax-for-disambiguation-calling-methods-with-the-same-name

TODO: we should explicitly add this to the exam as well.

---

## Implementing Traits For Tuples
Expand Down Expand Up @@ -1157,7 +1153,7 @@ Notes:
- Update on defensive ops: https://github.com/paritytech/substrate/pull/12967
- Next time, talk about making a storage struct be `<T: Config>`.
- Cargo format

TODO:

- SignedExtension should technically be part of the substrate module. Integrate it in the assignment, perhaps.
- SignedExtension should technically be part of the substrate module. Integrate it in the
assignment, perhaps.
- A section about `XXXNoBound` traits.
- A section about reading your compiler errors top to bottom, especially with an example in FRAME.
Original file line number Diff line number Diff line change
Expand Up @@ -191,4 +191,7 @@ Simply search the trait in the rust-docs, and find the implementors!

<img width="300px" rounded src="../../assets/img/5-Substrate/thats_all_folks.png" />

Notes:
Note:

One important concept that is important to substrate-based chains, but is somewhat missing here is
`chain-spec`. Make sure to read up about it in the substrate docs.
Original file line number Diff line number Diff line change
Expand Up @@ -72,8 +72,6 @@ almost all external communication happens over JSPN-RPC, so let's take a closer

Notes:

TODO: @NukeManDan a proper solution for list with fragments would be good, see: https://github.com/hakimel/reveal.js/issues/1848

recall:

https://paritytech.github.io/substrate/master/sc_rpc_api/index.html
Expand Down Expand Up @@ -251,19 +249,6 @@ https://polkadot.js.org/docs/substrate/rpc#getstoragekey-storagekey-at-blockhash
await api.rpc.state.getStorageSize("0x3A636F6465"),
```

light client:

TODO: needs fixing

```ts
import { ScProvider } from "@polkadot/rpc-provider/substrate-connect";
import * as Sc from "@substrate/connect";

const lightProvider = new ScProvider(Sc, Sc.WellKnownChain.polkadot);
await lightProvider.connect();
const lightApi = await ApiPromise.create({ lightProvider });
```

A few random other things:

```ts
Expand Down Expand Up @@ -294,14 +279,3 @@ Notes:
- see "Client Libraries" here: https://project-awesome.org/substrate-developer-hub/awesome-substrate
- https://paritytech.github.io/json-rpc-interface-spec/introduction.html
- Full subxt guide: https://docs.rs/subxt/latest/subxt/book/index.html

TODO: further assignment idea:

- build a custom chain spec, then run it

- Use `curl` and such to interact.
- Connect PJS apps.
- Write a few simple lines of TS to interact.
- Write a few lines of Rust with SubXT to interact.

Tricky, as we would be using a FRAME based runtime in order to get some metadata out of it.
149 changes: 0 additions & 149 deletions syllabus/5-Substrate/99-DEP-JSON-RPC_slides.md

This file was deleted.

Loading