Giter Site home page Giter Site logo

scroll's Introduction

Scroll Monorepo

rollup bridge-history coordinator prover integration codecov

Scroll is a zkRollup Layer 2 dedicated to enhance Ethereum scalability through a bytecode-equivalent zkEVM circuit. This monorepo encompasses essential infrastructure components of the Scroll protocol. It contains the L1 and L2 contracts, the rollup node, the prover client, and the prover coordinator.

Directory Structure

├── bridge-history-api: Bridge history service that collects deposit and withdraw events from both L1 and L2 chains and generates withdrawal proofs
├── common: Common libraries and types
├── coordinator: Prover coordinator service that dispatches proving tasks to provers
├── database: Database client and schema definition
├── l2geth: Scroll execution node
├── prover: Prover client that runs proof generation for zkEVM circuit and aggregation circuit
├── rollup: Rollup-related services
├── rpc-gateway: RPC gateway external repo
└── tests: Integration tests

Contributing

We welcome community contributions to this repository. Before you submit any issues or PRs, please read the Code of Conduct and the Contribution Guideline.

Prerequisites

  • Go 1.21
  • Rust (for version, see rust-toolchain)
  • Hardhat / Foundry
  • Docker

To run the tests, it is essential to first pull or build the required Docker images. Execute the following commands in the root directory of the repository to do this:

docker pull postgres
make dev_docker

Unit Tests

Run the tests using the following commands:

go test -v -race -covermode=atomic scroll-tech/rollup/...
go test -tags="mock_verifier" -v -race -covermode=atomic scroll-tech/coordinator/...
go test -v -race -covermode=atomic scroll-tech/database/...
go test -v -race -covermode=atomic scroll-tech/common/...

License

Scroll Monorepo is licensed under the MIT license.

scroll's People

Contributors

29988122 avatar alexstocks avatar amoylan2 avatar cario-dev avatar chuhanjin avatar colinlyguo avatar davidcardenasus avatar dependabot[bot] avatar georgehao avatar haoyuathz avatar icemelon avatar johnsonjie avatar lawliet-chan avatar lispc avatar luky116 avatar mask-pp avatar maxwolff avatar nazariidenha avatar orestta avatar qi-0826 avatar rrzhang139 avatar sbaizet-ledger avatar scroll-dev avatar silathdiir avatar spilehchiha avatar thegaram avatar turupawn avatar vyzo avatar yqrashawn avatar zimpha 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  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  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  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 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  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

scroll's Issues

Proposal: Add checks before accessing environment variables

I've been considering the idea of adding additional checks before accessing environment variables in our codebase. The main motivation behind this is to improve error handling and provide more informative error messages when environment variables are not set or are incorrectly configured.

Currently, our code assumes ( in some functions we already have checks ) that all required environment variables are present and correctly formatted. This can lead to cryptic error messages or unexpected behavior if an environment variable is missing or malformed.

By adding checks that verify the presence and validity of environment variables before they are used, we can catch these issues early and provide clear, actionable error messages. This would make it easier for contributors and other members to understand and resolve configuration issues.

I am planning to implement this change and would like to gather feedback from the community. Are there any concerns or suggestions on how I could proceed with this implementation?

GAS FEE GUZZLE

Utilizing data availability protocols such as Avail or Celestia presents a promising solution to alleviate the burden of gas fees associated with scrolling. These protocols are designed to optimize the storage and accessibility of data on decentralized networks, offering a decentralized and efficient alternative to traditional methods. By implementing these protocols, users can store data more efficiently and access it seamlessly, reducing the computational resources required for tasks like scrolling through content. This, in turn, translates to a reduction in gas fees, as fewer computational resources are needed to execute transactions on the blockchain. Moreover, the decentralized nature of these protocols enhances data security and resilience, further bolstering the overall efficiency and reliability of the system. Embracing data availability protocols represents a significant step towards addressing the scalability and cost challenges associated with blockchain-based applications, paving the way for a more sustainable and accessible decentralized ecosystem. To sum it up, I believe that if we utilise data availability protocols mentioned above, it will help reduce gas fee on scroll

Thank you for taking this into consideration!

Simplify bloated db interfaces.

In database/orm/interface.go some orm interfaces are bloated.

i.g:

  1. BlockBatchOrm: GetLatestBatch、GetLatestCommittedBatch、GetLatestFinalizedBatch、GetCommittedBatches can be abstracted into one interface GetBatchByRollupstatus.
  2. ...

how to setup a prover node on mainnet

I follow the instruction in folder scroll/prover. When i run ./build/bin/prover , i see a very long error message in terminal. I think it may be because I didn't configure the JSON file. But how do I know the url of coordinator and the l2geth node.Or rather, what did I do wrong elsewhere. Could anyone tell me.

.

.

Ecosystem

That sounds like an interesting idea! Just to clarify, are you referring to the Scroll platform for managing, documenting, and organizing content? If so, integrating it with developer tools could definitely provide added value. How do you envision this integration benefiting developers and enhancing their workflow?

protocol Bridge and Zk rollups on scroll

With the technology deployed and the upgrade on Scroll to reduce the cost of Bridging from L1 to scroll mainnet on scroll native Bridge,
i would say that such rollup can be further upgraded to enable users bridge on ScrollEVM to other layer2 rollup with scroll native Bridge,
this kind of technology will be great innovation on ScrollEVM and with the layer 2 network, which will attract massive income on scroll.

Need a common lib

Scroll AI assistant

This issue proposes the development of an AI assistant to enhance the user and developer experience within the Scroll L2 ecosystem. This assistant would leverage AI capabilities to streamline navigation, access information, and provide contextual support, ultimately fostering a more user-friendly and developer-centric environment.

CodeCraft

Welcome to CodeCraft, where innovation meets code! This repository is a collection of meticulously crafted solutions designed to tackle today's challenges and prepare for tomorrow's opportunities. Whether you're a seasoned developer or a curious learner, CodeCraft offers a diverse range of projects, tutorials, and resources to inspire and empower you on your coding journey.

Features:
-Projects: Explore a variety of real-world projects spanning different domains, from web development to machine learning.
-Tutorials: Dive deep into the world of coding with step-by-step tutorials covering popular programming languages, frameworks, and tools.
-Resources: Access a curated selection of resources, including articles, books, and online courses, to expand your knowledge and skills.
-Community: Join our vibrant community of developers, enthusiasts, and learners to collaborate, share insights, and grow together.

Get Started:

  1. Clone the repository to your local machine.
  2. Explore the projects, tutorials, and resources folders to find what interests you.
  3. Follow the README.md files in each folder for instructions on getting started and using the code.

Contributing:
We welcome contributions from the community! Whether it's fixing a bug, adding a feature, or improving documentation, your contributions help make CodeCraft better for everyone. Please refer to the CONTRIBUTING.md file for guidelines on how to contribute.

Let's Connect:
Join our Discord server to connect with fellow developers, ask questions, and share your experiences. Follow us on social media for updates, announcements, and coding tips.

Reduce Gas Fee On Scroll

Use Celestial Data availability to reduce the gas fee on scroll

Unlike other monolithic blockchains, Celestia decouples the data availability layer from the execution layer and focuses only on ordering transactions and their data availability, i.e, they solely work on proving that transactions are published on the network and are available for everyone to see. The execution and settlement of transactions are left to the respective rollup. (As a permissionless network, Celestia uses Proof-of-Stake to secure its own consensus. Like any other Cosmos network, users can help secure the network by delegating their TIA to a validator like Chorus One.)

But why is data availability important?
When you make a transaction, it needs to be confirmed and added to the blockchain for everyone to see. Once the transaction is confirmed, it's put into a "mempool" where it waits for its turn to be added to the blockchain. The full nodes then download this new block, execute/compute every transaction included within this block (including yours), and make sure they are all valid. They check things like whether you have the money you're trying to send and that you're not doing anything sneaky. Full nodes therefore perform the important task of enforcing the blockchain’s rules on validators. This is where things get tricky.

Learn Layer 2

Layer 2 Network: Layer 2 solutions aim to enhance the scalability and efficiency of the Ethereum blockchain by processing transactions off-chain while still utilizing the security of the Ethereum mainnet. By doing so, they alleviate congestion and reduce transaction costs. Scroll operates independently from the Ethereum mainnet, but it periodically commits aggregated transaction data to Ethereum for security and finality.

Zero-Knowledge Rollup: Zero-knowledge rollups are a specific type of Layer 2 scaling solution that leverages zero-knowledge proofs to bundle multiple transactions into a single proof, which is then validated on the Ethereum mainnet. This approach enables significant scalability improvements without sacrificing security or decentralization. Scroll's use of zero-knowledge rollups likely means that it achieves high throughput and efficiency while maintaining strong security guarantees.

Built on Ethereum: Being built on Ethereum means that Scroll benefits from the security and network effects of the Ethereum blockchain. It can leverage Ethereum's robust infrastructure, developer ecosystem, and user base while offering improved scalability and efficiency through its Layer 2 implementation.

In summary, Scroll as a Layer 2 network built on Ethereum utilizing zero-knowledge rollups represents a cutting-edge solution to Ethereum's scalability challenges, offering high throughput, low fees, and strong security without compromising decentralization.

Sometimes interaction fails with contract made on nfts2me

I have often exceptions when trying to use contract (mint nft) on Scroll from nfts2.me. Exception code is 0xc288bf8f, as I understand, it is InvalidMintFee() error. I do not think that it is only client problem, more the problem with rpc/connection because bug reproduces on different setups (please look below). Maybe, should be fixed.

This bug is new one, haven't seen issue in February or earlier, started to see from 5-7th of March (I'm using Scroll from December).

Bug is reproducible, sometimes from the 1st time (mostly), sometimes from 5th...
Exception occurs on both metamask + browser setup or python script automation. In python script error comes more often, I would say, contract interaction is more unsuccessful than OK.

Setup:
MetaMask 11.12.4, ID: nkbihfbeogaeaoehlefnkodbefgpgknn
Google Chrome version 122.0.6261.128 (Official Build) (64-bit)

Difficulties Switching to Scroll Network on MetaMask

Users are encountering difficulties when attempting to switch from the Ethereum network to the Scroll network on MetaMask. This issue arises despite correct network configuration and sufficient funds in the wallet. The problem appears to be impeding seamless navigation between networks, potentially affecting user experience and functionality.

Steps to Reproduce:

  1. Open MetaMask extension.
  2. Ensure correct network settings for Scroll network.
  3. Attempt to switch from Ethereum network to Scroll network.
  4. Observe failure or delay in network switching process.

Expected Behavior:
Users should be able to switch between networks smoothly without encountering delays or errors, ensuring seamless navigation and access to desired functionalities.

Impact:

  • Inconvenience to users, hindering efficient utilization of MetaMask features.
  • Potential disruption to workflow, particularly for those requiring access to specific networks for transactions or interactions.

Proposed Solution:

  • Investigate underlying causes of network switching difficulties.
  • Implement fixes or optimizations to enhance MetaMask's capability to seamlessly transition between networks.
  • Provide clear guidance to users on troubleshooting steps or workarounds until a permanent solution is implemented.

This issue is crucial for maintaining MetaMask's usability and user satisfaction, warranting prompt attention and resolution.

Issue of deployment

I deployed contact address and NFT, you said I didn't during 60 days, any help please

Improve the documentation

  1. Update README in bridge coordinator roller database i.g: wshttpdockerstart cmdsapi call examples etc.
  2. Add comments for key fields(especially various of status) in database/migrate/migrations/*.sql tables.

Add Protocol

Add account abstraction wallet to scroll...

It means you can pay Gas fee in usdc instead of eth

Add more inter probability protocol on scroll

gas high

i have 0.002eth and send, fee says 0,0001, then cannot send, failed

Missing else block

} else if txnToCheck.Status == types.TxStatusPending && // Only try resubmitting a new transaction based on gas price of the last transaction (status pending) with same ContextID.

According to MISRA coding standard it is adviced to add an else block for if-else if statements for code completeness and in order to catch unforeseen run time scenarios. Although it is escpecailly crucial for mission critical codes, I think this measure can be applied to widely used blockchain codes such as Scroll's also.

Cannot spin up bridge docker container

When running make docker, I was able to create the image. But when I ran it, it gave this error: CRIT [03-26|23:18:05.676] failed to load config file config file=./config.json error="open config.json: no such file or directory"

No validation when granting roles

The grantRole and updateAccess methods allow setting any address for roles without validation. This could enable unauthorized addresses to be granted privileged roles by mistake.

Proposed Solution

Add require statements in grantRole and updateAccess to validate addresses match expected constants before granting.

Update prover's README

Following the instructions in its readme, I found that the build process did not generate the dynamic link library, and it threw errors like 'error while loading shared libraries: libzktrie.so: cannot open shared object file: No such file or directory' after running 'go test'."
image

Coordinator docker build appear error.

Randomly appear error:
#26 5.869 error: failed to run custom build command for rustix v0.35.9#26 5.869 #26 5.869 Caused by: #26 5.869 could not execute process/app/target/release/build/rustix-ae55f5f805287806/build-script-build` (never executed)
#26 5.869
#26 5.869 Caused by:
#26 5.869 Permission denied (os error 13)
#26 5.869 warning: build failed, waiting for other jobs to finish...
Compiling halo2curves v0.2.1 (https://github.com/privacy-scaling-explorations/halo2curves?tag=0.2.1#f75ed26c)
Compiling darling_core v0.13.4
Compiling num v0.4.0
Compiling webpki v0.22.0
Compiling sct v0.7.0
#26 ERROR: executor failed running [/bin/sh -c cargo build --release]: exit code: 101

[zkp-builder 5/5] RUN cargo build --release:


executor failed running [/bin/sh -c cargo build --release]: exit code: 101
make: *** [Makefile:36: docker] Error 1
make: Leaving directory '/var/lib/jenkins/workspace/scroll-tests/scroll/coordinator'
Compiling poseidon v0.2.0 (https://github.com/appliedzkp/poseidon.git#0b9965fb)`

Opinion

  1. Limited audience reach: If the platform has a narrow user base, it may struggle to attract a wide range of contributors and readers.

  2. Technical challenges: Issues with the platform's usability, speed, or reliability could deter potential contributors and readers from engaging with Scroll.

  3. Competition: There may be other similar platforms or services that offer similar features, making it difficult for Scroll to stand out and grow its user base.

  4. Monetization model: If the platform's monetization strategy is not appealing to contributors or readers, it may struggle to attract and retain users.

  5. Content quality control: Without effective mechanisms in place to ensure high-quality contributions, Scroll could face challenges in maintaining a reputable and engaging content ecosystem.

By addressing these potential disadvantages, Scroll can work towards fostering sustainable growth and overcoming obstacles that may hinder its success.

Suggestion for Scroll being its own Layer 2 network built on Ethereum (QuantumScale)

Suggestion for Scroll being its own Layer 2 network built on Ethereum

Name: QuantumScale

Concept:
QuantumScale is a novel Layer 2 scaling solution built on top of existing blockchain networks, initially focusing on Ethereum. It leverages the principles of quantum computing to achieve unprecedented scalability, speed, and security for decentralized applications (dApps) and smart contracts.

Key Features:

Quantum Sharding: Implement advanced quantum sharding techniques to divide the network into smaller, parallelized shards, each capable of processing transactions independently. This enables a significant increase in transaction throughput, reducing congestion and latency.

Quantum Entanglement Consensus: Introduce a consensus mechanism based on quantum entanglement, where the state of one quantum particle instantaneously influences the state of another, regardless of distance. This novel consensus algorithm enhances security and ensures rapid finality of transactions.

Quantum-resistant Cryptography: Utilize quantum-resistant cryptographic algorithms to protect user data and transaction information from potential threats posed by quantum computers. This future-proofs the network against emerging quantum threats.

Interoperability with Existing Chains: Enable seamless interoperability with other Layer 2 solutions and various blockchain networks. QuantumScale acts as a bridge, facilitating smooth asset transfers and communication between different blockchain ecosystems.

Decentralized Quantum Oracles: Integrate decentralized quantum oracles to provide real-world data to smart contracts on the QuantumScale network. This ensures that dApps can access reliable external information without compromising security.

User-friendly Development Toolkit: Offer an intuitive and developer-friendly toolkit that simplifies the migration of existing dApps and smart contracts to the QuantumScale network. This accelerates adoption and encourages the broader blockchain community to leverage the benefits of quantum scaling.

Community Governance: Implement a decentralized governance model that empowers the community to make key decisions regarding the evolution of QuantumScale. This ensures a fair and inclusive development process.

By combining quantum principles with blockchain technology, QuantumScale aims to usher in a new era of scalability, security, and interoperability, addressing the current limitations of Layer 1 networks like Ethereum.

Contributor Code of Conduct

Is it possible to add language that the complainee will be given a right to defend himself with regards to complaints? Seems like the below is one sided, what about fake complaints ?

Enforcement
Instances of abusive, harassing, or otherwise unacceptable behavior may be reported to the community leaders responsible for enforcement at [email protected]. All complaints will be reviewed and investigated promptly and fairly.

All community leaders are obligated to respect the privacy and security of the reporter of any incident.

Fee refund

I want to suggest a fee refund on scroll network. This can bring more new users to the network knowing there’s a fee refund on transactions.. it doesn’t have to be 100% refund.. just something the community would appreciate. Thank you

Handle of proving timeout

Now coordinator cannot know if roller proves timeout, and then it will give new task when roller is busy.

I suggest:

  1. Coordinator sends a task to roller.
  2. Coordinator marks this roller is timeout after time out.
  3. coordinator --> roller: You are timeout at this task. ( Roller can keep proving so far. )
  4. roller --> coordinator: I am idle now, you can give me the next task.

@HAOYUatHZ @icemelon @mask-pp

Scroll: Unrolling the Future of Ethereum Transactions

Scroll is a Layer 2 network built on top of Ethereum, designed to address its scalability limitations. Here's a deeper dive into Scroll:

What is Scroll?
Scroll is a Layer 2 network, It operates alongside the main Ethereum chain (Layer 1), handling transactions off-chain and periodically committing them back to the main chain for security. This allows for faster and cheaper transactions compared to Layer 1.

Zero-knowledge rollup
This specific type of rollup uses "zero-knowledge proofs" to prove the validity of transactions without revealing their actual data. This improves scalability and privacy.

EVM-compatibleScroll
is designed to be compatible with the Ethereum Virtual Machine (EVM), meaning developers can easily deploy existing Ethereum applications and smart contracts on Scroll without major modifications.

Key features of Scroll

  • Scalability: Transactions on Scroll are significantly faster and cheaper than on the main Ethereum chain. This makes it suitable for applications with high transaction volumes.

  • Security: Scroll inherits the security of the Ethereum blockchain as transactions are ultimately committed to the main chain.

  • Privacy: Zero-knowledge proofs ensure that only the validity of transactions is revealed, not their specific details, enhancing privacy.

  • Developer experience: The EVM compatibility makes it easy for developers familiar with Ethereum to build on Scroll.

Current status of Scroll:

  • Mainnet Launched: Scroll's mainnet officially launched in June 2023, making it fully operational for users and developers.
  • Ecosystem growth: Various DeFi protocols, NFT marketplaces, and other dApps are being built on Scroll, creating a growing ecosystem.
  • No Token yet: Although there's speculation, Scroll currently doesn't have its own token. However, future airdrops or token launches are possibilities.

I hope this clarifies your understanding of Scroll! Feel free to ask any further questions you might have.

Support eth_call, eth_gasEstimate state override set

Why should this feature exist?
state override set makes eth_call even more powerful and allows for deep code analyses.

Advantages of state override set (from geth docs):

It can be used by DApps to reduce the amount of contract code needed to be deployed on chain. Code that simply returns internal state or does pre-defined validations can be kept off chain and fed to the node on-demand.
It can be used for smart contract analysis by extending the code deployed on chain with custom methods and invoking them. This avoids having to download and reconstruct the entire state in a sandbox to run custom code against.
It can be used to debug smart contracts in an already deployed large suite of contracts by selectively overriding some code or state and seeing how execution changes. Specialized tooling will probably be necessary.

Things to add

Add something like pay master to scroll what do you think ??

Add readability and link to document

Scroll is a zkRollup Layer 2 dedicated to enhance Ethereum scalability through a bytecode-equivalent zkEVM circuit. This monorepo encompasses essential infrastructure components of the Scroll protocol. It contains the L1 and L2 contracts, the rollup node, the prover client, and the prover coordinator.

Append the details at the bottom of the readme file linking to https://docs.scroll.io/en/getting-started/overview/

Makes it friendly to new participants, developers and Search engine.

Reduce gas

Everything about scroll is good but gas fee is high when using scroll..please work on that or use polygon data availability to reduce cost of gas

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.