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

Shawn Tabrizi - Tracking Issue - Berkeley #592

Open
6 tasks
shawntabrizi opened this issue Apr 25, 2023 · 13 comments
Open
6 tasks

Shawn Tabrizi - Tracking Issue - Berkeley #592

shawntabrizi opened this issue Apr 25, 2023 · 13 comments
Labels
tracking meta-issue for tracking many working issues, PRs, etc.

Comments

@shawntabrizi
Copy link
Contributor

shawntabrizi commented Apr 25, 2023

Hey all,

This will be a tracking issue, and a great way to contact me for my work and participation in the upcoming PBA in Berkeley, California.

I will try to push most conversations, work items, and commitments into this GitHub issue to make it easy to track for myself and others.

I currently have 30 days contracted to me for my work at the academy, which I will need to split over my time in person at the academy and any work before.

I am happy to spend all of that time at the academy in person, but it seems like some work is needed beforehand.

cc @nukemandan @aaronbassett @kianenigma


Current Open Questions:

  • What lessons will I be teaching / TA-ing?
    • Likely any combination of Substrate, FRAME, and perhaps some of Polkadot (introduction, high level, economics / game theory, ending overview) will match well my abilities.
    • This will help me decide how many days I need to allocate for being there in person (at least).
  • What content needs my help?
    • Here are some things I can think of wanting to work on if I could and it makes sense:
      • An update to the Polkadot introduction / ending lecture. Trying to primarily paint a high level picture of how everything learned so far applies to Polkadot.
      • A simplification / break down / expansion of the FRAME exam.
        • Something that is easier to grade, and has less variance across the options.
        • Something which avoids people copying the DEX project. (perhaps as simple as forcing Uniswap V2)
        • Perhaps better starting templates.
        • Perhaps breaking down the overall project over two weekends.
        • Integration of things like Polkadot and XCM content into a final project.
      • Improvements to visuals / diagrams across all sections.
      • Video lecture that people can watch / take home to facilitate the in-class learning.
  • What other ways would you all like to use my time?

Current Responsibilities:

@shawntabrizi
Copy link
Contributor Author

shawntabrizi commented Apr 25, 2023

Here is some ideas for a Polkadot module which is less technical, and more inline with the knowledge needed by a Runtime / FRAME developer.

  • Introduction to Polkadot
  • Deep Dive Presentations on the Decisions
    • Combining some of the topics where appropriate
      • Wasm
      • Sharding
      • Heterogeneous / App-Chains
      • Interoperability
      • XCM + XCMP
      • Shared Security
      • Babe + Grandpa (Sassafrass?)
      • Light Clients
      • On-Chain Upgrades
      • Governance
      • Treasury
  • Additional Topics
    • Game Theory and Economics within Polkadot
      • Parachain Auctions
      • Utility and Distribution of Tokens
    • Decentralization vs Unstoppability
    • Cumulus SDK

For those who take the more technical Parachain Protocols Developer Fork, we can lean back onto the lectures created the last two academies.

@kianenigma
Copy link
Member

kianenigma commented Apr 26, 2023

I am happy to spend all of that time at the academy in person, but it seems like some work is needed beforehand.

I am down for doing more prep async this time, and I will also attend the academy at most for the second half.

The main point of collaboration that I can suggest is that I have the intention of creating a new "FRAME Mater Tutorial" in the new version of substrate docs, and we can potentially collaborate on that, and run the same tutorial in PBA. It will be a long, multi-step, multi-day tutorial, so in some sense, suitable. You can learn more about it here. On the downside, perhaps we can want to keep the academy content more exclusive and do something different there.

I have not started on this yet, but I expect to have a proposed outline ready by 1-2 weeks from now.

The initial task that I have set for myself is:

  • identify all the "teach-able" building blocks of FRAME, which we mostly have here (see Tracking Issue for Module 6 FRAME #177) but I want to start from first principles again.
  • identify the important subset that we want to be covered in the master tutorial.
  • Come up with a tutorial topic that covers this the decided topics.
    • The topic can be either made-up, which is easier to devise but we risk it being a bit nonsensical
    • Or a common project out there (eg what SubstrateKitties did), which is more appealing but possibly harder to find.
    • I would love some ideas on this.
  • Then start writing the core tutorial content in written form.

@shawntabrizi if the above is suitable for PBA, would love to get a bit of consultation from you beforehand (I can do most of the heavy work beforehand), and then help you deliver the same tutorial in person.

@shawntabrizi
Copy link
Contributor Author

@kianenigma I am happy to work / consult on a tutorial.

As for tutorial topics, I think there is quite a range of possibilities.

One idea I have come to like more, especially for a longer, more in-depth tutorial is the idea of building all the basic pallets expected in the Polkadot ecosytem.

For example:

  • Start by creating the Sudo pallet, allowing a simple way to do upgrades.
  • Then create a basic balances pallet. As simple as ERC-20.
  • Create a simple staking system.
  • Create a simple treasury system.
  • Create a simple governance system.

Each of these could be chapters in the tutorial, and days taught at the academy. At the end of the process, students can feel familiar enough to create a "full blockchain", and also understand what the Substrate pallets they are using are basically composed of.

Topics covered:

  • Create a Sudo pallet
    • Basic layout of a pallet
    • Storage Value
    • Origin
    • Re-dispatch
  • Create a balances pallet
    • Learn about storage Map
    • Safe math
    • Transactional storage
    • Creating ROOT calls (for minting for example)
  • Create Staking System
    • Learn more advance storage techniques and limitations
    • Mixing storage maps and vectors storage values
    • Computational limitations / Weight
    • Advance call scenarios like permission-less calls (for rewards)
  • Create a Governance System
    • Advance re-dispatching
      • storing calls in storage
      • call encoding
      • what that means for upgrades
    • Preimages
    • Advance call scenarios like "free transactions"
    • Advance management of storage, which is both efficient for calculating the result of a poll, but also allows users flexibility to change / update votes, etc...
    • Nested errors
    • Call Filtering

The key to a plan like this, is making the pallets simple enough (or with enough existing boilerplate code), so that users spend a majority of their time learning concepts, and not getting stuck writing specific blocks of code.

Otherwise, for something more straight forward, I think going back to some NFT thing like a remake of Kitties will be most "sticky" and exciting for both the students at the academy and people just reading the tutorial online.

@notlesh
Copy link
Contributor

notlesh commented Apr 27, 2023

Hey, I'm Stephen (notlesh) from the Moonbeam team 👋

I'm planning to help out with PBA this year and one of the ideas that I've discussed with @nukemandan is that I could help you (@shawntabrizi) with the FRAME material.

Most of the topics discussed above are pretty familiar to me, so I think I could help out in just about any way. I plan to be onsite for at least a week, and my time commitment is about the same as yours (4 weeks).

Let me know if you're interested in my help :)

@shawntabrizi
Copy link
Contributor Author

@notlesh how familiar are you with the existing slides / content for the academy?

I would say a good starting point is going through the slides of the FRAME module quickly, and writing down any notes you have, and we can start from there to improve the existing material. When I have a more concrete idea of what I will be contributing, I can let you know more exactly what help I need.

Thanks!

@kianenigma
Copy link
Member

kianenigma commented May 1, 2023

@shawntabrizi I love the idea; I've been struggling with finding a single pallet that encompasses most of the topics that I want to see covered. Multiple pallets makes a lot more sense.

I will look around a bit further for "interesting pallets" that could be used in the sequence, and will get to prototyping soon. I will try and get some code-only node-template that includes all of this code ready by the next 2-3 weeks. Thereafter, we can start a parallel task:

  • I will continue with writing written tutorial around it.
  • You and rest of PBA FRAME team, myself included, can start writing slides around it.

This actually reminds me of how many university textbooks work, and it would be a great package.

If all of this fails (which is not out of imagination given the workload/time ahead), I am still assuming that we are happy to run FRAME as we did last time, with the existing material. But, at least I am of the opinion that we can do better. The existing FRAME slides are highly in the style of being "reference material"; raw, low level, extensive and rather dry. I think we need those as well, but they are more useful in written format, and in the documentation, and/or as backup material that we hand over to students for their own study. In the lecture room, we could use a more cohesive, story-like tutorial that we walk over, over the course of multiple days.

@nuke-web3 nuke-web3 added the tracking meta-issue for tracking many working issues, PRs, etc. label May 8, 2023
@kianenigma
Copy link
Member

My initial progress on the FRAME master tutorial has been along the lines of re-creating what I have created in the Rust exam: A simple currency module, plus a simple staking module. I suppose this will not touch all of the parts, so as @shawntabrizi suggested, perhaps I will continue re-creating more existing pallets.

I plan to use this writeup as one of the main lessons of the tutorial, highlighting the different paths to make a system work in a decentralized limited blockspace manner.

I will share a more comprehensive plan about this shortly.

Moreover, a lot of discussion is going on around this in paritytech/polkadot-sdk-docs#3, but some of your don't have access, so I will provide a TLDR here:

I plan to write this whole tutorial, in both FRAME and Ink! for as much as it is physically possible. There will be a point in time where we would say: okay, this can no longer work as a contract, and needs to be a runtime.

I initially wanted to do this as an extra point of reference. For each chapter of the tutorial, whilst we build it with FRAME, we can have a footnote link saying: "This is how you would have built this with Ink!".

But, we can also integrate Ink! into the tutorial in a more holistic manner. This is am ambitious plan, and could be a win-win for both modules in PBA, for both technologies, lay the groundwork for the Merge of the two, and finally diminish the confusion of "should I build a runtime or a contract" once and for all.

I wanted to share this as I see @JoshOrndorff is taking over #586, as we already have worked on many modules together and perhaps we can extend it here. Nonetheless, I want to emphasize again that this is a very ambitious plan.

@shawntabrizi
Copy link
Contributor Author

@kianenigma can you create a rough tracking issue and tell me what parts i should assist with at the moment?

@bhargavbh
Copy link
Contributor

Hi @shawntabrizi. I am part of the research team at W3F and am planning to give a guest lecture on static analysis. Would be great to hear your inputs on this #609

@JoshOrndorff
Copy link
Contributor

I love the idea @kianenigma! Implementing these key ideas of cryptocurrency, staking, and their coupling in three contexts (from scratch in the pre-course assignment, as an ink! contract, and as a FRAME runtime) will make the concepts crystal clear.

@notlesh
Copy link
Contributor

notlesh commented May 26, 2023

I would say a good starting point is going through the slides of the FRAME module quickly, and writing down any notes you have, and we can start from there to improve the existing material. When I have a more concrete idea of what I will be contributing, I can let you know more exactly what help I need.

I've been through the FRAME material now, in general I'm quite comfortable with the content. I took some notes, but don't have any major critiques. I could open a PR to discuss them if you're interested.

Is there content in particular that you want to improve or add?

@shawntabrizi
Copy link
Contributor Author

To be honest, not really. You are the one reaching out to help with the content, but i do think, as you have seen yourself, it is in a pretty good spot. A PR is always a good starting point for a further discussion.

I think @kianenigma might need help with some exercise stuff, but also not sure exactly where that is at.

What seems even more relevant to help than anything in FRAME is XCM content, exercises, and other material, but not sure if you feel confident to help in that space.

@kianenigma
Copy link
Member

kianenigma commented Jun 2, 2023

@shawntabrizi sorry for the delay, and indeed I am somewhat slow on the tutorial, but for reasons justified to me. I was pushing forward major FRAME initiatives like

and am building the tutorial using these new features. I didn't want to build too much of it because it had to be re-done with these features, which is exactly what I am doing right now.

to be more precise, I am working on one last issue with the new derive_impl such that it is usable without needing frame_support in scope.

Nonetheless, I have already. added you to https://github.com/paritytech/polkadot-sdk-docs which is the only public place where I am working on the tutorial, and adjusted the README to reflect my latest updates. I think it is already ready for an initial look from your side.

As noted in the README, my initial goal is to create the tutorial in a format where it is only a series of code-crates, with a high level README file that is an instruction set about "what needs to b taught" in this step. The work on, possibly, transforming that into a lecture/exercise format for PBA, can happen for the most part in parallel.

I think when we meet in Lisbon is a great time for you to review everything I have done and make a decision about if/how you want to use it.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
tracking meta-issue for tracking many working issues, PRs, etc.
Projects
None yet
Development

No branches or pull requests

6 participants