-
Notifications
You must be signed in to change notification settings - Fork 236
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
refactor: Revise script structure #344
refactor: Revise script structure #344
Conversation
core/src/script.rs
Outdated
// following locations: | ||
// 1. Data part of a dep cell in current transaction, reference hash | ||
// must be the hash of the cell data so as to reference this cell | ||
// 2. An embed item in current transaction, reference hash must be the |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
So the embed item is a one-time data?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yep, it's like the original binary but at a different place with more potential use cases
} | ||
} else if cs.is_dead() { | ||
for cs in &self.resolved_transaction.input_cells { | ||
if cs.is_dead() { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
👍
Add some description for this PR. The linked issue is private. |
@@ -29,6 +29,7 @@ enum CellField { | |||
Capacity = 0, | |||
Data = 1, | |||
DataHash = 2, | |||
Lock = 6, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Move this item under the TypeHash = 5
for consistency.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There are 2 ways to understand consistency here: first, we can sort them by the value of the enums, of course. But there's also another way which we can group the values based on the meeting, so we can do Data, DataHash, Lock, LockHash, this way it's easier to see what options are available here. Thoughts?
With the refactoring work going on here, we can eliminate the concept of type hash, and only keep script hash here.
@doitian Conflict is resolved now |
This test has already been removed in cd85337.
are you considering updating the how-to-write-contract doc as well? |
bors r+ |
344: refactor: Revise script structure r=doitian a=xxuejie * [x] rfc changes: nervosnetwork/rfcs#91 * [x] ckb-system-scripts: nervosnetwork/ckb-system-scripts#2 * [x] mruby-contracts: nervosnetwork/mruby-contracts#7 * [x] ruby sdk: nervosnetwork/ckb-demo-ruby#76 * [x] ruby scripts: nervosnetwork/ckb-ruby-scripts#9 * [ ] swift sdk * [ ] java sdk * [ ] js sdk --- This is a **BREAKING CHANGE**. Co-authored-by: Xuejie Xiao <[email protected]>
Build failed
|
Integration test stuck, cc @quake |
bors try |
bors r+ |
tryBuild succeeded
|
Merge conflict |
bors r+ |
344: refactor: Revise script structure r=xxuejie a=xxuejie * [x] rfc changes: nervosnetwork/rfcs#91 * [x] ckb-system-scripts: nervosnetwork/ckb-system-scripts#2 * [x] mruby-contracts: nervosnetwork/mruby-contracts#7 * [x] ruby sdk: nervosnetwork/ckb-demo-ruby#76 * [x] ruby scripts: nervosnetwork/ckb-ruby-scripts#9 * [ ] swift sdk * [ ] java sdk * [ ] js sdk --- This is a **BREAKING CHANGE**. Co-authored-by: Xuejie Xiao <[email protected]>
Build succeeded
|
🎉[ᚬmaster] Rc/v0.9.0 ### Bug Fixes * #410: network panic errors r=jjyr a=jjyr * Peer Store no such table * get peer index panic * #386: flatbuffers vtable `num_fields` overflow r=zhangsoledad a=doitian Refs nervosnetwork/cfb#16 * #385: Upgrade p2p fix repeat connection bug r=jjyr a=TheWaWaR Related PR: nervosnetwork/tentacle#92 * #382: reset peer store connection status when setup r=TheWaWaR a=jjyr 1. reset peer status 2. remove banned addrs from peer_attemps result * #424: many bug fixes of the p2p network issues fix a=TheWaWaR,zhangsoledad ### Features * #491: update lock cell for segwit and address format a=classicalliu * #368: segregated witness r=janx,quake a=zhangsoledad * #409: remove uncle cellbase r=doitian a=zhangsoledad * #369: Embed testnet chain spec in compiled binary r=doitian a=xxuejie * #344: Revise script structure r=xxuejie a=xxuejie * #425: Bundle app config in compiled binary a=doitian ### Improvements * #392: avoid recursive lock a=zhangsoledad ### BREAKING CHANGES This release has changed core data structure, please delete the old data directory. The testnet chain spec is also changed, which is incompatible with previous versions. Command line argument `-c` is removed, and a new command line argument `-C` is added. See `ckb help` for details. Now the command `ckb` no longer searches the config file `nodes/default.toml`. It looks for the config file `ckb.toml` or `ckb-miner.toml` in current directory and uses the default config options when not found. A new command `ckb init` is added, see its usage with `ckb init --help`. Config file `ckb.toml` changes: - Removed `logger.file`, `db.path` and `network.path` from config file. - Added config option `logger.log_to_stdout` and `logger.log_to_file`. - Section `block_assembler` now accepts two options `binary_hash` and `args`. - Added a new option to set sentry DSN. File `miner.toml` changes: - Option `spec` is moved under `chain`, which is consistent with `ckb.toml`. - Move miner own config options under section `miner`. - Remove `logger.file` from config file. - Add config option `logger.log_to_stdout` and `logger.log_to_file`. It is recommended to export the config files via `ckb init`, then apply the modifications upon the new config files.
1793: chore(deps): bump num_cpus from 1.10.1 to 1.11.0 r=doitian a=dependabot-preview[bot] Bumps [num_cpus](https://github.com/seanmonstar/num_cpus) from 1.10.1 to 1.11.0. <details> <summary>Changelog</summary> *Sourced from [num_cpus's changelog](https://github.com/seanmonstar/num_cpus/blob/master/CHANGELOG.md).* > ## v1.11.0 > > #### Features > > - add `hermit` target OS support > - removes `bitrig` support > > #### Fixes > > - fix `get_physical` count with AMD hyperthreading. </details> <details> <summary>Commits</summary> - [`1904840`](seanmonstar/num_cpus@1904840) v1.11.0 - [`a8973cb`](seanmonstar/num_cpus@a8973cb) add support of the unikernel RustyHermit ([#88](https://github-redirect.dependabot.com/seanmonstar/num_cpus/issues/88)) - [`c3d2021`](seanmonstar/num_cpus@c3d2021) Refactor get_physical to sum 'cpu cores' per 'physical id' ([#86](https://github-redirect.dependabot.com/seanmonstar/num_cpus/issues/86)) - [`85d20df`](seanmonstar/num_cpus@85d20df) Avoid allocating a vector and double trimming in get_num_physical_cpus ([#87](https://github-redirect.dependabot.com/seanmonstar/num_cpus/issues/87)) - [`434d29c`](seanmonstar/num_cpus@434d29c) Use ptr::null_mut instead of 0 as *mut ([#84](https://github-redirect.dependabot.com/seanmonstar/num_cpus/issues/84)) - [`3a8994b`](seanmonstar/num_cpus@3a8994b) Remove bitrig support ([#78](https://github-redirect.dependabot.com/seanmonstar/num_cpus/issues/78)) - See full diff in [compare view](seanmonstar/num_cpus@v1.10.1...v1.11.0) </details> <br /> [](https://dependabot.com/compatibility-score.html?dependency-name=num_cpus&package-manager=cargo&previous-version=1.10.1&new-version=1.11.0) Dependabot will resolve any conflicts with this PR as long as you don't alter it yourself. You can also trigger a rebase manually by commenting `@dependabot rebase`. [//]: # (dependabot-automerge-start) [//]: # (dependabot-automerge-end) --- <details> <summary>Dependabot commands and options</summary> <br /> You can trigger Dependabot actions by commenting on this PR: - `@dependabot rebase` will rebase this PR - `@dependabot recreate` will recreate this PR, overwriting any edits that have been made to it - `@dependabot merge` will merge this PR after your CI passes on it - `@dependabot squash and merge` will squash and merge this PR after your CI passes on it - `@dependabot cancel merge` will cancel a previously requested merge and block automerging - `@dependabot reopen` will reopen this PR if it is closed - `@dependabot close` will close this PR and stop Dependabot recreating it. You can achieve the same result by closing it manually - `@dependabot ignore this major version` will close this PR and stop Dependabot creating any more for this major version (unless you reopen the PR or upgrade to it yourself) - `@dependabot ignore this minor version` will close this PR and stop Dependabot creating any more for this minor version (unless you reopen the PR or upgrade to it yourself) - `@dependabot ignore this dependency` will close this PR and stop Dependabot creating any more for this dependency (unless you reopen the PR or upgrade to it yourself) - `@dependabot use these labels` will set the current labels as the default for future PRs for this repo and language - `@dependabot use these reviewers` will set the current reviewers as the default for future PRs for this repo and language - `@dependabot use these assignees` will set the current assignees as the default for future PRs for this repo and language - `@dependabot use this milestone` will set the current milestone as the default for future PRs for this repo and language - `@dependabot badge me` will comment on this PR with code to add a "Dependabot enabled" badge to your readme Additionally, you can set the following in your Dependabot [dashboard](https://app.dependabot.com): - Update frequency (including time of day and day of week) - Pull request limits (per update run and/or open at any time) - Automerge options (never/patch/minor, and dev/runtime dependencies) - Out-of-range updates (receive only lockfile updates, if desired) - Security updates (receive only security updates, if desired) </details> 1794: chore(deps): bump toml from 0.5.2 to 0.5.5 r=doitian a=dependabot-preview[bot] Bumps [toml](https://github.com/alexcrichton/toml-rs) from 0.5.2 to 0.5.5. <details> <summary>Commits</summary> - [`7512904`](toml-rs/toml-rs@7512904) Bump to 0.5.5 - [`1e6bfbc`](toml-rs/toml-rs@1e6bfbc) replace copied wit filter_map for rustc 1.35 compatibility ([#354](https://github-redirect.dependabot.com/alexcrichton/toml-rs/issues/354)) - [`4673cfd`](toml-rs/toml-rs@4673cfd) Replace the test added by [#349](https://github-redirect.dependabot.com/alexcrichton/toml-rs/issues/349) with a bench ([#351](https://github-redirect.dependabot.com/alexcrichton/toml-rs/issues/351)) - [`4b05a9d`](toml-rs/toml-rs@4b05a9d) update ([#352](https://github-redirect.dependabot.com/alexcrichton/toml-rs/issues/352)) - [`189d2b9`](toml-rs/toml-rs@189d2b9) Bump to 0.5.4 - [`c049b7a`](toml-rs/toml-rs@c049b7a) Decrease deserialization complexity from quadratic to linear ([#349](https://github-redirect.dependabot.com/alexcrichton/toml-rs/issues/349)) - [`ec21d60`](toml-rs/toml-rs@ec21d60) Support for dotted table spans ([#340](https://github-redirect.dependabot.com/alexcrichton/toml-rs/issues/340)) - [`e9f5290`](toml-rs/toml-rs@e9f5290) Switch from linked-hash-map to indexmap - [`8995cef`](toml-rs/toml-rs@8995cef) Spanned: impl PartialEq, Eq, Hash, PartialOrd, Ord in terms of the value ([#344](https://github-redirect.dependabot.com/alexcrichton/toml-rs/issues/344)) - [`9ed2903`](toml-rs/toml-rs@9ed2903) Remove outdated Travis CI badge ([#346](https://github-redirect.dependabot.com/alexcrichton/toml-rs/issues/346)) - Additional commits viewable in [compare view](toml-rs/toml-rs@0.5.2...0.5.5) </details> <br /> [](https://dependabot.com/compatibility-score.html?dependency-name=toml&package-manager=cargo&previous-version=0.5.2&new-version=0.5.5) Dependabot will resolve any conflicts with this PR as long as you don't alter it yourself. You can also trigger a rebase manually by commenting `@dependabot rebase`. [//]: # (dependabot-automerge-start) [//]: # (dependabot-automerge-end) --- <details> <summary>Dependabot commands and options</summary> <br /> You can trigger Dependabot actions by commenting on this PR: - `@dependabot rebase` will rebase this PR - `@dependabot recreate` will recreate this PR, overwriting any edits that have been made to it - `@dependabot merge` will merge this PR after your CI passes on it - `@dependabot squash and merge` will squash and merge this PR after your CI passes on it - `@dependabot cancel merge` will cancel a previously requested merge and block automerging - `@dependabot reopen` will reopen this PR if it is closed - `@dependabot close` will close this PR and stop Dependabot recreating it. You can achieve the same result by closing it manually - `@dependabot ignore this major version` will close this PR and stop Dependabot creating any more for this major version (unless you reopen the PR or upgrade to it yourself) - `@dependabot ignore this minor version` will close this PR and stop Dependabot creating any more for this minor version (unless you reopen the PR or upgrade to it yourself) - `@dependabot ignore this dependency` will close this PR and stop Dependabot creating any more for this dependency (unless you reopen the PR or upgrade to it yourself) - `@dependabot use these labels` will set the current labels as the default for future PRs for this repo and language - `@dependabot use these reviewers` will set the current reviewers as the default for future PRs for this repo and language - `@dependabot use these assignees` will set the current assignees as the default for future PRs for this repo and language - `@dependabot use this milestone` will set the current milestone as the default for future PRs for this repo and language - `@dependabot badge me` will comment on this PR with code to add a "Dependabot enabled" badge to your readme Additionally, you can set the following in your Dependabot [dashboard](https://app.dependabot.com): - Update frequency (including time of day and day of week) - Pull request limits (per update run and/or open at any time) - Automerge options (never/patch/minor, and dev/runtime dependencies) - Out-of-range updates (receive only lockfile updates, if desired) - Security updates (receive only security updates, if desired) </details> Co-authored-by: dependabot-preview[bot] <27856297+dependabot-preview[bot]@users.noreply.github.com>
This is a BREAKING CHANGE.