Code Monkey home page Code Monkey logo

zkevm-docs's Introduction



Polygon zkEVM Documentation is the documentation hub providing extensive documentation, community resources, and guides for enthusiasts and developers interested in learning about or building on zkEVM.

The Polygon zkEVM Documentation website is built using Docusaurus, a modern static website generator to build optimized websites quickly.

Contribute to Polygon zkEVM Documentation

We believe one of the things that makes Polygon Labs unique is its coherent design, and we seek to retain this defining characteristic across all our solutions. We have defined some guidelines to ensure new contributions only ever enhance the developer docs from the outset.

Requirements

Note that on macOS, you also need Xcode and Command Line Tools.

  • Install Node.js version >= 16.14.1
  • Install Yarn version >= 1.22

Run the Wiki locally

  1. Fork the repo.

    For help, refer to GitHub Docs: Fork a repo.

  2. Clone your forked repo.

    git clone [email protected]:[your_github_handle]/zkevm-docs
    
  3. Navigate into the cloned folder.

    cd zkevm-docs
    
  4. Link your cloned repo to the upstream repo.

    For help, see GitHub Docs: Configuring a remote for a fork.

    git remote add upstream https://github.com/maticnetwork/zkevm-docs
    
  5. If you have already cloned the repository, be sure to sync your fork with the latest changes.

    For help, refer to GitHub Docs: Syncing a fork.

    git checkout master
    git fetch upstream
    git merge upstream/master
    
  6. Install the dependencies.

    yarn install
    

    The site is built using Docusaurus. You may need to install Docusaurus before running the Wiki locally.

    yarn add docusaurus
    

    Alternatively, you can upgrade Docusaurus.

    yarn upgrade @docusaurus/core@latest @docusaurus/preset-classic@latest
    
  7. Run the Wiki locally. The following command will start a local development server and open a browser window. Most changes are reflected live without having to restart the server.

    yarn start
    

Make changes using Git GUI and code editor

After running the Wiki locally on your machine, use a code editor to apply your changes before submitting your PR. Note that you must have a GitHub account and an understanding of Markdown syntax.

  1. Create a new branch for your changes.

    git checkout -b [new_branch_name]
    
  2. Commit your changes. Please be sure to review our Git Rules. In the commit message, please reference the issue it resolves. For help, see GitHub Docs: Linking a pull request to an issue using a keyword.

    git commit -m "brief description of changes"
    
  3. Push to your forked repository.

    git push
    
  4. Submit a PR against the main branch of the maticnetwork/zkevm-docs repo.

  5. Add a title to your PR with appropriate labels.

    For example, if you want to suggest edits to the "Develop" page, name your PR: update: develop.md.

  6. Add a description to your PR. Please reference the issue it resolves.

    For help, see GitHub Docs: Linking a pull request to an issue using a keyword.

  7. Write a brief description of the changes you have made. If possible, include screenshots and references.

You can apply UI changes, sidebar, and configuration design through the following files:

  • To modify the Sidebar navigation, edit sidebars.js
  • To modify the website page layout, edit docusaurus.config.js
  • To modify the blocks structure and the footer links, edit src/pages/index.js

Making changes using the Wiki website

You can easily submit an edit suggestion. Note that you must have a GitHub account and good knowledge of Markdown syntax.

  1. Navigate to the Polygon zkEVM Documentation page that you want to edit.

  2. Scroll down until the end of that page.

  3. Click on the link: Edit this page. It will forward you to the same page (Markdown format) hosted on GitHub.

  4. On the related GitHub page, click the pencil icon (similar to ✎) near the upper right corner of the file.

  5. Apply your edits by modifying the Markdown file.

  6. After you finish, scroll down until the end of that page to create a pull request.

  7. Add a title to your PR.

  8. Add a description to your PR. Please reference the issue it resolves.

    For help, see GitHub Docs: Linking a pull request to an issue using a keyword.

  9. Write a brief description of the changes you have made. If possible, include screenshots and references.

  10. Click on the green button Propose changes to submit your changes. Note that submitting a change will write it to a new branch in your fork.

One of the Wiki maintainers will review your PR and either accept it or submit their review.

Acceptable PRs will be approved & merged into the main branch.

Submit an Issue

  • Create a new issue to report a bug, request a feature, or suggest changes.

  • Comment on the issue if you want to be assigned to it so our team can assign the issue to you.

  • If you do not have a specific contribution in mind, you can also browse current issues.

  • Issues that additionally have the good first issue label are considered ideal for first-timers.

Build

This command generates static content into the build directory and can be served using any static content hosting service:

yarn build

Deployment

If you are using GitHub pages for hosting, this command is a convenient way to build the website and push to the gh-pages branch.

GIT_USER=[your_github_handle] USE_SSH=true yarn deploy

Caching

Deployments leverage GitHub caching to improve build times. Currently, 3 levels of caching are implemented:

  • .docusaurus: caches the site structure. The build process will update this as needed
  • build: caches the static assets to avoid regenerating any pages that have not changed
  • node_modules: caches node_modules based on the hash of yarn.lock. Any changes to package dependencies will invalidate and rebuild this cache

Current cache config is defined in master_deployment.yml. Caches can be viewed or invalidated in the GitHub repo settings.

zkevm-docs's People

Contributors

ashucoder9 avatar ashutoshvarma avatar criadoperez avatar dav8t avatar empieicho avatar hangrypizza avatar imjeremyhe avatar mt-polygon-technology avatar omahs avatar rekibnikufesin avatar wiredhikari avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar

zkevm-docs's Issues

Wrong reference to code

On the section "Read Operation And Main State Machine" of this page, there is a reference to code on the file main.pil lines 452 to 465.

This reference is no longer valid.

I think the new code its trying to refer to are lines 663 to 676 instead of lines 452 to 465.
So this extract instead of this one.

However, not only the lines of code have changed but also the content of these lines and the reference it's making reference to crValid, it's now r8Valid.

A constant column crValid is therefore created specifically for checking if a read is done at the last block. So, crValid...

So, current extract in the docs is the following:

hashK {
      addr,
      HASHPOS,
      DO,
      op0, op1, op2, op3,
      op4, op5, op6, op7
} in
      PaddingKK.crLatch∗PaddingKK.crValid {
      PaddingKK.addr,
      PaddingKK.len−PaddingKK.rem−PaddingKK.crLen+1,
      PaddingKK.crLen,
      PaddingKK.crVC0, PaddingKK.crVC1, PaddingKK.crVC2, PaddingKK.crVC3,
      PaddingKK.crVC4, PaddingKK.crVC5, PaddingKK.crVC6, PaddingKK.crVC7​
};

Lines (663 to 676) I believe it's trying to refer to instead are:

   hashK + hashK1 {
        addr,
        HASHPOS,
        D0 * hashK + hashK1,
        op0, op1, op2, op3,
        op4, op5, op6, op7
    } in
    PaddingKK.crLatch * PaddingKK.r8valid {
        PaddingKK.addr,
        PaddingKK.len - PaddingKK.rem - PaddingKK.crLen + 1,
        PaddingKK.crLen,
        PaddingKK.crV0C, PaddingKK.crV1C, PaddingKK.crV2C, PaddingKK.crV3C,
        PaddingKK.crV4C, PaddingKK.crV5C, PaddingKK.crV6C, PaddingKK.crV7C
    };

And current lines it's currently referring to (lines 452 to 465 which seems wrong):

                  2**0  * arithEq0      + 2**1  * arithEq1      + 2**2  * arithEq2      + 2**3  * assert
                + 2**4  * bin           + 2**5  * hashK         + 2**6  * hashKDigest   + 2**7  * hashKLen
                + 2**8  * hashP         + 2**9  * hashPDigest   + 2**10 * hashPLen      + 2**11 * ind
                + 2**12 * indRR         + 2**13 * isMem         + 2**14 * isStack       + 2**15 * JMP
                + 2**16 * JMPC          + 2**17 * JMPN          + 2**18 * memAlignRD    + 2**19 * memAlignWR
                + 2**20 * memAlignWR8   + 2**21 * mOp           + 2**22 * mWR           + 2**23 * repeat
                + 2**24 * setA          + 2**25 * setB          + 2**26 * setC          + 2**27 * setCTX
                + 2**28 * setD          + 2**29 * setE          + 2**30 * setGAS        + 2**31 * setHASHPOS
                + 2**32 * setPC         + 2**33 * setRCX        + 2**34 * setRR         + 2**35 * setSP
                + 2**36 * setSR         + 2**37 * sRD           + 2**38 * sWR           + 2**39 * useCTX
                + 2**40 * useJmpAddr    + 2**41 * JMPZ          + 2**42 * call          + 2**43 * return
                + 2**44 * hashK1        + 2**45 * hashP1        + 2**46 * useElseAddr;

    (1 - arithEq0) * arithEq0 = 0;

I can summit a PR with the change but wanted to confirm my assumptions are correct.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.