Closed shawntabrizi closed 1 year ago
Add a slide for "Secure communication" right after the list of cryptographic guarantees
Move existing slide or add a slide for non-repudiation in that list too
Might be powerful to mention that the logic of hash functions are completely open source and known to the world, but that does not actually make hashing or the properties of hashing any less secure (for a good hash function)
In the section where gav was generating public keys and stuff, we assume users understand what hex / ss58 representation of bytes looks like. perhaps we should ensure users are familiar with these basic representations of bytes and what that means.
My WIP stuff from BA 2023:
many signatures can be valid for the same data IIRC.
indeed https://en.wikipedia.org/wiki/Probabilistic_encryption aka "randomized encryption". This is an important feature because otherwise encrypting the same message multiple times yields the same ciphertext. Imagine we have a standing daily meeting and I send you the message, "Let's delay our 11:00 meeting until noon today." on occasion. If that yields the same ciphertext each time, the adversary would soon notice.
update notes on what lossy vs/ lossless is
The way i understood the diagram and those notes, is the following:
So in the world of one way functions, these two have been specifically crafted for the features we wish to gain from them, and those features are derived from the fact that they are lossy or lossless.
Add a section in FRAME to go over pallet::config
, things like pallet::constant
, configurable get, conversion trait, etc...
improve final assignment for frame to clarity the "price api" and it NOT being an RPC
Student Feedback
Make Crypto + Game Theory sections shorter
Make FRAME section longer
more FRAME examples
Harder rust exam
Hardware requirement, perhaps some Mac M1 people can borrow
For the rust exam improvements:
^^^^ unfortunately still seeing a lot of unnecessary unwraps in some of the projects submitted.
Thankfully, some of them are "safe", but just really non-ergonomic use of Rust.
Here is a small primer:
#[derive(Default)]
struct StorageValue {
value: Option<u32>,
}
impl StorageValue {
pub fn get(&self) -> Option<u32> {
self.value
}
pub fn set(mut self, v: Option<u32>) {
self.value = v;
}
pub fn put(mut self, v: u32) {
self.value = Some(v);
}
}
enum PalletError {
NoValueSet,
}
fn my_function() -> Result<(), PalletError> {
let MyStorage = StorageValue::default();
// Read some storage, if NONE return an error
let value = MyStorage.get().ok_or(PalletError::NoValueSet)?;
// Anti-pattern. Don't do this!
let maybe_value = MyStorage.get();
if maybe_value.is_none() {
return Err(PalletError::NoValueSet)
}
let value = maybe_value.unwrap();
// This is at least a little better, but still an anti-pattern
let value = maybe_value.expect("cannot panic because of `none` check right above. q.e.d");
// Do some logic only if a storage value exists, but don't return an error
// which would halt the whole extrinsic.
if let Some(value) = MyStorage.get() {
// do things with value
// If there is no value, then this code will never execute.
}
// This is okay... but probably means you should be using `ValueQuery` configuration.
// Can't really make a simple example here of `ValueQuery`. Check the presentations.
// So probably again an anti-pattern.
let value = MyStorage.get().unwrap_or_default();
Ok(())
}
I honestly do not see the game theory parts of the course show up in their final projects. Many people making really bad state machines, or ones which are not really good against all malicious actors.
I think we should be much more concrete about designing games for the blockchain in the game theory section.
Sergey:
Update from student Nate Armstrong there who took great notes:
In case anyone wants to go over things we learned in the class that aren't necessarily present in the slides, I collated most of the questions and answers that I took notes on during PBA into a github gist here. It's mostly complete, about 7k words, and hopefully useful! The sections on FRAME and polkadot are by far the most complete.
Kian remarked it also helps us to see which points were ambiguous, and how to improve.
I think the feedback is incorporated or well on it's way to be for UCB.
https://github.com/Polkadot-Blockchain-Academy/pba-content/issues/437#issuecomment-1412339144 I think we will see if the "assignment 0" helps get some things like this more well understood.