Skip to content

Commit

Permalink
Refactor module name(#134)
Browse files Browse the repository at this point in the history
* first commit staged

* refactor

* miner works via pipeline

* reset ccc before apply empty block

* core/txpool, eth, miner: pre-filter dynamic fees during pending tx re… (#130)

* refactor module name to morph

* fix TestBuildBlockTimeout

---------

Co-authored-by: fletcher.fan <[email protected]>
Co-authored-by: Ryan He <[email protected]>
  • Loading branch information
3 people authored Aug 16, 2024
1 parent 45fb758 commit 8b7c056
Show file tree
Hide file tree
Showing 895 changed files with 4,304 additions and 4,580 deletions.
22 changes: 11 additions & 11 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
ARG COMMIT=""
ARG VERSION=""
ARG BUILDNUM=""
ARG SCROLL_LIB_PATH=/scroll/lib
ARG MORPH_LIB_PATH=/morph/lib

# Build libzkp dependency
FROM scrolltech/go-rust-builder:go-1.21-rust-nightly-2023-12-03 as chef
Expand All @@ -26,14 +26,14 @@ FROM scrolltech/go-rust-builder:go-1.21-rust-nightly-2023-12-03 as builder

ADD . /go-ethereum

ARG SCROLL_LIB_PATH
ARG MORPH_LIB_PATH

RUN mkdir -p $SCROLL_LIB_PATH
RUN mkdir -p $MORPH_LIB_PATH

COPY --from=zkp-builder /app/target/release/libzkp.so $SCROLL_LIB_PATH
COPY --from=zkp-builder /app/target/release/libzkp.so $MORPH_LIB_PATH

ENV LD_LIBRARY_PATH=$LD_LIBRARY_PATH:$SCROLL_LIB_PATH
ENV CGO_LDFLAGS="-L$SCROLL_LIB_PATH -Wl,-rpath,$SCROLL_LIB_PATH"
ENV LD_LIBRARY_PATH=$LD_LIBRARY_PATH:$MORPH_LIB_PATH
ENV CGO_LDFLAGS="-L$MORPH_LIB_PATH -Wl,-rpath,$MORPH_LIB_PATH"

RUN cd /go-ethereum && env GO111MODULE=on go run build/ci.go install -buildtags circuit_capacity_checker ./cmd/geth

Expand All @@ -45,14 +45,14 @@ RUN apt-get -qq update \

COPY --from=builder /go-ethereum/build/bin/geth /usr/local/bin/

ARG SCROLL_LIB_PATH
ARG MORPH_LIB_PATH

RUN mkdir -p $SCROLL_LIB_PATH
RUN mkdir -p $MORPH_LIB_PATH

COPY --from=zkp-builder /app/target/release/libzkp.so $SCROLL_LIB_PATH
COPY --from=zkp-builder /app/target/release/libzkp.so $MORPH_LIB_PATH

ENV LD_LIBRARY_PATH=$LD_LIBRARY_PATH:$SCROLL_LIB_PATH
ENV CGO_LDFLAGS="-ldl -L$SCROLL_LIB_PATH -Wl,-rpath,$SCROLL_LIB_PATH"
ENV LD_LIBRARY_PATH=$LD_LIBRARY_PATH:$MORPH_LIB_PATH
ENV CGO_LDFLAGS="-ldl -L$MORPH_LIB_PATH -Wl,-rpath,$MORPH_LIB_PATH"

EXPOSE 8545 8546 30303 30303/udp
ENTRYPOINT ["geth"]
Expand Down
4 changes: 2 additions & 2 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -79,10 +79,10 @@ image:
docker build -f Dockerfile -t morph-geth:latest .

docker:
docker build --platform linux/x86_64 -t scrolltech/l2geth:latest ./ -f Dockerfile
docker build --platform linux/x86_64 -t morph/l2geth:latest ./ -f Dockerfile

mockccc_docker:
docker build --platform linux/x86_64 -t scrolltech/l2geth:latest ./ -f Dockerfile.mockccc
docker build --platform linux/x86_64 -t morph/l2geth:latest ./ -f Dockerfile.mockccc

mockccc_alpine_docker:
docker build -t morph/l2geth:latest ./ -f Dockerfile.mockccc.alpine
Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ Morph Chain adapts the Go Ethereum to run as the execution layer. It starts its

### ZKTrie Storage

Another implement for storage trie, base on patricia merkle tree, has been induced. It is feasible to zk proving in the storage part. It is specified as a flag in gensis, set `config.scroll.useZktrie` to true for enabling it.
Another implement for storage trie, base on patricia merkle tree, has been induced. It is feasible to zk proving in the storage part. It is specified as a flag in gensis, set `config.morph.useZktrie` to true for enabling it.

Notice that currently the snapshot would be disabled by the zktrie implement.

Expand Down
2 changes: 1 addition & 1 deletion SECURITY.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ Please see [Releases](https://github.com/morph-l2/go-ethereum/releases). We reco

## Audit reports

Audit reports are published in the `docs` folder: https://github.com/morph-l2/go-ethereum/tree/master/docs/audits
Audit reports are published in the `docs` folder: https://github.com/morph-l2/go-ethereum/tree/main/docs/audits

| Scope | Date | Report Link |
| ------- | ------- | ----------- |
Expand Down
4 changes: 2 additions & 2 deletions accounts/abi/abi.go
Original file line number Diff line number Diff line change
Expand Up @@ -23,8 +23,8 @@ import (
"fmt"
"io"

"github.com/scroll-tech/go-ethereum/common"
"github.com/scroll-tech/go-ethereum/crypto"
"github.com/morph-l2/go-ethereum/common"
"github.com/morph-l2/go-ethereum/crypto"
)

// The ABI holds information about a contract's context and available
Expand Down
40 changes: 23 additions & 17 deletions accounts/abi/abi_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -26,9 +26,9 @@ import (
"strings"
"testing"

"github.com/scroll-tech/go-ethereum/common"
"github.com/scroll-tech/go-ethereum/common/math"
"github.com/scroll-tech/go-ethereum/crypto"
"github.com/morph-l2/go-ethereum/common"
"github.com/morph-l2/go-ethereum/common/math"
"github.com/morph-l2/go-ethereum/crypto"
)

const jsondata = `
Expand Down Expand Up @@ -165,8 +165,9 @@ func TestInvalidABI(t *testing.T) {

// TestConstructor tests a constructor function.
// The test is based on the following contract:
// contract TestConstructor {
// constructor(uint256 a, uint256 b) public{}
//
// contract TestConstructor {
// constructor(uint256 a, uint256 b) public{}
// }
func TestConstructor(t *testing.T) {
json := `[{ "inputs": [{"internalType": "uint256","name": "a","type": "uint256" },{ "internalType": "uint256","name": "b","type": "uint256"}],"stateMutability": "nonpayable","type": "constructor"}]`
Expand Down Expand Up @@ -724,16 +725,19 @@ func TestBareEvents(t *testing.T) {
}

// TestUnpackEvent is based on this contract:
// contract T {
// event received(address sender, uint amount, bytes memo);
// event receivedAddr(address sender);
// function receive(bytes memo) external payable {
// received(msg.sender, msg.value, memo);
// receivedAddr(msg.sender);
// }
// }
//
// contract T {
// event received(address sender, uint amount, bytes memo);
// event receivedAddr(address sender);
// function receive(bytes memo) external payable {
// received(msg.sender, msg.value, memo);
// receivedAddr(msg.sender);
// }
// }
//
// When receive("X") is called with sender 0x00... and value 1, it produces this tx receipt:
// receipt{status=1 cgas=23949 bloom=00000000004000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000800000000000000000000000000000000000040200000000000000000000000000000000001000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000080000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000 logs=[log: b6818c8064f645cd82d99b59a1a267d6d61117ef [75fd880d39c1daf53b6547ab6cb59451fc6452d27caa90e5b6649dd8293b9eed] 000000000000000000000000376c47978271565f56deb45495afa69e59c16ab200000000000000000000000000000000000000000000000000000000000000010000000000000000000000000000000000000000000000000000000000000060000000000000000000000000000000000000000000000000000000000000000158 9ae378b6d4409eada347a5dc0c180f186cb62dc68fcc0f043425eb917335aa28 0 95d429d309bb9d753954195fe2d69bd140b4ae731b9b5b605c34323de162cf00 0]}
//
// receipt{status=1 cgas=23949 bloom=00000000004000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000800000000000000000000000000000000000040200000000000000000000000000000000001000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000080000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000 logs=[log: b6818c8064f645cd82d99b59a1a267d6d61117ef [75fd880d39c1daf53b6547ab6cb59451fc6452d27caa90e5b6649dd8293b9eed] 000000000000000000000000376c47978271565f56deb45495afa69e59c16ab200000000000000000000000000000000000000000000000000000000000000010000000000000000000000000000000000000000000000000000000000000060000000000000000000000000000000000000000000000000000000000000000158 9ae378b6d4409eada347a5dc0c180f186cb62dc68fcc0f043425eb917335aa28 0 95d429d309bb9d753954195fe2d69bd140b4ae731b9b5b605c34323de162cf00 0]}
func TestUnpackEvent(t *testing.T) {
const abiJSON = `[{"constant":false,"inputs":[{"name":"memo","type":"bytes"}],"name":"receive","outputs":[],"payable":true,"stateMutability":"payable","type":"function"},{"anonymous":false,"inputs":[{"indexed":false,"name":"sender","type":"address"},{"indexed":false,"name":"amount","type":"uint256"},{"indexed":false,"name":"memo","type":"bytes"}],"name":"received","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"name":"sender","type":"address"}],"name":"receivedAddr","type":"event"}]`
abi, err := JSON(strings.NewReader(abiJSON))
Expand Down Expand Up @@ -1080,8 +1084,9 @@ func TestDoubleDuplicateMethodNames(t *testing.T) {
// TestDoubleDuplicateEventNames checks that if send0 already exists, there won't be a name
// conflict and that the second send event will be renamed send1.
// The test runs the abi of the following contract.
// contract DuplicateEvent {
// event send(uint256 a);
//
// contract DuplicateEvent {
// event send(uint256 a);
// event send0();
// event send();
// }
Expand All @@ -1108,7 +1113,8 @@ func TestDoubleDuplicateEventNames(t *testing.T) {
// TestUnnamedEventParam checks that an event with unnamed parameters is
// correctly handled.
// The test runs the abi of the following contract.
// contract TestEvent {
//
// contract TestEvent {
// event send(uint256, uint256);
// }
func TestUnnamedEventParam(t *testing.T) {
Expand Down
14 changes: 7 additions & 7 deletions accounts/abi/bind/auth.go
Original file line number Diff line number Diff line change
Expand Up @@ -24,13 +24,13 @@ import (
"io/ioutil"
"math/big"

"github.com/scroll-tech/go-ethereum/accounts"
"github.com/scroll-tech/go-ethereum/accounts/external"
"github.com/scroll-tech/go-ethereum/accounts/keystore"
"github.com/scroll-tech/go-ethereum/common"
"github.com/scroll-tech/go-ethereum/core/types"
"github.com/scroll-tech/go-ethereum/crypto"
"github.com/scroll-tech/go-ethereum/log"
"github.com/morph-l2/go-ethereum/accounts"
"github.com/morph-l2/go-ethereum/accounts/external"
"github.com/morph-l2/go-ethereum/accounts/keystore"
"github.com/morph-l2/go-ethereum/common"
"github.com/morph-l2/go-ethereum/core/types"
"github.com/morph-l2/go-ethereum/crypto"
"github.com/morph-l2/go-ethereum/log"
)

// ErrNoChainID is returned whenever the user failed to specify a chain id.
Expand Down
6 changes: 3 additions & 3 deletions accounts/abi/bind/backend.go
Original file line number Diff line number Diff line change
Expand Up @@ -21,9 +21,9 @@ import (
"errors"
"math/big"

"github.com/scroll-tech/go-ethereum"
"github.com/scroll-tech/go-ethereum/common"
"github.com/scroll-tech/go-ethereum/core/types"
"github.com/morph-l2/go-ethereum"
"github.com/morph-l2/go-ethereum/common"
"github.com/morph-l2/go-ethereum/core/types"
)

var (
Expand Down
42 changes: 21 additions & 21 deletions accounts/abi/bind/backends/simulated.go
Original file line number Diff line number Diff line change
Expand Up @@ -24,27 +24,27 @@ import (
"sync"
"time"

"github.com/scroll-tech/go-ethereum"
"github.com/scroll-tech/go-ethereum/accounts/abi"
"github.com/scroll-tech/go-ethereum/accounts/abi/bind"
"github.com/scroll-tech/go-ethereum/common"
"github.com/scroll-tech/go-ethereum/common/hexutil"
"github.com/scroll-tech/go-ethereum/common/math"
"github.com/scroll-tech/go-ethereum/consensus"
"github.com/scroll-tech/go-ethereum/consensus/ethash"
"github.com/scroll-tech/go-ethereum/core"
"github.com/scroll-tech/go-ethereum/core/bloombits"
"github.com/scroll-tech/go-ethereum/core/rawdb"
"github.com/scroll-tech/go-ethereum/core/state"
"github.com/scroll-tech/go-ethereum/core/types"
"github.com/scroll-tech/go-ethereum/core/vm"
"github.com/scroll-tech/go-ethereum/eth/filters"
"github.com/scroll-tech/go-ethereum/ethdb"
"github.com/scroll-tech/go-ethereum/event"
"github.com/scroll-tech/go-ethereum/log"
"github.com/scroll-tech/go-ethereum/params"
"github.com/scroll-tech/go-ethereum/rollup/fees"
"github.com/scroll-tech/go-ethereum/rpc"
"github.com/morph-l2/go-ethereum"
"github.com/morph-l2/go-ethereum/accounts/abi"
"github.com/morph-l2/go-ethereum/accounts/abi/bind"
"github.com/morph-l2/go-ethereum/common"
"github.com/morph-l2/go-ethereum/common/hexutil"
"github.com/morph-l2/go-ethereum/common/math"
"github.com/morph-l2/go-ethereum/consensus"
"github.com/morph-l2/go-ethereum/consensus/ethash"
"github.com/morph-l2/go-ethereum/core"
"github.com/morph-l2/go-ethereum/core/bloombits"
"github.com/morph-l2/go-ethereum/core/rawdb"
"github.com/morph-l2/go-ethereum/core/state"
"github.com/morph-l2/go-ethereum/core/types"
"github.com/morph-l2/go-ethereum/core/vm"
"github.com/morph-l2/go-ethereum/eth/filters"
"github.com/morph-l2/go-ethereum/ethdb"
"github.com/morph-l2/go-ethereum/event"
"github.com/morph-l2/go-ethereum/log"
"github.com/morph-l2/go-ethereum/params"
"github.com/morph-l2/go-ethereum/rollup/fees"
"github.com/morph-l2/go-ethereum/rpc"
)

// This nil assignment ensures at compile time that SimulatedBackend implements bind.ContractBackend.
Expand Down
Loading

0 comments on commit 8b7c056

Please sign in to comment.