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

Force deploy #4025

Merged
merged 62 commits into from
Apr 17, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
62 commits
Select commit Hold shift + click to select a range
f77e46e
[force-deploy] add initial codes force deploy command into db exporter
welbon Mar 28, 2024
97f5d0f
add the project of force upgrade
welbon Mar 31, 2024
8ce06a5
[force deploy] Add suiteable binary files of starcoin framework
welbon Apr 1, 2024
6ca6f30
[force-deploy] revert gas schedule
welbon Apr 2, 2024
01c19fa
[force-upgrade] reformat upgrade code
welbon Apr 2, 2024
d7fe44a
[force-deploy] reformat some code for unittest
welbon Apr 3, 2024
73c23cf
[force-deploy] A new txn verify and modification scheme is used, base…
welbon Apr 6, 2024
b4c2c4a
[force-deploy] modify code
welbon Apr 7, 2024
5158faf
[force-deploy] upgrade framework mv file for barnard and proxima
welbon Apr 7, 2024
af2e3f2
fixed for test
welbon Apr 7, 2024
e58d715
for account get from multi chain id
welbon Apr 8, 2024
70b962a
fixed error
welbon Apr 8, 2024
06521d7
[force-upgrade] move the code into openedblock
welbon Apr 9, 2024
99d60c3
[force-deploy] add include_dir and fixed the genesis version of proxi…
welbon Apr 9, 2024
0cc188b
[force-upgrade] change to new process
welbon Apr 10, 2024
27cc5fc
[force-upgrade] change to new process
welbon Apr 10, 2024
2a34ef8
binary file
welbon Apr 10, 2024
3a096a9
[force-upgrade] change to new process
welbon Apr 10, 2024
11927b9
[force-upgrade] add block timestamp
welbon Apr 11, 2024
d7ffd50
[force-upgrade] remove unused code
welbon Apr 11, 2024
a783a45
[force-upgrade] fixed upgrade test error
welbon Apr 11, 2024
5a34cc3
[force-upgrade] fixed the timestamp
welbon Apr 11, 2024
80fa0bc
[force-upgrade] fixed the timestamp
welbon Apr 11, 2024
4203ffc
[force-upgrade] fixed the script for include_dir
welbon Apr 11, 2024
656db9b
[force-upgrade] fixed timestamp
welbon Apr 11, 2024
12dbb19
[force-upgrade] reverted gas scheduler
welbon Apr 11, 2024
1c8ac22
[force-upgrade] reverted gas scheduler
welbon Apr 11, 2024
9cdf159
[force-upgrade] merged from commit "224ee92b878f8a8f4e1628bcd2464f7df…
welbon Apr 11, 2024
21c8608
[force-upgrade] change inappropriate file name
welbon Apr 12, 2024
62fedfb
[force-upgrade] fixed executed for add result to accumulator
welbon Apr 12, 2024
a5e205b
[force-deploy] add some case
welbon Apr 12, 2024
3361d28
[force-upgrade] change for test
welbon Apr 12, 2024
8bbd2a8
[force-upgrade] Change unittest for verify block template
welbon Apr 12, 2024
7913128
[force-upgrade] remove check function
welbon Apr 12, 2024
41678a1
fix compiling errors and warnings
simonjiao Apr 12, 2024
8b6eb1d
fix unused code
nkysg Apr 12, 2024
2c44243
Revert "[force-upgrade] fixed executed for add result to accumulator"
simonjiao Apr 13, 2024
a4aae5b
fix force upgrade txn test case
simonjiao Apr 13, 2024
5729a9c
fix burning tokens test
simonjiao Apr 13, 2024
c823322
add more check for main network when executing extra txn
simonjiao Apr 13, 2024
ed5f6f1
update stdlib version directly
simonjiao Apr 13, 2024
e29bf6d
fix fmt
simonjiao Apr 13, 2024
ddc3949
stdlib framework v11 with move version 6 for test
nkysg Apr 12, 2024
6b57cc2
some updates
simonjiao Apr 13, 2024
c5ac4ee
update force-deploy pkg path
simonjiao Apr 14, 2024
515a7fc
update deploy account for main network
simonjiao Apr 14, 2024
fce9ffb
fix test cases
simonjiao Apr 14, 2024
3268a42
update halley genesis
simonjiao Apr 14, 2024
da99dfe
minor updates
simonjiao Apr 14, 2024
23f9ae2
update halley force upgrade height
simonjiao Apr 14, 2024
99bb637
[force-deploy] set halley upgrade number to 600
welbon Apr 14, 2024
e64ce6a
[force-upgrade] update genesis timestamp for halley test
welbon Apr 14, 2024
65741f2
[force-upgrade]
welbon Apr 14, 2024
34be497
[force-upgrade]
welbon Apr 14, 2024
a76c9ac
[force-upgrade] update genesis
welbon Apr 14, 2024
43fdc72
change force deploy height of test network
simonjiao Apr 15, 2024
bd85cbc
update extra-txn proccessing
simonjiao Apr 15, 2024
2b3464d
fix benchmark
simonjiao Apr 16, 2024
95aa4b7
Merge branch 'master' into force_deploy
simonjiao Apr 16, 2024
d50a508
[force-upgrade] set the barnard upgrade number
welbon Apr 17, 2024
c3c4eb5
[force-upgrade] set the barnard upgrade number to 16082000
welbon Apr 17, 2024
c34f807
update force deploy height for barnard
simonjiao Apr 17, 2024
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
38 changes: 37 additions & 1 deletion Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

5 changes: 4 additions & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,7 @@ members = [
"chain",
"chain/api",
"chain/open-block",
"chain/force-upgrade",
"chain/mock",
"chain/chain-notify",
"chain/service",
Expand Down Expand Up @@ -152,6 +153,7 @@ default-members = [
"chain",
"chain/api",
"chain/open-block",
"chain/force-upgrade",
"chain/mock",
"chain/chain-notify",
"chain/service",
Expand Down Expand Up @@ -442,7 +444,7 @@ starcoin-crypto = { git = "https://github.com/starcoinorg/starcoin-crypto", rev
starcoin-decrypt = { path = "commons/decrypt" }
starcoin-dev = { path = "vm/dev" }
starcoin-executor = { path = "executor" }
starcoin-framework = { git = "https://github.com/starcoinorg/starcoin-framework", rev = "345a3900a0064dc57a9560235bc72c12f03448b1" }
starcoin-framework = { git = "https://github.com/starcoinorg/starcoin-framework", rev = "1df759371941ab59cb2295542f7eafa85c4ef6fe" }
starcoin-genesis = { path = "genesis" }
starcoin-logger = { path = "commons/logger" }
starcoin-metrics = { path = "commons/metrics" }
Expand All @@ -460,6 +462,7 @@ starcoin-network-rpc-api = { path = "network-rpc/api" }
starcoin-node = { path = "node" }
starcoin-node-api = { path = "node/api" }
starcoin-open-block = { path = "chain/open-block" }
starcoin-force-upgrade = { path = "chain/force-upgrade" }
starcoin-resource-viewer = { path = "vm/resource-viewer" }
starcoin-rpc-api = { path = "rpc/api" }
starcoin-rpc-client = { path = "rpc/client" }
Expand Down
3 changes: 3 additions & 0 deletions chain/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,8 @@ starcoin-statedb = { workspace = true }
starcoin-time-service = { workspace = true }
starcoin-types = { package = "starcoin-types", workspace = true }
starcoin-vm-types = { workspace = true }
starcoin-vm-runtime = { workspace = true }
starcoin-force-upgrade = { workspace = true }
starcoin-storage = { workspace = true }
thiserror = { workspace = true }
once_cell = { workspace = true }
Expand All @@ -41,6 +43,7 @@ stdlib = { workspace = true }
stest = { workspace = true }
test-helper = { workspace = true }
tokio = { features = ["full"], workspace = true }
starcoin-force-upgrade = { workspace = true }

[features]
default = []
Expand Down
35 changes: 35 additions & 0 deletions chain/force-upgrade/Cargo.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
[package]
authors = { workspace = true }
edition = { workspace = true }
license = { workspace = true }
name = "starcoin-force-upgrade"
publish = { workspace = true }
version = "1.13.10"
homepage = { workspace = true }
repository = { workspace = true }
rust-version = { workspace = true }


[dependencies]
anyhow = { workspace = true }
async-trait = { workspace = true }
bcs-ext = { package = "bcs-ext", workspace = true }
starcoin-crypto = { workspace = true }
futures = { workspace = true }
starcoin-logger = { workspace = true }
parking_lot = { workspace = true }
starcoin-accumulator = { workspace = true }
starcoin-chain-api = { workspace = true }
starcoin-state-api = { workspace = true }
starcoin-statedb = { workspace = true }
starcoin-storage = { workspace = true }
starcoin-types = { workspace = true }
starcoin-vm-types = { workspace = true }
starcoin-vm-runtime = { workspace = true }
starcoin-move-compiler = { workspace = true }
stdlib = { workspace = true }
include_dir = { workspace = true }

[dev-dependencies]
starcoin-genesis = { workspace = true }
stest = { workspace = true }
63 changes: 63 additions & 0 deletions chain/force-upgrade/src/lib.rs
Original file line number Diff line number Diff line change
@@ -0,0 +1,63 @@
// Copyright (c) The Starcoin Core Contributors
// SPDX-License-Identifier: Apache-2

use anyhow::format_err;
use starcoin_types::account::DEFAULT_EXPIRATION_TIME;
use starcoin_types::identifier::Identifier;
use starcoin_types::language_storage::ModuleId;
use starcoin_types::{
account::{Account, DEFAULT_MAX_GAS_AMOUNT},
transaction::SignedUserTransaction,
};
use starcoin_vm_types::account_config::core_code_address;
use starcoin_vm_types::transaction::ScriptFunction;
use starcoin_vm_types::{
account_config::STC_TOKEN_CODE_STR,
genesis_config::ChainId,
transaction::{Package, RawUserTransaction, TransactionPayload},
};
use stdlib::COMPILED_MOVE_CODE_DIR;

pub struct ForceUpgrade;

impl ForceUpgrade {
// block_timestamp: *NOTE* by seconds,
pub fn force_deploy_txn(
account: Account,
sequence_number: u64,
block_timestamp_in_secs: u64,
chain_id: &ChainId,
) -> anyhow::Result<SignedUserTransaction> {
let package_file = "12/11-12/stdlib.blob".to_string();
let package = COMPILED_MOVE_CODE_DIR
.get_file(package_file.clone())
.map(|file| {
bcs_ext::from_bytes::<Package>(file.contents())
.expect("Decode package should success")
})
.ok_or_else(|| format_err!("Can not find upgrade package {}", package_file))?;

let init_script = ScriptFunction::new(
ModuleId::new(
core_code_address(),
Identifier::new("StdlibUpgradeScripts").unwrap(),
),
Identifier::new("upgrade_from_v11_to_v12").unwrap(),
vec![],
vec![],
);

assert_eq!(package.init_script().unwrap(), &init_script);

Ok(account.sign_txn(RawUserTransaction::new(
*account.address(),
sequence_number,
TransactionPayload::Package(package),
DEFAULT_MAX_GAS_AMOUNT,
1,
block_timestamp_in_secs + DEFAULT_EXPIRATION_TIME,
*chain_id,
STC_TOKEN_CODE_STR.to_string(),
)))
}
}
3 changes: 3 additions & 0 deletions chain/open-block/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,9 @@ starcoin-state-api = { workspace = true }
starcoin-statedb = { workspace = true }
starcoin-storage = { workspace = true }
starcoin-types = { workspace = true }
starcoin-vm-types = { workspace = true }
starcoin-vm-runtime = { workspace = true }
starcoin-force-upgrade = { workspace = true }

[dev-dependencies]
starcoin-genesis = { workspace = true }
Expand Down
Loading
Loading