🥷🩸 Madara is a ⚡ blazing fast ⚡ Starknet sequencer, based on substrate, powered by Rust 🦀

Overview

GitHub Workflow Status Project license Pull Requests welcome

Madara: Starknet Sequencer on Substrate 🦀

Welcome to Madara, a blazing fast Starknet sequencer designed to make your projects soar!

Built on the robust Substrate framework and fast, thanks to Rust 🦀 , Madara delivers unmatched performance and scalability to power your Starknet-based Validity Rollup chain.

Dive into the world of Madara and join our passionate community of contributors! Together, we're pushing the boundaries of what's possible within the Starknet ecosystem.

🚀 Discover the unparalleled flexibility and might of Madara, your gateway to launching your very own Starknet appchain or L3. Harness the prowess of Cairo, while maintaining complete control over your tailor-made appchain, designed to meet your project's unique demands.

Experience the flexibility and power of Madara, enabling you to launch your very own Starknet appchain or L3. Harness the capabilities of Cairo while maintaining complete control over your custom appchain, tailored to your specific requirements. Madara is designed to empower a multitude of projects, fueling growth within the Starknet ecosystem.

🌟 Features

  • Starknet sequencer 🐺
  • Built on Substrate 🌐
  • Rust-based for safety and performance 🏎️
  • Custom FRAME pallets for Starknet functionality 🔧
  • Comprehensive documentation 📚
  • Active development and community support 🤝

📚 Documentation

Get started with our comprehensive documentation, which covers everything from project structure and architecture to benchmarking and running Madara:

🏗️ Build & Run

Want to dive straight in? Check out our Getting Started Guide for instructions on how to build and run Madara on your local machine.

🌐 Connect to the dev webapp

Once your Madara node is up and running, you can connect to the Polkadot-JS Apps front-end to interact with your chain. Connect here!

You can also connect to our customized fork of the Polkadot-JS Apps front-end, deployed on

Madara dev webapp.

You can also connect to our customized fork of the Polkadot-JS Apps front-end, deployed on Madara dev webapp.

🤝 Contribute

We're always looking for passionate developers to join our community and contribute to Madara. Check out our contributing guide for more information on how to get started.

📖 License

This project is licensed under the MIT license.

See LICENSE for more information.

Happy coding! 🎉

Contributors

Thanks goes to these wonderful people (emoji key):

Abdel @ StarkWare
Abdel @ StarkWare

💻
Timothée Delabrouille
Timothée Delabrouille

💻
0xevolve
0xevolve

💻
Lucas @ StarkWare
Lucas @ StarkWare

💻
Davide Silva
Davide Silva

💻
Finiam
Finiam

💻
Resende
Resende

💻
drspacemn
drspacemn

💻
Tarrence van As
Tarrence van As

💻
Siyuan Han
Siyuan Han

📖
Zé Diogo
Zé Diogo

💻
Matthias Monnier
Matthias Monnier

💻
glihm
glihm

💻
Antoine
Antoine

💻
Clément Walter
Clément Walter

💻
Elias Tazartes
Elias Tazartes

💻

This project follows the all-contributors specification. Contributions of any kind welcome!

Comments
  • Use storage to define ETH RPC URL

    Use storage to define ETH RPC URL

    Pull Request type

    Please check the type of change your PR introduces:

    • [ ] Bugfix
    • [ ] Feature
    • [ ] Code style update (formatting, renaming)
    • [x] Refactoring (no functional changes, no API changes)
    • [ ] Build-related changes
    • [ ] Documentation content changes
    • [ ] Testing
    • [ ] Other (please describe):

    What is the current behavior?

    Issue Number: #74

    ETH RPC URL is currently hardcoded and we want to have a way of setting it dynamically

    What is the new behavior?

    • Defining a ETH_MAINNET_RPC constant to use as key for the storage map
    • Adding a get_eth_rpc_url function that returns the value set in the storage or an error
    • Replacing the hardcoded URL with a call to the get_eth_rpc_url function

    Does this introduce a breaking change?

    • [ ] Yes
    • [x] No

    Other information

    opened by DavideSilva 6
  • feat: replace unwrap by error handling 🔨 #165

    feat: replace unwrap by error handling 🔨 #165

    Pull Request type

    Please check the type of change your PR introduces:

    • [ ] Bugfix
    • [X] Feature
    • [ ] Code style update (formatting, renaming)
    • [ ] Refactoring (no functional changes, no API changes)
    • [ ] Build-related changes
    • [ ] Documentation content changes
    • [ ] Testing
    • [ ] Other (please describe):

    What is the current behavior?

    There are some unwrap() functions that are used in the code. unwraps are dangerous to have within the runtime as a panic would simply crash the blockchain. Moreover it would impact forkless upgrades in the future.

    Issue Number: fixes #165

    What is the new behavior?

    unwraps are replaced by error handling patterns with pallet custom errors.

    Other information

    This PR only focuses on a single type of errors, Pending::<T>::try_append(transaction.clone())

    opened by 0xEniotna 5
  • build(deps): bump serde_json from 1.0.95 to 1.0.96

    build(deps): bump serde_json from 1.0.95 to 1.0.96

    Bumps serde_json from 1.0.95 to 1.0.96.

    Release notes

    Sourced from serde_json's releases.

    v1.0.96

    Commits

    Dependabot compatibility score

    Dependabot will resolve any conflicts with this PR as long as you don't alter it yourself. You can also trigger a rebase manually by commenting @dependabot rebase.


    Dependabot commands and options

    You can trigger Dependabot actions by commenting on this PR:

    • @dependabot rebase will rebase this PR
    • @dependabot recreate will recreate this PR, overwriting any edits that have been made to it
    • @dependabot merge will merge this PR after your CI passes on it
    • @dependabot squash and merge will squash and merge this PR after your CI passes on it
    • @dependabot cancel merge will cancel a previously requested merge and block automerging
    • @dependabot reopen will reopen this PR if it is closed
    • @dependabot close will close this PR and stop Dependabot recreating it. You can achieve the same result by closing it manually
    • @dependabot ignore this major version will close this PR and stop Dependabot creating any more for this major version (unless you reopen the PR or upgrade to it yourself)
    • @dependabot ignore this minor version will close this PR and stop Dependabot creating any more for this minor version (unless you reopen the PR or upgrade to it yourself)
    • @dependabot ignore this dependency will close this PR and stop Dependabot creating any more for this dependency (unless you reopen the PR or upgrade to it yourself)
    dependencies 
    opened by dependabot[bot] 4
  • Verify tx version on execute

    Verify tx version on execute

    Pull Request type

    Please check the type of change your PR introduces:

    • [ ] Bugfix
    • [X] Feature
    • [ ] Code style update (formatting, renaming)
    • [ ] Refactoring (no functional changes, no API changes)
    • [ ] Build-related changes
    • [ ] Documentation content changes
    • [ ] Testing
    • [ ] Other (please describe):

    What is the current behavior?

    The current execute method doesn't check if the transaction version being passed is valid or not. Transaction.version uses a U256 as the type.

    Issue Number: #127

    What is the new behavior?

    This PR adds a transaction version validation similar to what happens in the blockifier. It also replaces the usage of U256 for the version type in the Transaction struct to be an u8, as specified in the issue.

    Existing tests were updated, and new ones were added.

    Does this introduce a breaking change?

    • [ ] Yes
    • [X] No

    Other information

    opened by zediogoviana 4
  • feat: expose rpc server

    feat: expose rpc server

    Implement the starknet RPC spec: https://github.com/starkware-libs/starknet-specs/tree/master/api

    Pull Request type

    Please check the type of change your PR introduces:

    • [ ] Bugfix
    • [x] Feature
    • [ ] Code style update (formatting, renaming)
    • [ ] Refactoring (no functional changes, no API changes)
    • [ ] Build-related changes
    • [ ] Documentation content changes
    • [ ] Testing
    • [ ] Other (please describe):

    What is the current behavior?

    Issue Number: #29

    What is the new behavior?

    • declare and implement runtime APIs to expose the StarkNet pallet
    • define a starknet JSON-RPC api
    • implement the starknet JSON-RPC api

    Does this introduce a breaking change?

    • [ ] Yes
    • [x] No
    opened by drspacemn 4
  • Proxy pallet

    Proxy pallet

    Pull Request type

    Please check the type of change your PR introduces:

    • [ ] Bugfix
    • [x] Feature
    • [ ] Code style update (formatting, renaming)
    • [ ] Refactoring (no functional changes, no API changes)
    • [ ] Build-related changes
    • [ ] Documentation content changes
    • [ ] Testing
    • [ ] Other (please describe):

    What is the current behavior?

    All transactions would be submitted as unsigned transactions, meaning their origin would be None. Custom origins should be implemented in order to prevent a DOS attack vector -> Users could simply submit infinitely transactions and not being charged anything. Furthermore, custom origins will simplify further developments and interactions between pallets.

    We could imagine the following behavior : user -> call RPC -> sequencers only have the right to call submit_transaction extrinsic -> Transaction validated and executed -> Added to pending -> Block validated and transactions added to validated on L2.

    Does this introduce a breaking change?

    • [x] Yes
    • [ ] No

    Further ahead, some extrinsic calls to the starknet pallet should be done by going through the kaioshin-proxy pallet.

    opened by EvolveArt 4
  • build: remove substrate import by version as we specify the branch

    build: remove substrate import by version as we specify the branch

    You can import a crate at a specific state by version or by branch, but not both at the same time. I think the branch way is better because more expressive, and easier to make sure all the packages are at the same height

    opened by tdelabro 4
  • refacto(starknet): change to one tx for fees

    refacto(starknet): change to one tx for fees

    Pull Request type

    Please check the type of change your PR introduces:

    • [ ] Bugfix
    • [ ] Feature
    • [ ] Code style update (formatting, renaming)
    • [x] Refactoring (no functional changes, no API changes)
    • [ ] Build-related changes
    • [ ] Documentation content changes
    • [ ] Testing
    • [ ] Other (please describe):

    What is the current behavior?

    Issue Number: N/A

    What is the new behavior?

    • Only one tx for fee transfer which should improve performances

    Does this introduce a breaking change?

    • [ ] Yes
    • [x] No

    Other information

    opened by LucasLvy 3
  • Push whole block to digest

    Push whole block to digest

    Pull Request type

    Please check the type of change your PR introduces:

    • [x] Bugfix
    • [x] Feature

    What is the current behavior?

    Only the starknet block hash was present in the substrate block digest

    What is the new behavior?

    • the whole starknet block is now pushed into the substrate block digest
    • the block_tag variant of the BlockId rpc symbol is now serialized in snake_case

    Does this introduce a breaking change?

    • [x] Yes
    • [ ] No
    opened by tdelabro 3
  • build(deps): bump clap from 4.2.1 to 4.2.2

    build(deps): bump clap from 4.2.1 to 4.2.2

    Bumps clap from 4.2.1 to 4.2.2.

    Release notes

    Sourced from clap's releases.

    v4.2.2

    [4.2.2] - 2023-04-13

    Internal

    • Update dependencies
    Changelog

    Sourced from clap's changelog.

    [4.2.2] - 2023-04-13

    Internal

    • Update dependencies
    Commits

    Dependabot compatibility score

    Dependabot will resolve any conflicts with this PR as long as you don't alter it yourself. You can also trigger a rebase manually by commenting @dependabot rebase.


    Dependabot commands and options

    You can trigger Dependabot actions by commenting on this PR:

    • @dependabot rebase will rebase this PR
    • @dependabot recreate will recreate this PR, overwriting any edits that have been made to it
    • @dependabot merge will merge this PR after your CI passes on it
    • @dependabot squash and merge will squash and merge this PR after your CI passes on it
    • @dependabot cancel merge will cancel a previously requested merge and block automerging
    • @dependabot reopen will reopen this PR if it is closed
    • @dependabot close will close this PR and stop Dependabot recreating it. You can achieve the same result by closing it manually
    • @dependabot ignore this major version will close this PR and stop Dependabot creating any more for this major version (unless you reopen the PR or upgrade to it yourself)
    • @dependabot ignore this minor version will close this PR and stop Dependabot creating any more for this minor version (unless you reopen the PR or upgrade to it yourself)
    • @dependabot ignore this dependency will close this PR and stop Dependabot creating any more for this dependency (unless you reopen the PR or upgrade to it yourself)
    dependencies 
    opened by dependabot[bot] 3
  • build(deps): bump serde from 1.0.159 to 1.0.160

    build(deps): bump serde from 1.0.159 to 1.0.160

    Bumps serde from 1.0.159 to 1.0.160.

    Release notes

    Sourced from serde's releases.

    v1.0.160

    Commits

    Dependabot compatibility score

    Dependabot will resolve any conflicts with this PR as long as you don't alter it yourself. You can also trigger a rebase manually by commenting @dependabot rebase.


    Dependabot commands and options

    You can trigger Dependabot actions by commenting on this PR:

    • @dependabot rebase will rebase this PR
    • @dependabot recreate will recreate this PR, overwriting any edits that have been made to it
    • @dependabot merge will merge this PR after your CI passes on it
    • @dependabot squash and merge will squash and merge this PR after your CI passes on it
    • @dependabot cancel merge will cancel a previously requested merge and block automerging
    • @dependabot reopen will reopen this PR if it is closed
    • @dependabot close will close this PR and stop Dependabot recreating it. You can achieve the same result by closing it manually
    • @dependabot ignore this major version will close this PR and stop Dependabot creating any more for this major version (unless you reopen the PR or upgrade to it yourself)
    • @dependabot ignore this minor version will close this PR and stop Dependabot creating any more for this minor version (unless you reopen the PR or upgrade to it yourself)
    • @dependabot ignore this dependency will close this PR and stop Dependabot creating any more for this dependency (unless you reopen the PR or upgrade to it yourself)
    dependencies 
    opened by dependabot[bot] 3
  • feat(pallet_starknet): use a more precise state reader

    feat(pallet_starknet): use a more precise state reader

    Pull Request type

    Please check the type of change your PR introduces:

    • [x] Feature

    What is the current behavior?

    The whole blockchain state is loaded in the RAM each time we interact with it through the blockifier StateReader.

    • only the values that are actually accessed are loaded into RAM, on demand

    Does this introduce a breaking change?

    • [x] No

    Other information

    Tx per block went from: 12.56 to 19.33 on my machine

    opened by tdelabro 1
  • bug: npm test-seq doesn't work within the docker instance

    bug: npm test-seq doesn't work within the docker instance

    Bug Report

    Current behavior:

    When building the project with docker-compose -f infra/docker/docker-compose.yml up, we are not able to run test with npm run test-seq

    Expected behavior:

    Should be able to run npm run test-seq after building madara with docker-compose

    bug 
    opened by sparqet 0
  • Lucas/state reader

    Lucas/state reader

    Pull Request type

    Please check the type of change your PR introduces:

    • [ ] Bugfix
    • [ ] Feature
    • [ ] Code style update (formatting, renaming)
    • [x] Refactoring (no functional changes, no API changes)
    • [ ] Build-related changes
    • [ ] Documentation content changes
    • [ ] Testing
    • [ ] Other (please describe):

    What is the current behavior?

    Issue Number:

    What is the new behavior?

    • We don't copy the whole substrate state in a blockifier type anymore

    Does this introduce a breaking change?

    • [ ] Yes
    • [x] No

    Other information

    opened by LucasLvy 1
  • Compute real fees

    Compute real fees

    Description

    Right now we don't compute the real fees for a transaction we only use one as a value. The goal is to compute the transaction fees using the tx execution resources.

    Acceptance criteria

    • The fees are correctly computed
    enhancement 
    opened by LucasLvy 0
  • feat: RPC - add `starknet_getClassHashAt`

    feat: RPC - add `starknet_getClassHashAt`

    Implement starknet_getClassHashAt RPC that gets the contract class hash in the given block for the contract deployed at the given address

    Pull Request type

    Please check the type of change your PR introduces:

    • [ ] Bugfix
    • [X] Feature
    • [ ] Code style update (formatting, renaming)
    • [ ] Refactoring (no functional changes, no API changes)
    • [ ] Build-related changes
    • [ ] Documentation content changes
    • [ ] Testing
    • [ ] Other (please describe):

    What is the current behavior?

    Issue Number: #196

    What is the new behavior?

    • Add getClassHashAt to RPC client
    • Test getClassHashAt RPC method
    • Fix #196
    image

    Does this introduce a breaking change?

    • [ ] Yes
    • [X] No

    Other information

    opened by ftupas 2
  • feat: RPC - starknet_getBlockWithTxHashes

    feat: RPC - starknet_getBlockWithTxHashes

    Pull Request type

    Please check the type of change your PR introduces:

    • [ ] Bugfix
    • [x] Feature
    • [ ] Code style update (formatting, renaming)
    • [ ] Refactoring (no functional changes, no API changes)
    • [ ] Build-related changes
    • [ ] Documentation content changes
    • [ ] Testing
    • [ ] Other (please describe):

    What is the current behavior?

    Issue Number: #188

    What is the new behavior?

    • add starknet_getBlockWithTxHashes rpc endpoint.

    Does this introduce a breaking change?

    • [ ] Yes
    • [x] No

    Other information

    Response example: image

    opened by dubzn 1
Owner
Keep StarkNet Strange
Explore and push the frontiers of STARK based technology.
Keep StarkNet Strange
Starknet Stack let's you easily create new Cairo Starknet chains with their own sequencers, provers and verifiers

Starknet Stack flowchart LR A("Client") ==>|"Starknet Transactions"| subGraph0["Sequencer"] subGraph0 -.->|"Blocks with txs"| 300319["Watcher prover

Lambdaclass 7 Jul 11, 2023
Blazing fast toolkit for developing Starknet contracts.

Starknet Foundry Blazingly fast toolkit for developing Starknet contracts designed & developed by ex Protostar team from Software Mansion based on nat

Foundry 149 Aug 1, 2023
Channel some Ki with Lua scripts for sending transactions to Starknet, powered by Rust.

Kipt Kipt is leveraging the simplicity of Lua scripts to manage Starknet contracts using starknet-rs under the hood. With few lines, you can declare,

null 3 Nov 3, 2023
Substrate blockchain generated with Substrate Startkit

Substrate Node Template A new FRAME-based Substrate node, ready for hacking ?? Getting Started This project contains some configuration files to help

HoangDuong 1 Oct 19, 2021
Substrate blockchain generated with Substrate Startkit

Substrate Node Template A new FRAME-based Substrate node, ready for hacking ?? Getting Started This project contains some configuration files to help

HoangDuong 1 Oct 19, 2021
Substrate blockchain generated with Substrate Startkit

Substrate Node Template A new FRAME-based Substrate node, ready for hacking ?? Getting Started This project contains some configuration files to help

Liam Parry 0 Nov 6, 2021
🐺 Starknet Rust types 🦀

types-rs ?? Starknet Rust types ?? This repository is an initiative by a group of maintainers to address the fragmentation in the Starknet Rust ecosys

Starknet 22 Jun 2, 2023
Exploratory work on abigen in rust for Starknet 🦀

Starknet abigen for rust bindings This exploratory work aims at generating rust bindings from a contract ABI. Before the first release, we are termina

null 9 Sep 11, 2023
A blazing fast, type-safe template engine for Rust.

markup.rs A blazing fast, type-safe template engine for Rust. markup.rs is a template engine for Rust powered by procedural macros which parses the te

Utkarsh Kukreti 209 Dec 24, 2022
Foundry is a blazing fast, portable and modular toolkit for Ethereum application development written in Rust.

foundry Foundry is a blazing fast, portable and modular toolkit for Ethereum application development written in Rust. Foundry consists of: Forge: Ethe

Georgios Konstantopoulos 5.1k Jan 9, 2023
A low-level assembly language for the Ethereum Virtual Machine built in blazing-fast pure rust.

huff-rs • huff-rs is a Huff compiler built in rust. What is a Huff? Huff is a low-level programming language designed for developing highly optimized

Huff 276 Dec 31, 2022
Open sourcing a profitable MEV Arbitrage Bot written in blazing fast Rust.

Dex Arbitrage - MEV Bot Open sourcing a profitable MEV Arbitrage Bot written in blazing fast Rust. Before Starting I am a self-taught programmer, a co

null 4 Sep 18, 2023
Blazing fast Pedersen hash implementation for Node.JS

pedersen-fast Blazing fast Pedersen hash implementation for Node.JS Exposes starknet-crypto's implementation written in Rust as WASM package. Usage np

L2BEAT 7 Mar 10, 2023
Fast way to test a Substrate Runtime via RPC (eg. PolkadotJS UI).

runstrate Fast way to test a Substrate Runtime via RPC (eg. PolkadotJS UI). Build & Run git clone https://github.com/arturgontijo/runstrate cd runstra

Artur Gontijo 3 May 9, 2023
A Substrate-based PoA node supporting dynamic addition/removal of authorities.

Substrate PoA A sample Substrate runtime for a PoA blockchain that allows: Dynamically add/remove authorities. Automatically remove authorities when t

Gautam Dhameja 10 Jun 16, 2022
Polkadex - An Orderbook-based Decentralized Exchange using the Substrate Blockchain Framework.

What is Polkadex? ?? Polkadex is a Open Source, Decentralized Exchange Platform made using Substrate Blockchain Framework that provides traders with t

Polkadex 243 Dec 16, 2022
xx network Substrate based blockchain node

xx network Substrate based blockchain node Rust Setup First, complete the basic Rust setup instructions. MacOS users: setup to compile for Linux Befor

xx network 11 Dec 20, 2022
The Data Highway Substrate-based blockchain node.

DataHighway-Parachain, a parachain on the Polkadot network. Planned features include a decentralized LPWAN roaming hub for LoRaWAN IoT devices and network operator roaming agreements, participative mining, an inter-chain data market, and DAO governance.

DataHighway 11 Dec 2, 2022
A Web3.0 forum implemented based on Substrate

Substrate Node Template A fresh FRAME-based Substrate node, ready for hacking ?? Getting Started Follow the steps below to get started with the Node T

Daogang Tang 5 Mar 24, 2022