From 007023fa31db8726dcaab2f0b9f8a3d8070b4bf9 Mon Sep 17 00:00:00 2001 From: ian Date: Thu, 14 Apr 2022 16:06:29 +0800 Subject: [PATCH 1/5] add lychee to check external links Refs #327 --- .github/workflows/lychee.yml | 28 ++++++++++++++++++++++++++++ .lycheeignore | 4 ++++ 2 files changed, 32 insertions(+) create mode 100644 .github/workflows/lychee.yml create mode 100644 .lycheeignore diff --git a/.github/workflows/lychee.yml b/.github/workflows/lychee.yml new file mode 100644 index 000000000..187de53ca --- /dev/null +++ b/.github/workflows/lychee.yml @@ -0,0 +1,28 @@ +name: lychee + +on: + push: + branches: + - master + schedule: + - cron: '0 0 1 * *' + +jobs: + links: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v3 + + - name: Link Checker + uses: lycheeverse/lychee-action@master + env: + GITHUB_TOKEN: ${{secrets.GITHUB_TOKEN}} + with: + args: '--verbose --max-retries 4 --no-progress "**/*.md"' + + - name: Create Issue From File + uses: peter-evans/create-issue-from-file@v2 + with: + title: Link Checker Report + content-filepath: ./lychee/out.md + labels: automated issue diff --git a/.lycheeignore b/.lycheeignore new file mode 100644 index 000000000..6a14aefb7 --- /dev/null +++ b/.lycheeignore @@ -0,0 +1,4 @@ +https://talk.nervos.org/ +https://discord.gg/8cWtA9uJR5 +/@[^/]+ +wancencen@cryptape.com From 0e6335021e8437fd1d0471fcbddb3d8471e894b1 Mon Sep 17 00:00:00 2001 From: ian Date: Thu, 14 Apr 2022 17:27:40 +0800 Subject: [PATCH 2/5] fix link to RISC-V spec --- rfcs/0005-priviledged-mode/0005-priviledged-mode.md | 2 +- rfcs/0005-priviledged-mode/0005-priviledged-mode.zh.md | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/rfcs/0005-priviledged-mode/0005-priviledged-mode.md b/rfcs/0005-priviledged-mode/0005-priviledged-mode.md index 9d3ce07ab..cb0cf92bd 100644 --- a/rfcs/0005-priviledged-mode/0005-priviledged-mode.md +++ b/rfcs/0005-priviledged-mode/0005-priviledged-mode.md @@ -24,7 +24,7 @@ Notice privileged architecture here is an opt-in feature that is closed by defau ## Privileged mode support via CSR instructions -To ensure maximum compatibility, we will use the exact instructions and workflows defined in the [RISC-V spec](https://riscv.org/specifications/privileged-isa/) to implement privilege mode support here: +To ensure maximum compatibility, we will use the exact instructions and workflows defined in the [RISC-V spec](https://riscv.org/technical/specifications/privileged-isa/) to implement privilege mode support here: * First, CSR instructions as defined in RISC-V will be implemented in CKB VM to implement read/write on control and status registers(CSR). * For simplicity reasons, we might not implement every control and status register as defined in RISC-V spec. For now, we are planning to implement `Supervisor Trap Vector Base Address Register(stvec)` and any other register that might be used in the trap phase. As documented in the spec, reading/writing other registers will result in illegal instruction exception, it's up to contract writer how they want to handle this. diff --git a/rfcs/0005-priviledged-mode/0005-priviledged-mode.zh.md b/rfcs/0005-priviledged-mode/0005-priviledged-mode.zh.md index 32cf4da73..2aa2d12bb 100644 --- a/rfcs/0005-priviledged-mode/0005-priviledged-mode.zh.md +++ b/rfcs/0005-priviledged-mode/0005-priviledged-mode.zh.md @@ -24,7 +24,7 @@ Created: 2018-11-26 ## 基于 CSR 指令的特权模式支持 -为尽最大可能确保兼容性,我们会用 [RISC-V 标准](https://riscv.org/specifications/privileged-isa/) 中定义的指令以及流程来实现特权指令支持: +为尽最大可能确保兼容性,我们会用 [RISC-V 标准](https://riscv.org/technical/specifications/privileged-isa/) 中定义的指令以及流程来实现特权指令支持: * 首先,我们会实现 RISC-V 标准中定义的 CSR 指令,用于读写控制与状态寄存器 (CSR)。 * 出于简化实现的考虑,我们不会实现 RISC-V 中定义的每一个控制与状态寄存器。目前为止,我们只计划实现 `Supervisor Trap Vector Base Address Register(stvec)` 以及其他在 trap 阶段会被用到的寄存器。在 CKB VM 中读写其他寄存器会参照 spec 中的定义,抛出违法指令的异常,合约开发者可以自行决定如何处理异常。 From 7fe44b167599d13dcb17d141ac67bdd1401fd379 Mon Sep 17 00:00:00 2001 From: ian Date: Thu, 14 Apr 2022 17:30:25 +0800 Subject: [PATCH 3/5] remove outdated CHANGELOG --- CHANGELOG.md | 57 ---------------------------------------------------- 1 file changed, 57 deletions(-) delete mode 100644 CHANGELOG.md diff --git a/CHANGELOG.md b/CHANGELOG.md deleted file mode 100644 index 5c486a8c3..000000000 --- a/CHANGELOG.md +++ /dev/null @@ -1,57 +0,0 @@ -## v2019.02.12 - - -### Bug Fixes - -* **0002:** typo ([#69](https://github.com/nervosnetwork/rfcs/issues/69)) ([db4661c](https://github.com/nervosnetwork/rfcs/commit/db4661c)) -* **0003:** Remove atomic operation support in CKB VM ([#68](https://github.com/nervosnetwork/rfcs/issues/68)) ([af51e3a](https://github.com/nervosnetwork/rfcs/commit/af51e3a)) -* **0014:** url in readme ([#61](https://github.com/nervosnetwork/rfcs/issues/61)) ([558f2ba](https://github.com/nervosnetwork/rfcs/commit/558f2ba)) - - - -## v2018.01.28 - -### Updates - -* [RFC0002]: This is a major update to CKB whitepaper, one year after its publication. Jan added the latest results come from discussions and developments and removed obsolete contents. ([#64](https://github.com/nervosnetwork/rfcs/pull/64)) -* [RFC0003]: Previously, we keep atomic support in CKB VM hoping for maximum compatibility, but since now rv64imc without atomic support is starting to get popular, we don't need to keep atomic instruction support in our design. ([#68](https://github.com/nervosnetwork/rfcs/issues/68)) - -## v2018.01.14 - -### New RFC - -* [RFC0013]: block template RFC describes the decentralized CKB mining protocol. -* [RFC0014]: cycle limit RFC describes cycle limits used to regulate VM scripts. CKB VM is a flexible VM that is free to implement many control flow constructs, such as loops or branches. As a result, we will need to enforce certain rules in CKB VM to prevent malicious scripts, such as a script with infinite loops. - -### Updates - -* [RFC0003]: update CKB VM examples based on latest development ([#63](https://github.com/nervosnetwork/rfcs/issues/63)) -* [RFC0006]: use more reasonable proof structure ([#62](https://github.com/nervosnetwork/rfcs/issues/62)) - - -## v2018.12.28 - -The RFC (Request for Comments) process is intended to provide an open and community driven path for new protocols, improvements and best practices. One month later after open source, we have 11 RFCs in draft or proposal status. We haven't finalized them yet, discussions and comments are welcome. - - -* [RFC0002] provides an overview of the Nervos Common Knowledge Base (CKB), the core component of the Nervos Network, a decentralized application platform with a layered architecture. The CKB is the layer 1 of Nervos, and serves as a general purpose common knowledge base that provides data, asset, and identity services. -* [RFC0003] introduces the VM for scripting on CKB the layer 1 chain. VM layer in CKB is used to perform a series of validation rules to determine if transaction is valid given transaction's inputs and outputs. CKB uses [RISC-V](https://riscv.org/) ISA to implement VM layer. CKB relies on dynamic linking and syscalls to provide additional capabilities required by the blockchain, such as reading external cells or other crypto computations. Any compilers with RV64I support, such as [riscv-gcc](https://github.com/riscv/riscv-gcc), [riscv-llvm](https://github.com/lowRISC/riscv-llvm) or [Rust](https://github.com/rust-embedded/wg/issues/218) can be used to generate CKB compatible scripts. -* [RFC0004] is the protocol how CKB nodes synchronize blocks via the P2P network. Block synchronization **must** be performed in stages with Bitcoin Headers First style. Block is downloaded in parts in each stage and is validated using the obtained parts. -* [RFC0006] proposes Complete Binary Merkle Tree(CBMT) to generate *Merkle Root* and *Merkle Proof* for a static list of items in CKB. Currently, CBMT is used to calculate *Transactions Root*. Basically, CBMT is a ***complete binary tree***, in which every level, except possibly the last, is completely filled, and all nodes are as far left as possible. And it is also a ***full binary tree***, in which every node other than the leaves has two children. Compare with other Merkle trees, the hash computation of CBMT is minimal, as well as the proof size. -* [RFC0007] describes the scoring system of CKB P2P Networking layer and several networking security strategies based on it. -* [RFC0009] describes syscalls specification, and all the RISC-V VM syscalls implemented in CKB so far. -* [RFC0010] defines the consensus rule “cellbase maturity period”. For each input, if the referenced output transaction is cellbase, it must have at least `CELLBASE_MATURITY` confirmations; else reject this transaction. -* [RFC0011], transaction filter protocol, allows peers to reduce the amount of transaction data they send. Peer which wants to retrieve transactions of interest, has the option of setting filters on each connection. A filter is defined as a [Bloom filter](http://en.wikipedia.org/wiki/Bloom_filter) on data derived from transactions. -* [RFC0012] proposes a P2P node discovery protocol. CKB Node Discovery Protocol mainly refers to [Satoshi Client Node Discovery](https://en.bitcoin.it/wiki/Satoshi_Client_Node_Discovery), with some modifications to meet our requirements. - -[RFC0002]: https://github.com/nervosnetwork/rfcs/blob/master/rfcs/0002-ckb/0002-ckb.md -[RFC0003]: https://github.com/nervosnetwork/rfcs/blob/master/rfcs/0003-ckb-vm/0003-ckb-vm.md -[RFC0004]: https://github.com/nervosnetwork/rfcs/blob/master/rfcs/0004-ckb-block-sync/0004-ckb-block-sync.md -[RFC0006]: https://github.com/nervosnetwork/rfcs/blob/master/rfcs/0006-merkle-tree/0006-merkle-tree.md -[RFC0007]: https://github.com/nervosnetwork/rfcs/blob/master/rfcs/0007-scoring-system-and-network-security/0007-scoring-system-and-network-security.md -[RFC0009]: https://github.com/nervosnetwork/rfcs/blob/master/rfcs/0009-vm-syscalls/0009-vm-syscalls.md -[RFC0010]: https://github.com/nervosnetwork/rfcs/blob/master/rfcs/0010-cellbase-maturity-period/0010-cellbase-maturity-period.md -[RFC0011]: https://github.com/nervosnetwork/rfcs/blob/master/rfcs/0011-transaction-filter-protocol/0011-transaction-filter-protocol.md -[RFC0012]: https://github.com/nervosnetwork/rfcs/blob/master/rfcs/0012-node-discovery/0012-node-discovery.md -[RFC0013]: https://github.com/nervosnetwork/rfcs/blob/master/rfcs/0013-get-block-template/0013-get-block-template.md -[RFC0014]: https://github.com/nervosnetwork/rfcs/blob/master/rfcs/0014-vm-cycle-limits/0014-vm-cycle-limits.md From 980e8b86edca549defb46b2bb639973b7d10c2d1 Mon Sep 17 00:00:00 2001 From: ian Date: Thu, 14 Apr 2022 17:33:41 +0800 Subject: [PATCH 4/5] fix link to github riscv-rust/rust --- rfcs/0003-ckb-vm/0003-ckb-vm.md | 2 +- rfcs/0003-ckb-vm/0003-ckb-vm.zh.md | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/rfcs/0003-ckb-vm/0003-ckb-vm.md b/rfcs/0003-ckb-vm/0003-ckb-vm.md index 4c294c7fd..dd22fa53d 100644 --- a/rfcs/0003-ckb-vm/0003-ckb-vm.md +++ b/rfcs/0003-ckb-vm/0003-ckb-vm.md @@ -97,7 +97,7 @@ CKB only defines the low level virtual machine. In theory, any languages with RI * CKB can leverage standard riscv-gcc, riscv-llvm or even upstream gcc/llvm for C/C++ contract development. Executables emitted by those compilers can be directly used as CKB contracts. * C-based Bitcoin or Ethereum VM can also be compiled into RISC-V binaries as common cells, contracts can then load those common cells to run Bitcoin or Ethereum compatible contracts. * Higher-level language VMs, such as [duktape](http://duktape.org/) or [mruby](https://github.com/mruby/mruby) can also be compiled and loaded to run contracts running by JavaScript or Ruby -* [Rust](https://github.com/riscv-rust/rust) can also be used to write contracts with recent development in this space +* [Rust](https://github.com/riscv-rust/riscv-rust-quickstart) can also be used to write contracts with recent development in this space ## Runtime Cost diff --git a/rfcs/0003-ckb-vm/0003-ckb-vm.zh.md b/rfcs/0003-ckb-vm/0003-ckb-vm.zh.md index dd794d49c..e7a0f5ba7 100644 --- a/rfcs/0003-ckb-vm/0003-ckb-vm.zh.md +++ b/rfcs/0003-ckb-vm/0003-ckb-vm.zh.md @@ -70,7 +70,7 @@ CKB 核心只定义了底层的虚拟机模型,理论上任何提供了 RISC-V * CKB 可以直接使用标准的 riscv-gcc 以及 riscv-llvm 以 C/C++ 语言来进行开发。编译后的可执行文件可以直接作为 CKB 的合约来使用 * 与此相应的,可以将 C 实现的 Bitcoin 以及 Ethereum VM 编译成 RISC-V 二进制代码,保存在公共 Cell 中,然后在合约中引用公共 Cell 来运行 Bitcoin 或者 Ethereum 的合约 * 其他的高级语言 VM 如 [duktape](http://duktape.org/) 及 [mruby](https://github.com/mruby/mruby) 在编译后,也可以用来相应的运行 JavaScript 或者 Ruby 编写的合约 -* 相应的也可以使用 [Rust](https://github.com/riscv-rust/rust) 作为实现语言来编写合约 +* 相应的也可以使用 [Rust](https://github.com/riscv-rust/riscv-rust-quickstart) 作为实现语言来编写合约 ## Runtime Cost From 075a67e09cc94ff9ee32c7cdd44aec43bac33256 Mon Sep 17 00:00:00 2001 From: ian Date: Mon, 6 Feb 2023 10:30:23 +0800 Subject: [PATCH 5/5] chore: remove local link checker --- .github/workflows/local-link-checker.yaml | 21 --------------------- 1 file changed, 21 deletions(-) delete mode 100644 .github/workflows/local-link-checker.yaml diff --git a/.github/workflows/local-link-checker.yaml b/.github/workflows/local-link-checker.yaml deleted file mode 100644 index aa68e4535..000000000 --- a/.github/workflows/local-link-checker.yaml +++ /dev/null @@ -1,21 +0,0 @@ -name: Local Link Checker - -on: - push: - branches: - - "*" - pull_request: - -jobs: - local-link-checker: - runs-on: ubuntu-latest - - steps: - - uses: actions/checkout@v3 - - - name: run checker - run: .github/scripts/local-link-checker.sh - - - name: info for fixing - if: ${{ failure() }} - run: echo "::error::Broken local links found, please use ./.github/scripts/local-link-checker.sh to check locally"