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

remove dao type script deployment in genesis block #7

Merged
merged 2 commits into from
Jul 25, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 0 additions & 4 deletions resource/specs/dev.toml
Original file line number Diff line number Diff line change
Expand Up @@ -25,10 +25,6 @@ file = { bundled = "specs/cells/secp256k1_blake160_sighash_all" }
create_type_id = true
capacity = 100_000_0000_0000
[[genesis.system_cells]]
file = { bundled = "specs/cells/dao" }
create_type_id = true
capacity = 16_000_0000_0000
[[genesis.system_cells]]
file = { bundled = "specs/cells/secp256k1_data" }
create_type_id = false
capacity = 1_048_617_0000_0000
Expand Down
4 changes: 2 additions & 2 deletions resource/src/template.rs
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
/// Default chain spec.
pub const DEFAULT_SPEC: &str = "mainnet";
pub const DEFAULT_SPEC: &str = "dev";
/// The list of bundled chain specs.
pub const AVAILABLE_SPECS: &[&str] = &["mainnet", "testnet", "staging", "dev"];
pub const AVAILABLE_SPECS: &[&str] = &["dev"];
/// The default RPC listen port *8114*.
pub const DEFAULT_RPC_PORT: &str = "8114";
/// The default P2P listen port *8115*.
Expand Down
5 changes: 2 additions & 3 deletions spec/src/consensus.rs
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,7 @@ use crate::{
self, Deployment, DeploymentPos, ThresholdState, Versionbits, VersionbitsCache,
VersionbitsConditionChecker, VersionbitsIndexer,
},
OUTPUT_INDEX_DAO, OUTPUT_INDEX_SECP256K1_BLAKE160_MULTISIG_ALL,
OUTPUT_INDEX_SECP256K1_BLAKE160_SIGHASH_ALL,
OUTPUT_INDEX_SECP256K1_BLAKE160_MULTISIG_ALL, OUTPUT_INDEX_SECP256K1_BLAKE160_SIGHASH_ALL,
};
use ckb_constant::{
consensus::TAU,
Expand Down Expand Up @@ -345,7 +344,7 @@ impl ConsensusBuilder {
"genesis block must contain the witness for cellbase"
);

self.inner.dao_type_hash = self.get_type_hash(OUTPUT_INDEX_DAO).unwrap_or_default();
self.inner.dao_type_hash = Byte32::default();
self.inner.secp256k1_blake160_sighash_all_type_hash =
self.get_type_hash(OUTPUT_INDEX_SECP256K1_BLAKE160_SIGHASH_ALL);
self.inner.secp256k1_blake160_multisig_all_type_hash =
Expand Down
11 changes: 4 additions & 7 deletions spec/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -22,8 +22,8 @@ use ckb_hash::{blake2b_256, new_blake2b};
use ckb_jsonrpc_types::Script;
use ckb_pow::{Pow, PowEngine};
use ckb_resource::{
Resource, CODE_HASH_DAO, CODE_HASH_SECP256K1_BLAKE160_MULTISIG_ALL,
CODE_HASH_SECP256K1_BLAKE160_SIGHASH_ALL, CODE_HASH_SECP256K1_DATA,
Resource, CODE_HASH_SECP256K1_BLAKE160_MULTISIG_ALL, CODE_HASH_SECP256K1_BLAKE160_SIGHASH_ALL,
CODE_HASH_SECP256K1_DATA,
};
use ckb_types::{
bytes::Bytes,
Expand Down Expand Up @@ -59,12 +59,10 @@ const SPECIAL_CELL_PRIVKEY: H256 =

/// The output index of SECP256K1/blake160 script in the genesis no.0 transaction
pub const OUTPUT_INDEX_SECP256K1_BLAKE160_SIGHASH_ALL: u64 = 1;
/// The output index of DAO script in the genesis no.0 transaction
pub const OUTPUT_INDEX_DAO: u64 = 2;
/// The output data index of SECP256K1 in the genesis no.0 transaction
pub const OUTPUT_INDEX_SECP256K1_DATA: u64 = 3;
pub const OUTPUT_INDEX_SECP256K1_DATA: u64 = 2;
/// The output index of SECP256K1/multisig script in the genesis no.0 transaction
pub const OUTPUT_INDEX_SECP256K1_BLAKE160_MULTISIG_ALL: u64 = 4;
pub const OUTPUT_INDEX_SECP256K1_BLAKE160_MULTISIG_ALL: u64 = 3;

/// The CKB block chain specification
#[derive(Clone, PartialEq, Eq, Debug, Serialize, Deserialize)]
Expand Down Expand Up @@ -737,7 +735,6 @@ impl ChainSpec {
OUTPUT_INDEX_SECP256K1_BLAKE160_SIGHASH_ALL as usize,
&CODE_HASH_SECP256K1_BLAKE160_SIGHASH_ALL,
)?;
check_cells_data_hash(0, OUTPUT_INDEX_DAO as usize, &CODE_HASH_DAO)?;
check_cells_data_hash(
0,
OUTPUT_INDEX_SECP256K1_DATA as usize,
Expand Down
5 changes: 0 additions & 5 deletions test/src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -417,10 +417,6 @@ fn all_specs() -> Vec<Box<dyn Spec>> {
Box::new(ForksContainSameUncle),
Box::new(SendConflictTxToRelay),
Box::new(SendConflictTxToRelayRBF),
Box::new(WithdrawDAO),
Box::new(WithdrawDAOWithOverflowCapacity),
Box::new(DAOWithSatoshiCellOccupied),
Box::new(SpendSatoshiCell::new()),
Box::new(MiningBasic),
Box::new(BlockTemplates),
Box::new(BootstrapCellbase),
Expand Down Expand Up @@ -554,7 +550,6 @@ fn all_specs() -> Vec<Box<dyn Spec>> {
Box::new(ConflictInProposed),
Box::new(RemoveConflictFromPending),
Box::new(SubmitConflict),
Box::new(DAOVerify),
Box::new(AvoidDuplicatedProposalsWithUncles),
Box::new(BlockSyncRelayerCollaboration),
Box::new(RpcGetBlockTemplate),
Expand Down
82 changes: 0 additions & 82 deletions test/src/specs/dao/dao_tx.rs

This file was deleted.

Loading
Loading