Code Monkey home page Code Monkey logo

mantlenetworkio / mantle Goto Github PK

View Code? Open in Web Editor NEW
220.0 23.0 99.0 112.47 MB

Mantle | Mass adoption of decentralized & token-governed technologies. With Mantle Network, Mantle Treasury, and token holder-governed products initiatives.

Home Page: https://www.mantle.xyz

License: MIT License

JavaScript 3.05% Shell 0.20% Makefile 0.16% Dockerfile 0.09% Go 75.38% TypeScript 8.46% Solidity 6.75% NSIS 0.16% Ruby 0.01% Python 0.05% HTML 0.08% Assembly 0.43% C 4.60% M4 0.18% Sage 0.21% Java 0.21%

mantle's Issues

SDK replace

Currently It seems that @bitdaoio/sdk not worked for bridging custom erc20 token between L1 and L2.

We will change it by the pre-version of @optimism/sdk.

CommitId:

940cfacb 作者 Matthew Slipper [email protected],2022/5/17 上午12:46

Fatal bug: two same sequencer

I used two sequencer to send the withdraw tx in the meantime, and the tx is in the pending state.

One of batch-submitter report the following errors:

15|10:06:04.465] Sequencer unable to craft batch tx       err="execution reverted: Attempted to append more elements than are available in the queue."
INFO [08-15|10:06:12.714] Sequencer fetching current block range 
INFO [08-15|10:06:12.718] Proposer fetching current block range 
INFO [08-15|10:06:12.982] Sequencer block range                    start=142 end=151
INFO [08-15|10:06:13.238] Proposer no updates                      start=142 end=142
INFO [08-15|10:06:13.258] Sequencer crafting batch tx              start=142 end=151 nonce=469 type=ZLIB
INFO [08-15|10:06:13.288] Sequencer testing batch size             calldata_size=12408 min_tx_size=32 max_tx_size=90000
INFO [08-15|10:06:13.288] Sequencer batch constructed              num_txs=9  final_size=12408 batch_type=ZLIB
ERROR[08-

When I restart the l2-geth in one cluster, it showed the following bug:

ERROR[08-15|10:18:29.206] Timestamp monotonicity violation         hash=0xaebc2f6e28717e3134acadd8452b10ac52c48a995a4e1196d88ca443c545491b latest=1660558709 tx=1660545605
ERROR[08-15|10:18:29.206] Blocknumber monotonicity violation       hash=0xaebc2f6e28717e3134acadd8452b10ac52c48a995a4e1196d88ca443c545491b new=7407764 old=7408448
ERROR[08-15|10:18:29.207] Monotonicity violation                   index=32    parent=1660555041 tx=1660545605
ERROR[08-15|10:18:29.207] Problem committing transaction           msg="nonce too high"
ERROR[08-15|10:18:29.207] Got error waiting for transaction to be added to chain msg="nonce too high"
CRIT [08-15|10:18:29.207] Sequencer cannot sync transactions to tip err="Verifier cannot sync transactions with backend l1: Cannot sync transactions with backend l1: Cannot apply transaction: nonce too high"

And it seemed that it can't restore from the pre-state, and we need to re-deploy the contracts on L1.

In production env, it is unbearable.

This is illegal operation. How should we avoid this when we also want the high availabity in the production env?

!!! Implement decentralized sequencers

Summary

Implement decentralized sequencers, there are two main goals here:

  • Anyone can participate in the sequencer set as a L2 block producer.
  • Reduce MEV, each sequencer participating in the consensus process is able to determine transaction ordering.

Task List

Layer 1

  • Sequencer set selection on L1 ,#139
    • Register Sequencer with mintAddress(l2geth/miner/miner.go#Miner.coinbase) and nodeID(l2geth/p2p/encode/node.go#Node.id).
    • Set Scheduler with nodeID.

Layer 2

L2geth

  • Rotation mechanism
    • Weighted round-robin algorithm, #16
    • Get Sequencer set from L1's contract, and update mintpower each epoch #55
    • Scheduler broadcast producers #197
    • Switching sequencer for liveless issue
      • Heartbeat: Listen to the connection between Scheduler and Sequencer via l2/geth/p2p pingpong mechanism(Identity authentication by nodeID).
      • Timeout: Sequencer does not commit the block to the scheduler on time(Identity authentication by mintAddress).
  • Convert l1->l2 transactions and submit these transactions to L2 : TBD
  • Add scheduler consensus in l2geth/consensus:
    • Implement consensus interface to produce block, #59
    • Get the block producer from scheduler, #60
    • Get blocks from scheduler/l2geth (Identity authentication by nodeID), #61

[dev] tss node

  • Websocket client

  • Tss Core
    p2p communication
    tss algorithm

  • Request Validation

fix fault-detector

Currently the fault-detector can't work as expected because of queryFilter will search from 0 to latest block.

re-deploy qa contracts

Started the two same sequencer service and sent the withdraw tx in the meantime polluted the contracts in goerli testnet.

So need to redeploy new contracts and changed the @bitdaoio/sdk.

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.