Skip to content

refactor: change metadata system contract and add annotation#1449

Merged
KaoImin merged 12 commits intomainfrom
style
Oct 9, 2023
Merged

refactor: change metadata system contract and add annotation#1449
KaoImin merged 12 commits intomainfrom
style

Conversation

@KaoImin
Copy link
Copy Markdown
Contributor

@KaoImin KaoImin commented Sep 26, 2023

What this PR does / why we need it?

  1. Change the built-in solidity contracts into interface definition. Because they only define the interface of system contracts which is implemented in Rust.
  2. Use the same address in system contact init avoiding the follow situation:
    let current_cell_root =
    adapter.storage(CKB_LIGHT_CLIENT_CONTRACT_ADDRESS, *HEADER_CELL_ROOT_KEY);

    let changes = generate_mpt_root_changes(adapter, IMAGE_CELL_CONTRACT_ADDRESS);
  3. Remove the metadata precompile contract

What is the impact of this PR?

No Breaking Change

PR relation:

CI Settings

CI Usage

Tip: Check the CI you want to run below, and then comment /run-ci.

CI Switch

  • Web3 Compatible Tests
  • OCT 1-5 And 12-15
  • OCT 6-10
  • OCT 11
  • OCT 16-19
  • v3 Core Tests

CI Description

CI Name Description
Web3 Compatible Test Test the Web3 compatibility of Axon
v3 Core Test Run the compatibility tests provided by Uniswap V3
OCT 1-5 | 6-10 | 11 | 12-15 | 16-19 Run the compatibility tests provided by OpenZeppelin

@KaoImin KaoImin requested a review from a team as a code owner September 26, 2023 04:01
@github-actions github-actions Bot added the style label Sep 26, 2023
@KaoImin KaoImin requested review from Flouse and driftluo and removed request for Simon-Tl and ashuralyk September 26, 2023 04:01
@KaoImin
Copy link
Copy Markdown
Contributor Author

KaoImin commented Sep 26, 2023

/run-ci

@github-actions
Copy link
Copy Markdown

CI tests run on commit:

CI test list:

  • Web3 Compatible Tests

Please check ci test results later.

Comment thread builtin-contract/metadata/contracts/metadata.sol Outdated
@KaoImin KaoImin requested a review from Flouse September 26, 2023 08:13
Copy link
Copy Markdown
Contributor

@chaoticlonghair chaoticlonghair left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why don't just write an interface?

I don't think a broken1 contract is better than an interface.

Users can use the interface. (ref: #1457)

Footnotes

  1. Not able to compile.

@KaoImin KaoImin changed the title style: change some code style and annotation [WIP]style: change some code style and annotation Oct 8, 2023
@Flouse Flouse requested a review from chaoticlonghair October 8, 2023 06:25
@KaoImin KaoImin changed the title [WIP]style: change some code style and annotation refactor: change metadata system contract and add annotation Oct 8, 2023
@Flouse
Copy link
Copy Markdown
Contributor

Flouse commented Oct 8, 2023

/run-ci

@github-actions
Copy link
Copy Markdown

github-actions Bot commented Oct 8, 2023

CI tests run on commit:

CI test list:

  • OCT 1-5 And 12-15
  • OCT 6-10
  • OCT 11
  • OCT 16-19
  • v3 Core Tests
  • Web3 Compatible Tests

Please check ci test results later.

Comment thread core/executor/src/tests/system_script/metadata.rs
Flouse
Flouse previously approved these changes Oct 8, 2023
Comment thread core/executor/src/tests/system_script/metadata.rs
Copy link
Copy Markdown
Contributor

@chaoticlonghair chaoticlonghair left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I have different opinions, but since the deadline is already reached, I don't want to block the project progress.

@KaoImin KaoImin enabled auto-merge October 9, 2023 02:29
@KaoImin KaoImin added this pull request to the merge queue Oct 9, 2023
Merged via the queue into main with commit 2dd3e88 Oct 9, 2023
@KaoImin KaoImin deleted the style branch October 12, 2023 07:43
@Flouse Flouse linked an issue Oct 14, 2023 that may be closed by this pull request
4 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Call the built-in Metadata contract causes an error. System contracts ckb_light_client and image_cell are saved into different MPT trie.

3 participants