Closed shawntabrizi closed 1 year ago
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.
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:
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.
Corrections
Activity idea:
Module 4, Storage lesson: Two uses of the word "value".
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.
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
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");
});
}
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
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.
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.
on_finalize
, like deleting temporary storage.on_finalize
is deadly in a parachain. #[transactional]
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.
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
Suggestion to use: https://classroom.github.com/
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.
Module 4: The whole runtime api versioning system is about to be changed: https://github.com/paritytech/substrate/pull/11779
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.
This was a great set of notes that AFAIK have been implemented since. If not, please reference what was missed in a new issue!
This is a meta issue where we can track all of the problems, "wish we had it", and feedback from this first cohort.