Skip to content

Commit

Permalink
merge: dev into devnet (#129)
Browse files Browse the repository at this point in the history
* Add release ci (#102)

* Create release.yml

* fix: typo

* fix: remove sha

* fix: specify ubuntu version in ci files

* fix: setup packages in ci files to match dependency

* fix: integrate file name rule to keep consistency between ci files

* fix: use gwemix version instead of ref name

* feat: update snapshot pending state

* Migrate governance-contracts (#89)

* migrate : governance-contract

* panic: core.GenerateChain

* fix: test panic

* fix : FakeMode, escape futureBlock

* fix : panic bad block

* refact : mv wemix_backends -> wemix package

* refact : remove common/bn

* refact : GovContracts

* fix : remove unused

* fix : rename confusing variable

* fix : unhandled error

* fix : code style

* refact: migrate openzeppelin contract:v4.6.0, contracts-upgrade:v4.7.0

* feat : update governancedeploy use wemix/bind

* fix : remove unused

* fix : default init envstorage values

* fix : gwemix.sh

* fix : compare fixed bytes

* fix : compare fixed bytes

* fix : typo

* fix : Flag type

* feat : update genesisConfig

* fix : remove unused code

* fix : deploy log

* feat : wemix simulated OptionFn

* feat : install solc

* fix : typo

* fix : typo

* fix : error verifyBlockSig

* fix : remove unused file

* fix : gwemix.sh

* fix: go.mod

* refact : using bind structs

* docs : gwemix.sh comment

* refact : submodule openzeppelin

* feat : using NCPExit

* wip : dev-ci

* fix : unuse generic

* fix : TestWemixBackends$

* feat : using generic, remove lint_test go@1.17

* fix: go:generate

* fix : clean code

* fix : remove comment

* fix : clean code

* feat : (governance abigen) compare data before writing to the file

* refact : using compiledTy

* feat : include sigs wemix/bind contracts

* refacet : move compiled, remove simulated-backend

* fix : clean code

* fix : clean code

* fix : detailed tick processing

* feat : [init-gov] add option password

* fix : gwemix.sh init-gov params

* fix : [init-gov] add option password

* refact : use const

* fix : use constant

* fix : loadGenesisConfig

* fix : check bootnodeExists

---------

Co-authored-by: egonspace <egonspace@gmail.com>

* fix : call staker address (#114)

fix : get contracts address StakingReward domain

* Feat: add local test scripts (#113)

* migrate : governance-contract

* panic: core.GenerateChain

* fix: test panic

* fix : FakeMode, escape futureBlock

* fix : panic bad block

* refact : mv wemix_backends -> wemix package

* refact : remove common/bn

* refact : GovContracts

* fix : remove unused

* fix : rename confusing variable

* fix : unhandled error

* fix : code style

* refact: migrate openzeppelin contract:v4.6.0, contracts-upgrade:v4.7.0

* feat : update governancedeploy use wemix/bind

* fix : remove unused

* fix : default init envstorage values

* fix : gwemix.sh

* fix : compare fixed bytes

* fix : compare fixed bytes

* fix : typo

* fix : Flag type

* feat : update genesisConfig

* fix : remove unused code

* fix : deploy log

* feat : wemix simulated OptionFn

* feat : install solc

* fix : typo

* fix : typo

* fix : error verifyBlockSig

* fix : remove unused file

* fix : gwemix.sh

* fix: go.mod

* refact : using bind structs

* docs : gwemix.sh comment

* refact : submodule openzeppelin

* feat : using NCPExit

* wip : dev-ci

* fix : unuse generic

* fix : TestWemixBackends$

* feat : using generic, remove lint_test go@1.17

* fix: go:generate

* fix : clean code

* fix : remove comment

* fix : clean code

* feat : (governance abigen) compare data before writing to the file

* refact : using compiledTy

* feat : include sigs wemix/bind contracts

* refacet : move compiled, remove simulated-backend

* fix : clean code

* fix : clean code

* fix : detailed tick processing

* Feat: add local test scripts

* Fix: minor fix

* feat : [init-gov] add option password

* fix : gwemix.sh init-gov params

* Chore: typo fix

* fix : [init-gov] add option password

* Fix: fix set-nodekey.sh

* Chore: push for test

* refact : use const

* Feat: add init-boot.sh

* Fix: minor fix

* chore: minor typo

* chore: add waiting message for port to open in init-boot.sh

* Chore: minor test

* chore: improve waiting message for port to open in init-boot.sh

* feat: add executable permission to gwemix.sh in init-boot.sh

* chore: improve gwemix start confirmation in init-boot.sh

* chore: update log file path and success message in init-boot.sh

* chore: Update init-boot.sh to improve gwemix start confirmation

* chore: Add pcscd service to Dockerfile.local.boot and start it in init-boot.sh

* chore: Update init-boot.sh to start gwemix service and improve start confirmation

* chore: Update Dockerfile and gen-docker-compose.sh for wemix node configuration

* chore: Refactor key generation and configuration scripts

* chore: Clean up unnecessary files and improve entrypoint in Dockerfile.local.boot and Dockerfile.local.node

* chore: Update init-boot.sh to start gwemix service and improve start confirmation

* chore: Update init-boot.sh to improve gwemix start confirmation

* chore: Update Makefile and Dockerfile.local.boot to include init-node.sh in build process

* chore: Update init-node.sh to check if the boot node has started before executing commands

* chore: Update init-node.sh to include datadir for wemix

* chore: Improve gwemix start confirmation and add etcd initialization

* chore: Update init-boot.sh to use console command for etcd initialization

* chore: Add curl and netcat-traditional to Dockerfile

* chore: Refactor local-docker-env scripts for key generation and configuration

* chore: Update Makefile-local-env to include wemix configuration files in build process

* Feat: Refactor local-docker-env scripts for key generation and configuration

* Chore: revert makefile

* chore: Update local-docker-env scripts for key generation and configuration

* chore: Update Dockerfile to include missing command for updating CA certificates

* chore: change local test readme to english

* chore: Refactor local-docker-env scripts for key generation and configuration

* chore: Update Dockerfile to use specified Ubuntu version in the Docker image

---------

Co-authored-by: felix-shin-wt <znzno700@wemade.com>
Co-authored-by: egonspace <egonspace@gmail.com>
Co-authored-by: felix-shin-wt <65204854+felix-shin-wt@users.noreply.github.com>

* add .prettierrc [solidity formatter] (#115)

* feat : add prettierrc

* fix : remove unuseful comment

* [add proposal type] governance general purpose (#116)

* feat : add execute

* fix : upgrade issue

* test : execute

* feat : append gap

* fix : gap size

* fix : [execute fail] return value

* fix : typo

* fix : typo

* feat : test code

* feat : gov abigen

* fix: update rocksdb to v6.28.2 (#120)

fix: update rocksdb v6.27.3 -> v6.28.2

* fix : remove memsize (#122)

* Feat: remove mem-size to support go1.23

* Fix: remove memsize from mobile/geth

* feat: add eth 68 protocol (#117)

* fix: eth 68 protocol

* fix: test failure

* fix: test failure

* fix: protocol name for eth68

* fix: support eth protocol name

* fix: lint error

* fix: use  protocol name when handshaking

* fix: protocol name

* fix: protocol match bug

* fix: not load NCPExit contract

* fix: apply comment

* Feat: version patch to 9 (#126)

:Feat: version patch to 9

---------

Co-authored-by: jed-wemade <127728629+jed-wemade@users.noreply.github.com>
Co-authored-by: egonspace <egon@wemade.com>
Co-authored-by: felix-shin-wt <65204854+felix-shin-wt@users.noreply.github.com>
Co-authored-by: egonspace <egonspace@gmail.com>
Co-authored-by: paul ahn <paulahn2022@wemade.com>
Co-authored-by: felix-shin-wt <znzno700@wemade.com>
  • Loading branch information
7 people authored Sep 12, 2024
1 parent 5d5fab7 commit a8bfbe9
Show file tree
Hide file tree
Showing 113 changed files with 35,723 additions and 2,215 deletions.
25 changes: 18 additions & 7 deletions .github/workflows/artifacts.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ on:
jobs:

build:
runs-on: ubuntu-latest
runs-on: ubuntu-20.04
steps:
- uses: actions/checkout@v4

Expand All @@ -18,19 +18,30 @@ jobs:
with:
go-version: '1.19'

- name: Setup packages
run: |
sudo apt install -y libjemalloc-dev liblz4-dev libsnappy-dev libzstd-dev libudev-dev
sudo apt remove -y bzip2 libbz2-dev zlib1g-dev
- name: Build Go-WEMIX tarball
run: USE_ROCKSDB=YES make gwemix.tar.gz

- name: Stat Go-WEMIX tarball
- name: Set version
run: |
ls -l build/gwemix.tar.gz
tar tf build/gwemix.tar.gz
GWEMIX_VERSION_META="v$(build/bin/gwemix version | awk '/^Version/{ print $2 }')"
echo "GWEMIX_VERSION_META=$GWEMIX_VERSION_META" >> "$GITHUB_ENV"
echo "GWEMIX_VERSION=$(echo $GWEMIX_VERSION_META | cut -d'-' -f1)" >> "$GITHUB_ENV"
echo "GWEMIX_META=$(echo $GWEMIX_VERSION_META | cut -d'-' -f2-)" >> "$GITHUB_ENV"
echo "GWEMIX_COMMITHASH=$(echo ${{ github.sha }} | cut -c1-8)" >> "$GITHUB_ENV"
- name: Display ELF info
run: readelf -dV build/bin/gwemix

- name: Move results to artifact
run: mv build/gwemix.tar.gz gwemix-${{ github.ref_name }}-${{ github.sha }}-linux-amd64-rocksdb.tar.gz
run: mv build/gwemix.tar.gz gwemix-${{ env.GWEMIX_VERSION_META }}-${{ env.GWEMIX_COMMITHASH }}-linux-amd64-rocksdb.tar.gz

- name: Upload Go-WEMIX
uses: actions/upload-artifact@v4
with:
name: artifact-${{ github.ref_name }}-${{ github.sha }}
path: gwemix-${{ github.ref_name }}-${{ github.sha }}-linux-amd64-rocksdb.tar.gz
name: artifact-${{ env.GWEMIX_VERSION_META }}-${{ env.GWEMIX_COMMITHASH }}
path: gwemix-${{ env.GWEMIX_VERSION_META }}-${{ env.GWEMIX_COMMITHASH }}-linux-amd64-rocksdb.tar.gz
7 changes: 5 additions & 2 deletions .github/workflows/dev-ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ jobs:
strategy:
fail-fast: false
matrix:
version: [1.17, 1.18, 1.19]
version: [1.18, 1.19]
runs-on: ubuntu-20.04
steps:
- uses: actions/checkout@v3
Expand All @@ -38,7 +38,7 @@ jobs:
uses: actions/setup-go@v3
with:
go-version: ${{ matrix.version }}

- name: Check Lint
run: make lint

Expand All @@ -49,6 +49,9 @@ jobs:
with:
ref: ${{ github.event.pull_request.head.sha }}

- name: Set up Wemix Submodules
run: git submodule update --init wemix/

- name: Set up Go
uses: actions/setup-go@v3
with:
Expand Down
5 changes: 4 additions & 1 deletion .github/workflows/gwemix-ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ jobs:
strategy:
fail-fast: false
matrix:
version: [1.17, 1.18, 1.19]
version: [1.18, 1.19]
runs-on: ubuntu-20.04
steps:
- uses: actions/checkout@v3
Expand All @@ -49,6 +49,9 @@ jobs:
with:
ref: ${{ github.event.pull_request.head.sha }}

- name: Set up Wemix Submodules
run: git submodule update --init wemix/

- name: Set up Go
uses: actions/setup-go@v3
with:
Expand Down
5 changes: 4 additions & 1 deletion .github/workflows/master-ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ jobs:
strategy:
fail-fast: false
matrix:
version: [1.17, 1.18, 1.19]
version: [1.18, 1.19]
runs-on: ubuntu-20.04
steps:
- uses: actions/checkout@v3
Expand All @@ -49,6 +49,9 @@ jobs:
with:
ref: ${{ github.event.pull_request.head.sha }}

- name: Set up Wemix Submodules
run: git submodule update --init wemix/

- name: Set up Go
uses: actions/setup-go@v3
with:
Expand Down
58 changes: 58 additions & 0 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,58 @@
name: "Release a tag as draft"

on:
push:
tags:
- w*

jobs:

build:
runs-on: ubuntu-20.04
steps:
- uses: actions/checkout@v4

- name: Set up Go
uses: actions/setup-go@v4
with:
go-version: '1.19'

- name: Setup packages
run: |
sudo apt install -y libjemalloc-dev liblz4-dev libsnappy-dev libzstd-dev libudev-dev
sudo apt remove -y bzip2 libbz2-dev zlib1g-dev
- name: Build Go-WEMIX tarball (rocksdb)
run: USE_ROCKSDB=YES make gwemix.tar.gz

- name: Set version
run: |
GWEMIX_VERSION_META="v$(build/bin/gwemix version | awk '/^Version/{ print $2 }')"
echo "GWEMIX_VERSION_META=$GWEMIX_VERSION_META" >> "$GITHUB_ENV"
echo "GWEMIX_VERSION=$(echo $GWEMIX_VERSION_META | cut -d'-' -f1)" >> "$GITHUB_ENV"
echo "GWEMIX_META=$(echo $GWEMIX_VERSION_META | cut -d'-' -f2-)" >> "$GITHUB_ENV"
echo "GWEMIX_COMMITHASH=$(echo ${{ github.sha }} | cut -c1-8)" >> "$GITHUB_ENV"
- name: Display ELF info (rocksdb)
run: readelf -dV build/bin/gwemix

- name: Move results to artifact (rocksdb)
run: mv build/gwemix.tar.gz gwemix-${{ env.GWEMIX_VERSION_META }}-${{ env.GWEMIX_COMMITHASH }}-linux-amd64-rocksdb.tar.gz

- name: Build Go-WEMIX tarball (leveldb)
run: USE_ROCKSDB=NO make gwemix.tar.gz

- name: Display ELF info (leveldb)
run: readelf -dV build/bin/gwemix

- name: Move results to artifact (leveldb)
run: mv build/gwemix.tar.gz gwemix-${{ env.GWEMIX_VERSION_META }}-${{ env.GWEMIX_COMMITHASH }}-linux-amd64-leveldb.tar.gz

- name: GH Release
uses: softprops/action-gh-release@v2.0.5
with:
name: WEMIX3.0 Mainnet and Testnet Build (${{ env.GWEMIX_VERSION }})
draft: true
files: |
gwemix-${{ env.GWEMIX_VERSION_META }}-${{ env.GWEMIX_COMMITHASH }}-linux-amd64-rocksdb.tar.gz
gwemix-${{ env.GWEMIX_VERSION_META }}-${{ env.GWEMIX_COMMITHASH }}-linux-amd64-leveldb.tar.gz
6 changes: 6 additions & 0 deletions .gitmodules
Original file line number Diff line number Diff line change
Expand Up @@ -12,3 +12,9 @@
[submodule "etcd"]
path = etcd
url = https://github.com/metadium/etcd
[submodule "wemix/governance-contract/contracts/openzeppelin/contracts-upgradeable"]
path = wemix/governance-contract/contracts/openzeppelin/contracts-upgradeable
url = https://github.com/OpenZeppelin/openzeppelin-contracts-upgradeable
[submodule "wemix/governance-contract/contracts/openzeppelin/contracts"]
path = wemix/governance-contract/contracts/openzeppelin/contracts
url = https://github.com/OpenZeppelin/openzeppelin-contracts
79 changes: 5 additions & 74 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -31,16 +31,14 @@ endif

gwemix.tar.gz: gwemix logrot
@[ -d build/conf ] || mkdir -p build/conf
@cp -p wemix/scripts/gwemix.sh wemix/scripts/solc.sh build/bin/
@cp -p wemix/scripts/gwemix.sh build/bin/
@cp -p wemix/scripts/config.json.example \
wemix/scripts/genesis-template.json \
wemix/contracts/WemixGovernance.js \
wemix/scripts/deploy-governance.js \
build/conf/
@(cd build; tar cfz gwemix.tar.gz bin conf)
@echo "Done building build/gwemix.tar.gz"

gwemix: rocksdb wemix/governance_abi.go
gwemix: rocksdb
ifeq ($(USE_ROCKSDB), NO)
$(GORUN) build/ci.go install $(ROCKSDB_TAG) ./cmd/gwemix
else
Expand Down Expand Up @@ -68,7 +66,7 @@ else
$(GORUN) build/ci.go install $(ROCKSDB_TAG) ./cmd/dbbench
endif

all: wemix/governance_abi.go
all:
$(GORUN) build/ci.go install

android:
Expand All @@ -89,12 +87,12 @@ test: all
test-short: all
$(GORUN) build/ci.go test -short

lint: wemix/governance_abi.go ## Run linters.
lint: ## Run linters.
$(GORUN) build/ci.go lint

clean:
env GO111MODULE=on go clean -cache
rm -fr build/_workspace/pkg/ $(GOBIN)/* build/conf wemix/admin_abi.go wemix/governance_abi.go
rm -fr build/_workspace/pkg/ $(GOBIN)/* build/conf
@ROCKSDB_DIR=$(ROCKSDB_DIR); \
if [ -e $${ROCKSDB_DIR}/Makefile ]; then \
cd $${ROCKSDB_DIR}; \
Expand Down Expand Up @@ -132,70 +130,3 @@ rocksdb:
@[ ! -e rocksdb/.git ] && git submodule update --init rocksdb; \
cd $(ROCKSDB_DIR) && PORTABLE=1 make -j8 static_lib;
endif

AWK_CODE=' \
BEGIN { print "package wemix"; bin = 0; name = ""; abi = ""; } \
/^{/ { bin = 1; abi = ""; name = ""; } \
/^}/ { bin = 0; abi = abi "}"; print "var " name "Abi = `" abi "`"; } \
{ \
if (bin == 1) { \
abi = abi $$0; \
if ($$1 == "\"contractName\":") { \
name = $$2; \
gsub(",|\"", "", name); \
} \
} \
}'

wemix/admin_abi.go: wemix/contracts/WemixAdmin-template.sol build/bin/solc
@PATH=${PATH}:build/bin wemix/scripts/solc.sh -f abi $< /tmp/junk.$$$$; \
cat /tmp/junk.$$$$ | awk $(AWK_CODE) > $@; \
rm -f /tmp/junk.$$$$;

AWK_CODE_2=' \
BEGIN { print "package wemix\n"; } \
/^var Registry_contract/ { \
sub("^var[^(]*\\(","",$$0); sub("\\);$$","",$$0); \
n = "Registry"; \
print "var " n "Abi = `{ \"contractName\": \"" n "\", \"abi\": " $$0 "}`"; \
} \
/^var StakingImp_contract/ { \
sub("^var[^(]*\\(","",$$0); sub("\\);$$","",$$0); \
n = "Staking"; \
print "var " n "Abi = `{ \"contractName\": \"" n "\", \"abi\": " $$0 "}`"; \
} \
/^var EnvStorageImp_contract/ { \
sub("^var[^(]*\\(","",$$0); sub("\\);$$","",$$0); \
n = "EnvStorageImp"; \
print "var " n "Abi = `{ \"contractName\": \"" n "\", \"abi\": " $$0 "}`"; \
} \
/^var GovImp_contract/ { \
sub("^var[^(]*\\(","",$$0); sub("\\);$$","",$$0); \
n = "Gov"; \
print "var " n "Abi = `{ \"contractName\": \"" n "\", \"abi\": " $$0 "}`"; \
}'

wemix/governance_abi.go: wemix/contracts/WemixGovernance.js
@cat $< | awk $(AWK_CODE_2) > $@

ifneq ($(shell uname), Linux)

build/bin/solc:
@test 1

else

SOLC_URL=https://github.com/ethereum/solidity/releases/download/v0.4.24/solc-static-linux
build/bin/solc:
@[ -d build/bin ] || mkdir -p build/bin; \
if [ ! -x build/bin/solc ]; then \
if which curl > /dev/null 2>&1; then \
curl -Ls -o build/bin/solc $(SOLC_URL); \
chmod +x build/bin/solc; \
elif which wget > /dev/null 2>&1; then \
wget -nv -o build/bin/solc $(SOLC_URL); \
chmod +x build/bin/solc; \
fi \
fi

endif
Loading

0 comments on commit a8bfbe9

Please sign in to comment.