Skip to content
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!: insert metadata directly and remove genesis transactions #1454

Merged
merged 4 commits into from
Oct 9, 2023

Conversation

KaoImin
Copy link
Contributor

@KaoImin KaoImin commented Sep 27, 2023

What this PR does / why we need it?

This PR removes the generation of genesis transactions. The first two metadata and the consensus config are inserted to DB directly.

What is the impact of this PR?

No Breaking Change

PR relation:

  • Ref #
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 27, 2023 07:28
@KaoImin KaoImin requested review from Flouse and yangby-cryptape and removed request for ashuralyk September 27, 2023 07:28
@KaoImin

This comment was marked as off-topic.

@github-actions

This comment was marked as outdated.

Copy link
Contributor

@Flouse Flouse left a comment

Choose a reason for hiding this comment

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

Now the following code is useless, right?

axon/core/run/src/tests.rs

Lines 130 to 147 in f000c0f

for (i, (block_cached, tx)) in genesis
.block
.tx_hashes
.iter()
.zip(genesis.txs.iter())
.enumerate()
{
let tx_cached = tx.transaction.hash;
assert_eq!(
*block_cached, tx_cached,
"check hash of tx[{i}], in-block: {block_cached:#x}, tx-cached: {tx_cached:#x}",
);
let calculated = tx.transaction.clone().calc_hash().hash;
assert_eq!(
tx_cached, calculated,
"check hash of tx[{i}], cached: {tx_cached:#x}, calculated: {calculated:#x}",
);
}

core/run/src/lib.rs Outdated Show resolved Hide resolved
core/run/src/tests.rs Outdated Show resolved Hide resolved
@KaoImin KaoImin force-pushed the remove-genesis-transaction branch from f000c0f to 1df6ee1 Compare October 7, 2023 01:56
@KaoImin
Copy link
Contributor Author

KaoImin commented Oct 7, 2023

Now the following code is useless, right?

axon/core/run/src/tests.rs

Lines 130 to 147 in f000c0f

for (i, (block_cached, tx)) in genesis
.block
.tx_hashes
.iter()
.zip(genesis.txs.iter())
.enumerate()
{
let tx_cached = tx.transaction.hash;
assert_eq!(
*block_cached, tx_cached,
"check hash of tx[{i}], in-block: {block_cached:#x}, tx-cached: {tx_cached:#x}",
);
let calculated = tx.transaction.clone().calc_hash().hash;
assert_eq!(
tx_cached, calculated,
"check hash of tx[{i}], cached: {tx_cached:#x}, calculated: {calculated:#x}",
);
}

Yes

@KaoImin KaoImin force-pushed the remove-genesis-transaction branch from 94f68f6 to dacb972 Compare October 8, 2023 13:14
@KaoImin

This comment was marked as outdated.

@github-actions

This comment was marked as outdated.

@KaoImin KaoImin force-pushed the remove-genesis-transaction branch from dacb972 to 7d73ca2 Compare October 9, 2023 04:14
@Flouse
Copy link
Contributor

Flouse commented Oct 9, 2023

/run-ci

@github-actions
Copy link

github-actions bot commented Oct 9, 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.

@KaoImin KaoImin enabled auto-merge October 9, 2023 07:35
@KaoImin KaoImin added this pull request to the merge queue Oct 9, 2023
Merged via the queue into main with commit 5b2310c Oct 9, 2023
22 of 23 checks passed
@KaoImin KaoImin deleted the remove-genesis-transaction branch October 12, 2023 07:43
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants