Skip to content

Commit

Permalink
Remove omnilock (#77)
Browse files Browse the repository at this point in the history
* Remove omnilock

It is moved to: https://github.com/cryptape/omnilock

* About omnilock
  • Loading branch information
XuJiandong authored Jan 19, 2024
1 parent abdcb11 commit c643c18
Show file tree
Hide file tree
Showing 35 changed files with 20 additions and 14,623 deletions.
4 changes: 0 additions & 4 deletions .github/workflows/rust.yml
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,3 @@ jobs:
run: cd tests/xudt_rce_rust && cargo test
- name: Run xudt simulator tests
run: cd tests/xudt_rce && bash run.sh
- name: Run omni_lock tests
run: cd tests/omni_lock_rust && cargo test
- name: Run omni_lock simulator tests
run: cd tests/omni_lock && bash run.sh
21 changes: 3 additions & 18 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -9,9 +9,6 @@ SECP256K1_SRC_20210801 := deps/secp256k1-20210801/src/ecmult_static_pre_context.

XUDT_RCE_CFLAGS=$(subst ckb-c-std-lib,ckb-c-stdlib-20210713,$(CFLAGS)) -I deps/sparse-merkle-tree/c

OMNI_LOCK_CFLAGS :=$(subst ckb-c-std-lib,ckb-c-stdlib-20210801,$(CFLAGS)) -I deps/sparse-merkle-tree/c
OMNI_LOCK_CFLAGS := $(subst secp256k1,secp256k1-20210801,$(OMNI_LOCK_CFLAGS))

PROTOCOL_HEADER := c/blockchain.h
PROTOCOL_SCHEMA := c/blockchain.mol
PROTOCOL_VERSION := d75e4c56ffa40e17fd2fe477da3f98c5578edcd1
Expand All @@ -28,7 +25,8 @@ PASSED_MBEDTLS_CFLAGS := -O3 -fPIC -nostdinc -nostdlib -DCKB_DECLARATION_ONLY -I
BUILDER_DOCKER := nervos/ckb-riscv-gnu-toolchain@sha256:aae8a3f79705f67d505d1f1d5ddc694a4fd537ed1c7e9622420a470d59ba2ec3
CLANG_FORMAT_DOCKER := kason223/clang-format@sha256:3cce35b0400a7d420ec8504558a02bdfc12fd2d10e40206f140c4545059cd95d

all: build/simple_udt build/anyone_can_pay build/always_success build/validate_signature_rsa build/xudt_rce build/rce_validator build/omni_lock
all: build/simple_udt build/anyone_can_pay build/always_success build/validate_signature_rsa build/xudt_rce build/rce_validator \
$(SECP256K1_SRC_20210801) build/secp256k1_data_info_20210801.h

all-via-docker: ${PROTOCOL_HEADER}
docker run --rm -v `pwd`:/code ${BUILDER_DOCKER} bash -c "cd /code && make"
Expand Down Expand Up @@ -112,9 +110,7 @@ validate_signature_rsa_clean:
${PROTOCOL_SCHEMA}:
curl -L -o $@ ${PROTOCOL_URL}

ALL_C_SOURCE := $(wildcard c/omni_lock.c c/omni_lock_acp.h c/omni_lock_time_lock.h \
tests/omni_lock/omni_lock_sim.c tests/omni_lock/ckb_syscall_omni_lock_sim.h tests/omni_lock/omni_lock_supply.h\
c/rce_validator.c /always_success.c c/rce.h c/xudt_rce.c \
ALL_C_SOURCE := $(wildcard c/rce_validator.c /always_success.c c/rce.h c/xudt_rce.c \
c/rce_validator.c tests/xudt_rce/*.c tests/xudt_rce/*.h\
c/validate_signature_rsa.h c/validate_signature_rsa.c)

Expand All @@ -129,7 +125,6 @@ mol:
make c/xudt_rce_mol.h
make c/xudt_rce_mol2.h
make tests/xudt_rce_rust/src/xudt_rce_mol.rs
make omni_lock_mol

tests/xudt_rce_rust/src/xudt_rce_mol.rs: c/xudt_rce.mol
${MOLC} --language rust --schema-file $< | rustfmt > $@
Expand All @@ -141,11 +136,6 @@ c/xudt_rce_mol2.h: c/xudt_rce.mol
moleculec --language - --schema-file c/xudt_rce.mol --format json > build/blockchain_mol2.json
moleculec-c2 --input build/blockchain_mol2.json | clang-format -style=Google > c/xudt_rce_mol2.h

omni_lock_mol:
${MOLC} --language rust --schema-file c/omni_lock.mol | rustfmt > tests/omni_lock_rust/src/omni_lock.rs
${MOLC} --language c --schema-file c/omni_lock.mol > c/omni_lock_mol.h
${MOLC} --language - --schema-file c/omni_lock.mol --format json > build/omni_lock_mol2.json
moleculec-c2 --input build/omni_lock_mol2.json | clang-format -style=Google > c/omni_lock_mol2.h

build/xudt_rce: c/xudt_rce.c c/rce.h
$(CC) $(XUDT_RCE_CFLAGS) $(LDFLAGS) -o $@ $<
Expand All @@ -157,10 +147,6 @@ build/rce_validator: c/rce_validator.c c/rce.h
$(OBJCOPY) --only-keep-debug $@ $@.debug
$(OBJCOPY) --strip-debug --strip-all $@

build/omni_lock: c/omni_lock.c c/omni_lock_supply.h c/omni_lock_acp.h c/rce.h c/secp256k1_lock.h build/secp256k1_data_info_20210801.h $(SECP256K1_SRC_20210801) c/ckb_identity.h
$(CC) $(OMNI_LOCK_CFLAGS) $(LDFLAGS) -o $@ $<
cp $@ $@.debug
$(OBJCOPY) --strip-debug --strip-all $@

publish:
git diff --exit-code Cargo.toml
Expand Down Expand Up @@ -190,7 +176,6 @@ clean:
rm -rf build/*.debug
rm -f build/xudt_rce
rm -f build/rce_validator
rm -f build/omni_lock
cd deps/secp256k1 && [ -f "Makefile" ] && make clean
cd deps/secp256k1-20210801 && [ -f "Makefile" ] && make clean
make -C deps/mbedtls/library clean
Expand Down
16 changes: 16 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,19 @@
# ckb production scripts

CKB scripts used in production.

### Build

```
git submodule update --init --recursive
make all-via-docker
```

### RFC and Deployment

* [sUDT](https://github.com/nervosnetwork/rfcs/blob/master/rfcs/0025-simple-udt/0025-simple-udt.md)
* [Anyone Can Pay](https://github.com/nervosnetwork/rfcs/blob/master/rfcs/0026-anyone-can-pay/0026-anyone-can-pay.md)
* [xUDT](https://github.com/nervosnetwork/rfcs/pull/428)

### Omnilock
It is moved to a [new repo](https://github.com/cryptape/omnilock).
4 changes: 0 additions & 4 deletions build.rs
Original file line number Diff line number Diff line change
Expand Up @@ -37,10 +37,6 @@ const BINARIES: &[(&str, &str)] = &[
"rce_validator",
"d9476d96e0f5d41eca88bbc5e8c819ac38592a33285a4828a58d17873f278b3c",
),
(
"omni_lock",
"86ea7ee58a0ecacfb1f7f2675a06d96223e0597dfe06a2474f9c06a72a7ccabc",
),
];

fn main() {
Expand Down
Loading

0 comments on commit c643c18

Please sign in to comment.