Polkadot-Blockchain-Academy / pba-content

An intensive academic program teaching Blockchain, Substrate, and Polkadot.
https://polkadot-blockchain-academy.github.io/pba-content/
MIT License
55 stars 27 forks source link

Corhort 1 Syllabus Feedback #278

Closed shawntabrizi closed 1 year ago

shawntabrizi commented 2 years ago

This is a meta issue where we can track all of the problems, "wish we had it", and feedback from this first cohort.

shawntabrizi commented 2 years ago

Section 1

shawntabrizi commented 2 years ago

Section 2

shawntabrizi commented 2 years ago

Section 3

shawntabrizi commented 2 years ago

Section 4

Prereqs

4.1 Substrate Intro

SCALE

Polkadot JS

Host Runtime Interface

emresurmeli commented 2 years ago

Section 3

kianenigma commented 2 years ago

4.

We squeezed in a SCALE lecture spontaneously, and seeing how many questions students have, I think it should be well defined lecture + workshop with more dedicated time next time.

3.

I think currently it is too closely touching on Substrate, which really should be saved for 4. Need to find ways to make the content more blockchain / blockchain framework agnostic.

Expanding on this, For example a lecture in mod 3 spend ~20 minutes on weights, going into not even only substrate-specific details of how weights work, but also FRAME syntax, and from what I saw, students were more confused by this jump forward than educated by it.

In module 3, we only want to inform them why metering execution time is important in blockchains, and what general approaches exist:

  1. dynamic, runtime time approaches like ETH style gas metering.
  2. static, pre-dispatch approaches like substrate weight system.
sacha-l commented 2 years ago

Module 3

Module 4: PJS workshop

Feedback:

The academy should have more hands on workshops like this. Going through a demo of a bunch of simple steps is great. But ideally (next time) imo should be followed with assigning the class with specific follow up exercises to do (just have steps 1, 2, 3 on the slide for example) like a mini workshop before moving on. This also applies to learning how SCALE works.

Module 4: Consensus

Corrections

Activity idea:

Reordering thinkings

JoshOrndorff commented 2 years ago

Module 4, Storage lesson: Two uses of the word "value".

  1. The actual stored value that the runtime developer cares about (eg a balance)
  2. The RockDB value (which is another trie node)

use this visualization tool to explain merklized storage: https://github.com/Lohann/substrate-state-visualizer

Module 3: Need to make it much more clear that the blocks represent transitions between states. The states themselves are NEVER part of the blocks. They are calculated by each node.

kianenigma commented 2 years ago

Module 3: Need to make it much more clear that the blocks represent transitions between states. The states themselves are NEVER part of the blocks. They are calculated by each node.

For this, we should use a figure such as page 6 here: https://github.com/kianenigma/SonicChain/blob/master/Presentation.pdf

image

shawntabrizi commented 2 years ago

Would be nice to touch on:

// This panics
#[test]
fn access_storage() {
    sp_io::storage::set(b"mykey", &vec![0,1,2]);
}

#[test]
fn access_storage() {
    let mut new_empty = sp_io::TestExternalities::new_empty();
    new_empty.execute_with(|| {
        sp_io::storage::set(b"mykey", &vec![0,1,2]);
    });
}

Also to do such a test in the frameless runtime.

#[test]
fn test_apply_extrinsic() {
    let block = BasicExtrinsic::new(5u8, None).unwrap();
    assert!(Runtime::apply_extrinsic(block).is_ok())
}

#[test]
fn show_me_scale() {
    println!("{:02x?}", 6u64.encode());
    //assert!(false)
}

#[test]
fn try_to_store() {
    let mut new_empty = sp_io::TestExternalities::new_empty();
    new_empty.execute_with(|| {
        sp_io::storage::set(b"mystorage", b"myvalue");
    });
}
shawntabrizi commented 2 years ago

Module 5

Intro to Polkadot

Cumulus

JoshOrndorff commented 2 years ago

Module 5:

We should talk about the Polkadot parachain protocol before we talk about Cumulus. Most of the questions and confusion today were about the parachain protocol rather than cumulus itself. Presenting them together made it unclear what is cumulus specific, and what is imposed by Polkadot.

For the parachain protocol lesson we can borrow material from the implementors guide as well as https://medium.com/polkadot-network/the-path-of-a-parachain-block-47d05765d7a

shawntabrizi commented 2 years ago

Module 6

Intro:

More high level, the FRAME intro should be much more big picture. I think we got too deep too quickly and lost people.

Let them experience the magic, and then explain to them how it works, rather than bottom up.

Storage:


pub use pallet::* needs to be in the empty skeleton of a pallet, otherwise construct_runtime! won't work.

shawntabrizi commented 2 years ago

Proof of Existence Workshop

IMO we should avoid open ended building on top of this, as they have not learned anything from FRAME yet. This is just a taster for the minimal working pallet, and to expose them to the things they will expect to learn about. I felt introducing the currency trait was opening a big door too early.

The best thing is for them to be "how does this work?" And we tell them that it is covered in our lectures.

shawntabrizi commented 2 years ago

Hooks + Dispatchable

shawntabrizi commented 2 years ago

Walkthrough of the traits we use

Too many people failed to know which traits to use, which pallets implement which traits, and all that.

Too many people failed when simply adding an existing pallet to their project.

We need to improve all of that.

sacha-l commented 2 years ago

FRAME comments


shawntabrizi commented 2 years ago

For the final project, we should have scaffolded templates so that students are not getting stuck with the basics of importing things and "setting it up".

Instead, they can work from files which are already set up and instead work on the todos in those files

shawntabrizi commented 2 years ago

Suggestion to use: https://classroom.github.com/

shawntabrizi commented 2 years ago

Also some instructions for students with any computer to use cargo remote with some special server we have, to avoid problems compiling and working with substrate.

kianenigma commented 2 years ago

Module 4: The whole runtime api versioning system is about to be changed: https://github.com/paritytech/substrate/pull/11779

bkchr commented 2 years ago

Module 4: The whole runtime api versioning system is about to be changed: paritytech/substrate#11779

Not really :P We just extend it, but it doesn't change that fundamentally.

nuke-web3 commented 1 year ago

This was a great set of notes that AFAIK have been implemented since. If not, please reference what was missed in a new issue!