Skip to content

Commit

Permalink
Frozen config errmsg fix (#4033)
Browse files Browse the repository at this point in the history
* [frozen config] Add compiled v12 binary files

* [frozen config] Add stdlib building script for building new stdlib binary files

* [force-upgrade] commit fixed codes

* [force-upgrade] Add stdlib building script for building new stdlib binary files

* [force-upgrade] Fix error code of framework

* [force-upgrade] commit binary files

* [force-upgrade] fixed by the merged starcoin-move branch starcoin-main-v6

* [force-upgrade] fixed by the merged starcoin-framework branch 'v11_branch'
  • Loading branch information
welbon authored Apr 24, 2024
1 parent 654d6d9 commit c5b85a3
Show file tree
Hide file tree
Showing 12 changed files with 112 additions and 67 deletions.
80 changes: 40 additions & 40 deletions Cargo.lock

Large diffs are not rendered by default.

54 changes: 27 additions & 27 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -335,31 +335,31 @@ log4rs = { version = "1.2.0", features = ["background_rotation", "gzip"] }
lru = "0.7.8"
merkletree = { version = "0.22.1" }
mirai-annotations = "1.10.1"
move-binary-format = { git = "https://github.com/starcoinorg/move", rev = "823912c39b4b58fe1ee3f24af81dbf56849ff82a" }
move-bytecode-source-map = { git = "https://github.com/starcoinorg/move", rev = "823912c39b4b58fe1ee3f24af81dbf56849ff82a" }
move-bytecode-verifier = { git = "https://github.com/starcoinorg/move", rev = "823912c39b4b58fe1ee3f24af81dbf56849ff82a" }
move-cli = { git = "https://github.com/starcoinorg/move", rev = "823912c39b4b58fe1ee3f24af81dbf56849ff82a" }
move-command-line-common = { git = "https://github.com/starcoinorg/move", rev = "823912c39b4b58fe1ee3f24af81dbf56849ff82a" }
move-compiler = { git = "https://github.com/starcoinorg/move", rev = "823912c39b4b58fe1ee3f24af81dbf56849ff82a" }
move-core-types = { git = "https://github.com/starcoinorg/move", rev = "823912c39b4b58fe1ee3f24af81dbf56849ff82a" }
move-coverage = { git = "https://github.com/starcoinorg/move", rev = "823912c39b4b58fe1ee3f24af81dbf56849ff82a" }
move-disassembler = { git = "https://github.com/starcoinorg/move", rev = "823912c39b4b58fe1ee3f24af81dbf56849ff82a" }
move-docgen = { git = "https://github.com/starcoinorg/move", rev = "823912c39b4b58fe1ee3f24af81dbf56849ff82a" }
move-errmapgen = { git = "https://github.com/starcoinorg/move", rev = "823912c39b4b58fe1ee3f24af81dbf56849ff82a" }
move-ir-compiler = { git = "https://github.com/starcoinorg/move", rev = "823912c39b4b58fe1ee3f24af81dbf56849ff82a" }
move-ir-types = { git = "https://github.com/starcoinorg/move", rev = "823912c39b4b58fe1ee3f24af81dbf56849ff82a" }
move-model = { git = "https://github.com/starcoinorg/move", rev = "823912c39b4b58fe1ee3f24af81dbf56849ff82a" }
move-package = { git = "https://github.com/starcoinorg/move", rev = "823912c39b4b58fe1ee3f24af81dbf56849ff82a" }
move-prover = { git = "https://github.com/starcoinorg/move", rev = "823912c39b4b58fe1ee3f24af81dbf56849ff82a" }
move-prover-test-utils = { git = "https://github.com/starcoinorg/move", rev = "823912c39b4b58fe1ee3f24af81dbf56849ff82a" }
move-resource-viewer = { git = "https://github.com/starcoinorg/move", rev = "823912c39b4b58fe1ee3f24af81dbf56849ff82a" }
move-stdlib = { git = "https://github.com/starcoinorg/move", rev = "823912c39b4b58fe1ee3f24af81dbf56849ff82a" }
move-transactional-test-runner = { git = "https://github.com/starcoinorg/move", rev = "823912c39b4b58fe1ee3f24af81dbf56849ff82a" }
move-unit-test = { git = "https://github.com/starcoinorg/move", rev = "823912c39b4b58fe1ee3f24af81dbf56849ff82a", features = ["table-extension"] }
move-vm-runtime = { git = "https://github.com/starcoinorg/move", rev = "823912c39b4b58fe1ee3f24af81dbf56849ff82a" }
move-vm-types = { git = "https://github.com/starcoinorg/move", rev = "823912c39b4b58fe1ee3f24af81dbf56849ff82a" }
move-table-extension = { git = "https://github.com/starcoinorg/move", rev = "823912c39b4b58fe1ee3f24af81dbf56849ff82a" }
move-vm-test-utils = { git = "https://github.com/starcoinorg/move", rev = "823912c39b4b58fe1ee3f24af81dbf56849ff82a", features = ["table-extension"] }
move-binary-format = { git = "https://github.com/starcoinorg/move", rev = "7b6ac7bb04515ee4ced5b1c1cdafb6ea6cb4eadc" }
move-bytecode-source-map = { git = "https://github.com/starcoinorg/move", rev = "7b6ac7bb04515ee4ced5b1c1cdafb6ea6cb4eadc" }
move-bytecode-verifier = { git = "https://github.com/starcoinorg/move", rev = "7b6ac7bb04515ee4ced5b1c1cdafb6ea6cb4eadc" }
move-cli = { git = "https://github.com/starcoinorg/move", rev = "7b6ac7bb04515ee4ced5b1c1cdafb6ea6cb4eadc" }
move-command-line-common = { git = "https://github.com/starcoinorg/move", rev = "7b6ac7bb04515ee4ced5b1c1cdafb6ea6cb4eadc" }
move-compiler = { git = "https://github.com/starcoinorg/move", rev = "7b6ac7bb04515ee4ced5b1c1cdafb6ea6cb4eadc" }
move-core-types = { git = "https://github.com/starcoinorg/move", rev = "7b6ac7bb04515ee4ced5b1c1cdafb6ea6cb4eadc" }
move-coverage = { git = "https://github.com/starcoinorg/move", rev = "7b6ac7bb04515ee4ced5b1c1cdafb6ea6cb4eadc" }
move-disassembler = { git = "https://github.com/starcoinorg/move", rev = "7b6ac7bb04515ee4ced5b1c1cdafb6ea6cb4eadc" }
move-docgen = { git = "https://github.com/starcoinorg/move", rev = "7b6ac7bb04515ee4ced5b1c1cdafb6ea6cb4eadc" }
move-errmapgen = { git = "https://github.com/starcoinorg/move", rev = "7b6ac7bb04515ee4ced5b1c1cdafb6ea6cb4eadc" }
move-ir-compiler = { git = "https://github.com/starcoinorg/move", rev = "7b6ac7bb04515ee4ced5b1c1cdafb6ea6cb4eadc" }
move-ir-types = { git = "https://github.com/starcoinorg/move", rev = "7b6ac7bb04515ee4ced5b1c1cdafb6ea6cb4eadc" }
move-model = { git = "https://github.com/starcoinorg/move", rev = "7b6ac7bb04515ee4ced5b1c1cdafb6ea6cb4eadc" }
move-package = { git = "https://github.com/starcoinorg/move", rev = "7b6ac7bb04515ee4ced5b1c1cdafb6ea6cb4eadc" }
move-prover = { git = "https://github.com/starcoinorg/move", rev = "7b6ac7bb04515ee4ced5b1c1cdafb6ea6cb4eadc" }
move-prover-test-utils = { git = "https://github.com/starcoinorg/move", rev = "7b6ac7bb04515ee4ced5b1c1cdafb6ea6cb4eadc" }
move-resource-viewer = { git = "https://github.com/starcoinorg/move", rev = "7b6ac7bb04515ee4ced5b1c1cdafb6ea6cb4eadc" }
move-stdlib = { git = "https://github.com/starcoinorg/move", rev = "7b6ac7bb04515ee4ced5b1c1cdafb6ea6cb4eadc" }
move-transactional-test-runner = { git = "https://github.com/starcoinorg/move", rev = "7b6ac7bb04515ee4ced5b1c1cdafb6ea6cb4eadc" }
move-unit-test = { git = "https://github.com/starcoinorg/move", rev = "7b6ac7bb04515ee4ced5b1c1cdafb6ea6cb4eadc", features = ["table-extension"] }
move-vm-runtime = { git = "https://github.com/starcoinorg/move", rev = "7b6ac7bb04515ee4ced5b1c1cdafb6ea6cb4eadc" }
move-vm-types = { git = "https://github.com/starcoinorg/move", rev = "7b6ac7bb04515ee4ced5b1c1cdafb6ea6cb4eadc" }
move-table-extension = { git = "https://github.com/starcoinorg/move", rev = "7b6ac7bb04515ee4ced5b1c1cdafb6ea6cb4eadc" }
move-vm-test-utils = { git = "https://github.com/starcoinorg/move", rev = "7b6ac7bb04515ee4ced5b1c1cdafb6ea6cb4eadc", features = ["table-extension"] }

names = { version = "0.14.0", default-features = false }
network-api = { path = "network/api", package = "network-api" }
Expand Down Expand Up @@ -444,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 = "1df759371941ab59cb2295542f7eafa85c4ef6fe" }
starcoin-framework = { git = "https://github.com/starcoinorg/starcoin-framework", rev = "3e879a168036dceaa60c57c8e2b9228283476f81" }
starcoin-genesis = { path = "genesis" }
starcoin-logger = { path = "commons/logger" }
starcoin-metrics = { path = "commons/metrics" }
Expand Down Expand Up @@ -525,7 +525,7 @@ unsigned-varint = { version = "0.6.0", features = [
"futures",
"asynchronous_codec",
] }
vm = { package = "move-binary-format", git = "https://github.com/starcoinorg/move", rev = "823912c39b4b58fe1ee3f24af81dbf56849ff82a", features = [
vm = { package = "move-binary-format", git = "https://github.com/starcoinorg/move", rev = "7b6ac7bb04515ee4ced5b1c1cdafb6ea6cb4eadc", features = [
"fuzzing",
] }
vm-status-translator = { path = "vm/vm-status-translator" }
Expand Down
36 changes: 36 additions & 0 deletions scripts/build_stdlib.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
#!/bin/bash

SOURCE_VERSION=$1
TARGET_VERSION=$2

if [ $# -lt 2 ]; then
echo "Usage: $0 SOURCE_VERSION TARGET_VERSION [ARGS...]"
exit 1
fi

SOURCE_VERSION=$1
TARGET_VERSION=$2

# check SOURCE_VERSION and TARGET_VERSION has defined
if [ -z "$SOURCE_VERSION" ] || [ -z "$TARGET_VERSION" ]; then
echo "SOURCE_VERSION and TARGET_VERSION must be specified."
exit 1
fi

# Check SOURCE_VERSION and TARGET_VERSION is number
if ! [[ "$SOURCE_VERSION" =~ ^[0-9]+$ ]] || ! [[ "$TARGET_VERSION" =~ ^[0-9]+$ ]]; then
echo "SOURCE_VERSION and TARGET_VERSION must be integers."
exit 1
fi

cargo run --bin stdlib

cmd="cargo run --bin stdlib -- -v ${TARGET_VERSION} -m StdlibUpgradeScripts -f upgrade_from_v${SOURCE_VERSION}_to_v${TARGET_VERSION}"

args=("${@:3}")

for arg in "${args[@]}"; do
cmd+=" --arg ${arg}"
done

eval $cmd
Binary file modified vm/stdlib/compiled/12/11-12/stdlib.blob
Binary file not shown.
Binary file modified vm/stdlib/compiled/12/11-12/stdlib/064_StdlibUpgradeScripts.mv
Binary file not shown.
Binary file modified vm/stdlib/compiled/12/11-12/stdlib/078_TransactionManager.mv
Binary file not shown.
Binary file modified vm/stdlib/compiled/12/stdlib/064_StdlibUpgradeScripts.mv
Binary file not shown.
Binary file modified vm/stdlib/compiled/12/stdlib/078_TransactionManager.mv
Binary file not shown.
Binary file not shown.
Binary file modified vm/stdlib/compiled/latest/stdlib/064_StdlibUpgradeScripts.mv
Binary file not shown.
Binary file modified vm/stdlib/compiled/latest/stdlib/078_TransactionManager.mv
Binary file not shown.
9 changes: 9 additions & 0 deletions vm/vm-runtime/src/errors.rs
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,8 @@ const PROLOGUE_BAD_CHAIN_ID: u64 = 6;
const PROLOGUE_MODULE_NOT_ALLOWED: u64 = 7;
const PROLOGUE_SCRIPT_NOT_ALLOWED: u64 = 8;
const PROLOGUE_SEQUENCE_NUMBER_TOO_BIG: u64 = 9;
const EPROLOGUE_SENDING_ACCOUNT_FROZEN: u64 = 10;
const EPROLOGUE_SENDING_TXN_GLOBAL_FROZEN: u64 = 11;
const EPROLOGUE_SIGNER_ALREADY_DELEGATED: u64 = 200;

const EINSUFFICIENT_BALANCE: u64 = 10;
Expand Down Expand Up @@ -86,6 +88,13 @@ pub fn convert_prologue_runtime_error(error: VMError) -> Result<(), VMStatus> {
(INVALID_ARGUMENT, EBAD_TRANSACTION_FEE_TOKEN) => {
StatusCode::BAD_TRANSACTION_FEE_CURRENCY
}
(INVALID_ARGUMENT, EPROLOGUE_SENDING_ACCOUNT_FROZEN) => {
StatusCode::SENDING_ACCOUNT_FROZEN
}
(INVALID_ARGUMENT, EPROLOGUE_SENDING_TXN_GLOBAL_FROZEN) => {
StatusCode::SEND_TXN_GLOBAL_FROZEN
}

(category, reason) => {
warn!(
"prologue runtime unknown: category({}), reason:({}), location:({})",
Expand Down

0 comments on commit c5b85a3

Please sign in to comment.