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

[dev branch] move update use new gas meter imp #3795

Merged
merged 70 commits into from
Jan 8, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
70 commits
Select commit Hold shift + click to select a range
985b1ce
use GasParameter replace costTable
nkysg Oct 24, 2022
3ce0cde
compat GasCost and GasConstants
nkysg Nov 1, 2022
537e401
ErrorContext change to ErrorDescription
nkysg Nov 2, 2022
96f69e0
update GasConstants member function
nkysg Nov 2, 2022
02fc897
ErrorContext change to ErrorDescription
nkysg Nov 3, 2022
84663c4
update move TableHandle def
nkysg Nov 3, 2022
26fd468
1.refactor gas-algebra-ext
nkysg Nov 7, 2022
90e235b
1.fix mpm code
nkysg Nov 8, 2022
d82bf5e
1.fix mpm code
nkysg Nov 8, 2022
c113ab3
fix fmt
nkysg Nov 8, 2022
b048de6
for build_test
nkysg Nov 8, 2022
449266f
fix test compiler error
nkysg Nov 10, 2022
f3be064
fix fmt
nkysg Nov 10, 2022
4312ccc
build_test for test
nkysg Nov 10, 2022
1fd254f
fix NativeGasParams
nkysg Nov 10, 2022
9f35588
1.add move stdlib nursery GasParam
nkysg Nov 13, 2022
1f9f4f8
update starcoin_natives gas_params
nkysg Nov 13, 2022
372e5af
update VmConfig to gas_params
nkysg Nov 14, 2022
c8b002e
fix GasParams names
nkysg Nov 14, 2022
8fb1b71
fix GasParams names
nkysg Nov 15, 2022
927922b
1.fix native function name
nkysg Nov 15, 2022
d3289e4
1.fix native function name
nkysg Nov 15, 2022
bc7e567
add genesis
nkysg Nov 15, 2022
432fe4d
temp test
nkysg Nov 15, 2022
9b1027f
fix test_example_config_compact
nkysg Nov 15, 2022
73a9318
revert barnard genesis
nkysg Nov 15, 2022
31767d3
add comment
nkysg Nov 16, 2022
421be47
remove test code
nkysg Nov 16, 2022
3afc931
add vmconfig to gas_schedule test
nkysg Nov 17, 2022
3d7bd66
add gas meter calc function
nkysg Nov 17, 2022
73bbf02
remove debug info
nkysg Nov 17, 2022
e7e8ec5
fix simple_instruction
nkysg Nov 18, 2022
e238398
fix complex instr and gas_meter
nkysg Nov 19, 2022
dca8baf
remove unused code
nkysg Nov 19, 2022
8e82dd4
fix gas_meter related charge implement
nkysg Nov 20, 2022
ce16398
fix log
nkysg Nov 20, 2022
8f3c261
remove unused code
nkysg Nov 20, 2022
4577711
update starcoin_vm get gas_params
nkysg Nov 21, 2022
bf8a3ef
temp remove table_info column
nkysg Nov 21, 2022
e48a057
fix charge_move_to and charge_borrow_global
nkysg Nov 21, 2022
1d093ab
add debug info for gas_meter
nkysg Nov 24, 2022
a932a53
fix vector append remove reverse
nkysg Nov 24, 2022
aa57308
fix sha2_256 sha3_256 native_function cal zero str
nkysg Nov 25, 2022
e413a85
add nft INTERNAL_TYPE_ERROR test
nkysg Dec 1, 2022
542b49c
Add more test
jolestar Dec 1, 2022
39a0faa
[vm] Fix #3804, the vm do not clear cache correctly.
jolestar Dec 2, 2022
f8c9824
update move
nkysg Dec 2, 2022
f334be5
update starcoin-framework
nkysg Dec 2, 2022
20e31c3
fix gas-algebra config
nkysg Dec 2, 2022
7cc5c39
fix fmt
nkysg Dec 3, 2022
6734190
add test stdlib precompiled
nkysg Dec 4, 2022
041f6bd
fix test_init_script and test_signer_cap_internal_type_error
nkysg Dec 5, 2022
4f3b2c0
update move_stdlib params
nkysg Dec 5, 2022
5aaa973
comment stdlib pre compiler test
nkysg Dec 5, 2022
2844028
Package transaction publish bundle logic
nkysg Dec 6, 2022
cf923d7
Update move dep for fixing transactional test harness
sanlee42 Dec 6, 2022
ebe0c4d
reopen test_stdlib_pre_compiled
sanlee42 Dec 6, 2022
d6d2645
Fix test cases
sanlee42 Dec 6, 2022
ec9a232
comment StarcoinFramework checkpoint
nkysg Dec 7, 2022
77f0063
compatible legacy AccountDataCache
nkysg Dec 7, 2022
9d843d5
remove unused file
nkysg Dec 8, 2022
944b8e0
add move bytecode v5 to v4
nkysg Dec 9, 2022
a74cba0
Fix task help
WGB5445 Dec 13, 2022
bd1cea9
move bytecode v6
nkysg Dec 26, 2022
415e9c9
update starcoin-framework
nkysg Dec 26, 2022
d055178
fix test
nkysg Dec 26, 2022
cd8be13
update genesis
nkysg Dec 26, 2022
ab9033f
fix test
nkysg Dec 26, 2022
b6a05fb
fix test
nkysg Dec 26, 2022
cd3ebc9
fix https://github.com/starcoinorg/starcoin/issues/3827
nkysg Dec 29, 2022
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
909 changes: 558 additions & 351 deletions Cargo.lock

Large diffs are not rendered by default.

4 changes: 4 additions & 0 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,9 @@ members = [
"vm/transaction-builder-generator",
"vm/move-coverage",
"vm/resource-viewer",
"vm/starcoin-gas",
"vm/dev",
"vm/gas-algebra-ext",
"vm/move-explain",
"vm/move-package-manager",
"vm/vm-status-translator",
Expand Down Expand Up @@ -178,7 +180,9 @@ default-members = [
"vm/transaction-builder-generator",
"vm/move-coverage",
"vm/resource-viewer",
"vm/starcoin-gas",
"vm/dev",
"vm/gas-algebra-ext",
"vm/move-explain",
"vm/move-package-manager",
"vm/vm-status-translator",
Expand Down
2 changes: 1 addition & 1 deletion abi/decoder/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ version = "1.12.5"
[dependencies]
anyhow = "1.0.41"
hex = "0.4.3"
move-binary-format = { git = "https://github.com/starcoinorg/move", rev = "204da96abcb6eb82bc50fcbcd4331f6cc3d17439" }
move-binary-format = { git = "https://github.com/starcoinorg/move", rev = "a781b641dd345c3e8f3e83ed080597f6c23a157c" }
starcoin-resource-viewer = { path = "../../vm/resource-viewer" }
starcoin-vm-types = { path = "../../vm/types" }
starcoin-abi-types = { path = "../types" }
Expand Down
4 changes: 4 additions & 0 deletions abi/decoder/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -82,8 +82,12 @@ fn value_to_json(origin: AnnotatedMoveValue) -> serde_json::Value {
use serde_json::Value;
match origin {
AnnotatedMoveValue::U8(v) => Value::Number(v.into()),
AnnotatedMoveValue::U16(v) => Value::Number(v.into()),
AnnotatedMoveValue::U32(v) => Value::Number(v.into()),
AnnotatedMoveValue::U64(v) => Value::Number(v.into()),
AnnotatedMoveValue::U128(v) => Value::Number(v.into()),
// XXX FIXME YSG
AnnotatedMoveValue::U256(v) => Value::String(v.to_string()),
AnnotatedMoveValue::Bool(v) => Value::Bool(v),
AnnotatedMoveValue::Address(v) => Value::String(v.to_string()),
AnnotatedMoveValue::Vector(v) => Value::Array(v.into_iter().map(value_to_json).collect()),
Expand Down
2 changes: 1 addition & 1 deletion abi/resolver/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ starcoin-vm-types = { path = "../../vm/types" }
starcoin-abi-types = { path = "../types" }
anyhow = "~1"
starcoin-resource-viewer = { path = "../../vm/resource-viewer" }
move-model = { git = "https://github.com/starcoinorg/move", rev = "204da96abcb6eb82bc50fcbcd4331f6cc3d17439" }
move-model = { git = "https://github.com/starcoinorg/move", rev = "a781b641dd345c3e8f3e83ed080597f6c23a157c" }
[dev-dependencies]
stdlib = { path = "../../vm/stdlib" }
serde_json = "1"
Expand Down
13 changes: 9 additions & 4 deletions abi/resolver/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ use starcoin_resource_viewer::module_cache::ModuleCache;
use starcoin_resource_viewer::resolver::Resolver;
use starcoin_vm_types::access::ModuleAccess;
use starcoin_vm_types::file_format::{
CompiledModule, CompiledScript, FunctionDefinitionIndex, StructDefinitionIndex, Visibility,
CompiledModule, CompiledScript, FunctionDefinitionIndex, StructDefinitionIndex,
};
use starcoin_vm_types::identifier::{IdentStr, Identifier};
use starcoin_vm_types::language_storage::{ModuleId, StructTag, TypeTag};
Expand Down Expand Up @@ -63,7 +63,7 @@ impl<'a> ABIResolver<'a> {
let functions = m
.exposed_functions
.iter()
.filter(|(_, func)| func.visibility == Visibility::Script) // only script functions
// .filter(|(_, func)| func.visibility == Visibility::Script) // only script functions
.map(|(name, func)| self.function_to_abi(&module_id, name.as_ident_str(), func))
.collect::<Result<Vec<_>>>()?;
Ok(ModuleABI::new(m.module_id(), structs, functions))
Expand Down Expand Up @@ -108,8 +108,11 @@ impl<'a> ABIResolver<'a> {
Ok(match type_tag {
TypeTag::Bool => TypeInstantiation::Bool,
TypeTag::U8 => TypeInstantiation::U8,
TypeTag::U16 => TypeInstantiation::U16,
TypeTag::U32 => TypeInstantiation::U32,
TypeTag::U64 => TypeInstantiation::U64,
TypeTag::U128 => TypeInstantiation::U128,
TypeTag::U256 => TypeInstantiation::U256,
TypeTag::Address => TypeInstantiation::Address,

TypeTag::Signer => TypeInstantiation::Signer,
Expand All @@ -134,8 +137,11 @@ impl<'a> ABIResolver<'a> {
Ok(match ty {
Type::Bool => TypeInstantiation::Bool,
Type::U8 => TypeInstantiation::U8,
Type::U16 => TypeInstantiation::U16,
Type::U32 => TypeInstantiation::U32,
Type::U64 => TypeInstantiation::U64,
Type::U128 => TypeInstantiation::U128,
Type::U256 => TypeInstantiation::U256,
Type::Address => TypeInstantiation::Address,
Type::Signer => TypeInstantiation::Signer,
Type::Struct {
Expand Down Expand Up @@ -388,8 +394,7 @@ mod tests {
}))
}
StateKey::TableItem(_table_item) => {
// XXX FIXME YSG
unimplemented!()
anyhow::bail!("no need table_item")
}
}
}
Expand Down
1 change: 1 addition & 0 deletions abi/types/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -15,3 +15,4 @@ serde_bytes = "0.11"
serde_json = "~1"
hex = "0.4"
schemars = { git = "https://github.com/starcoinorg/schemars", rev = "6972da92f4360e1779168bb3fe0274c521d324e2" }
move-core-types = { git = "https://github.com/starcoinorg/move", rev = "a781b641dd345c3e8f3e83ed080597f6c23a157c" }
17 changes: 14 additions & 3 deletions abi/types/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -571,8 +571,11 @@ impl FieldABI {
pub enum TypeInstantiation {
Bool,
U8,
U16,
U32,
U64,
U128,
U256,
Address,
Signer,
Vector(Box<TypeInstantiation>),
Expand All @@ -591,9 +594,11 @@ impl TypeInstantiation {
Ok(match self {
Self::Bool => MoveTypeLayout::Bool,
Self::U8 => MoveTypeLayout::U8,

Self::U16 => MoveTypeLayout::U16,
Self::U32 => MoveTypeLayout::U32,
Self::U64 => MoveTypeLayout::U64,
Self::U128 => MoveTypeLayout::U128,
Self::U256 => MoveTypeLayout::U256,
Self::Address => MoveTypeLayout::Address,
Self::Signer => MoveTypeLayout::Signer,

Expand All @@ -607,14 +612,16 @@ impl TypeInstantiation {
Ok(match self {
Self::Bool => TypeTag::Bool,
Self::U8 => TypeTag::U8,

Self::U16 => TypeTag::U16,
Self::U32 => TypeTag::U32,
Self::U64 => TypeTag::U64,
Self::U128 => TypeTag::U128,
Self::U256 => TypeTag::U256,
Self::Address => TypeTag::Address,
Self::Signer => TypeTag::Signer,

Self::Vector(t) => TypeTag::Vector(Box::new(t.type_tag()?)),
Self::Struct(s) => TypeTag::Struct(s.struct_tag()?),
Self::Struct(s) => TypeTag::Struct(Box::new(s.struct_tag()?)),
Self::TypeParameter(_) => anyhow::bail!("get type tag failed -- {:?}", self),
Self::Reference(_, _) => anyhow::bail!("get type tag failed -- {:?}", self),
})
Expand Down Expand Up @@ -650,8 +657,12 @@ impl<'d> serde::de::DeserializeSeed<'d> for &TypeInstantiation {
match &self {
T::Bool => bool::deserialize(deserializer).map(V::Bool),
T::U8 => u8::deserialize(deserializer).map(Into::into),
T::U16 => u16::deserialize(deserializer).map(Into::into),
T::U32 => u32::deserialize(deserializer).map(Into::into),
T::U64 => u64::deserialize(deserializer).map(Into::into),
T::U128 => u128::deserialize(deserializer).map(Into::into),
// XXX FIXME YSG
T::U256 => Err(D::Error::custom("type U256 not process variant")),
T::Address => {
AccountAddress::deserialize(deserializer).map(|addr| V::String(addr.to_string()))
}
Expand Down
4 changes: 2 additions & 2 deletions chain/tests/test_block_chain.rs
Original file line number Diff line number Diff line change
Expand Up @@ -28,12 +28,12 @@ fn test_chain_filter_events() {
let times = 10;
mock_chain.produce_and_apply_times(times).unwrap();

let event_type_tag = TypeTag::Struct(StructTag {
let event_type_tag = TypeTag::Struct(Box::new(StructTag {
address: genesis_address(),
module: Identifier::from_str("Block").unwrap(),
name: Identifier::from_str("NewBlockEvent").unwrap(),
type_params: vec![],
});
}));

// Origin block event index is 4, after https://github.com/starcoinorg/starcoin-framework/pull/42 , Genesis account create more event_handles, so the block event index is 7.
// So we should use type_tags to filter event, do not dependent on event key.
Expand Down
2 changes: 1 addition & 1 deletion cmd/airdrop/src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -124,7 +124,7 @@ async fn main() -> Result<()> {
.token_code
.unwrap_or_else(|| G_STC_TOKEN_CODE.clone())
.try_into()?;
let is_stc = stc_type_tag().eq(&TypeTag::Struct(token_type.clone()));
let is_stc = stc_type_tag().eq(&TypeTag::Struct(Box::new(token_type.clone())));

let mut total_amount = 0u128;
let airdrop_infos: Vec<AirdropInfo> = {
Expand Down
4 changes: 2 additions & 2 deletions cmd/db-exporter/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -33,8 +33,8 @@ logger = { path = "../../commons/logger", package = "starcoin-logger" }
clap = { version = "3", features = ["derive"] }
atomic-counter = "1.0.1"
tokio = { version = "^1", features = ["full"] }
move-binary-format = { git = "https://github.com/starcoinorg/move", rev = "204da96abcb6eb82bc50fcbcd4331f6cc3d17439" }
move-bytecode-verifier = { git = "https://github.com/starcoinorg/move", rev = "204da96abcb6eb82bc50fcbcd4331f6cc3d17439" }
move-binary-format = { git = "https://github.com/starcoinorg/move", rev = "a781b641dd345c3e8f3e83ed080597f6c23a157c" }
move-bytecode-verifier = { git = "https://github.com/starcoinorg/move", rev = "a781b641dd345c3e8f3e83ed080597f6c23a157c" }
starcoin-resource-viewer = { path = "../../vm/resource-viewer" }
starcoin-state-tree = { path = "../../state/state-tree" }
[target."cfg(target_os=\"linux\")".dependencies]
Expand Down
10 changes: 3 additions & 7 deletions cmd/db-exporter/src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -672,6 +672,7 @@ pub fn apply_block(
network: BuiltinNetworkID,
verifier: Verifier,
) -> anyhow::Result<()> {
::logger::init();
let net = ChainNetwork::new_builtin(network);
let db_storage = DBStorage::new(to_dir.join("starcoindb/db"), RocksdbConfig::default(), None)?;
let storage = Arc::new(Storage::new(StorageInstance::new_cache_and_db_instance(
Expand Down Expand Up @@ -767,12 +768,6 @@ pub fn startup_info_back(

let cur_num = chain.status().head().number();
let back_size = back_size.unwrap_or(BACK_SIZE);
let back_size = if back_size < BACK_SIZE {
BACK_SIZE
} else {
back_size
};

if cur_num <= back_size {
println!(
"startup_info block number {} <= back_size {}",
Expand Down Expand Up @@ -1838,12 +1833,13 @@ impl serde::Serialize for MoveValue {
}
AnnotatedMoveValue::Bytes(v) => hex::encode(v).serialize(serializer),
AnnotatedMoveValue::Struct(v) => MoveStruct(v.clone()).serialize(serializer),
_ => todo!("XXX FXIME YSG"),
}
}
}
fn parse_struct_tag(input: &str) -> anyhow::Result<StructTag> {
match parse_type_tag(input)? {
TypeTag::Struct(s) => Ok(s),
TypeTag::Struct(s) => Ok(*s),
_ => {
anyhow::bail!("invalid struct tag")
}
Expand Down
3 changes: 2 additions & 1 deletion cmd/resource-exporter/src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -142,13 +142,14 @@ impl serde::Serialize for MoveValue {
}
AnnotatedMoveValue::Bytes(v) => hex::encode(v).serialize(serializer),
AnnotatedMoveValue::Struct(v) => MoveStruct(v.clone()).serialize(serializer),
_ => todo!("XXX FIXME YSG"),
}
}
}

fn parse_struct_tag(input: &str) -> anyhow::Result<StructTag> {
match parse_type_tag(input)? {
TypeTag::Struct(s) => Ok(s),
TypeTag::Struct(s) => Ok(*s),
_ => {
anyhow::bail!("invalid struct tag")
}
Expand Down
4 changes: 2 additions & 2 deletions cmd/starcoin/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -49,13 +49,13 @@ starcoin-resource-viewer = { path = "../../vm/resource-viewer" }
starcoin-service-registry = { path = "../../commons/service-registry" }
starcoin-move-explain = { path = "../../vm/move-explain" }
vm-status-translator = { path = "../../vm/vm-status-translator" }
move-errmapgen = { git = "https://github.com/starcoinorg/move", rev = "204da96abcb6eb82bc50fcbcd4331f6cc3d17439" }
move-errmapgen = { git = "https://github.com/starcoinorg/move", rev = "a781b641dd345c3e8f3e83ed080597f6c23a157c" }
network-api = { path = "../../network/api", package = "network-api" }
starcoin-network-rpc-api = { path = "../../network-rpc/api" }
starcoin-abi-decoder = { path = "../../abi/decoder" }
starcoin-abi-resolver = { path = "../../abi/resolver" }
starcoin-abi-types = { path = "../../abi/types" }
move-command-line-common = { git = "https://github.com/starcoinorg/move", rev = "204da96abcb6eb82bc50fcbcd4331f6cc3d17439" }
move-command-line-common = { git = "https://github.com/starcoinorg/move", rev = "a781b641dd345c3e8f3e83ed080597f6c23a157c" }

[dev-dependencies]
test-helper = { path = "../../test-helper" }
Expand Down
4 changes: 3 additions & 1 deletion cmd/starcoin/src/account/accept_token_cmd.rs
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,9 @@ impl CommandAction for AcceptTokenCommand {
TransactionPayload::ScriptFunction(ScriptFunction::new(
ModuleId::new(core_code_address(), Identifier::new("Account").unwrap()),
Identifier::new("accept_token").unwrap(),
vec![TypeTag::Struct(opt.token_code.clone().try_into().unwrap())],
vec![TypeTag::Struct(Box::new(
opt.token_code.clone().try_into().unwrap(),
))],
vec![],
)),
)
Expand Down
14 changes: 7 additions & 7 deletions cmd/starcoin/src/view.rs
Original file line number Diff line number Diff line change
Expand Up @@ -169,7 +169,7 @@ pub enum EventDataView {

impl EventDataView {
pub fn new(event_type_tag: &TypeTag, event_data: &[u8]) -> anyhow::Result<Self> {
if event_type_tag == &TypeTag::Struct(DepositEvent::struct_tag()) {
if event_type_tag == &TypeTag::Struct(Box::new(DepositEvent::struct_tag())) {
if let Ok(received_event) = DepositEvent::try_from_bytes(event_data) {
Ok(EventDataView::ReceivedPayment {
amount: received_event.amount(),
Expand All @@ -179,7 +179,7 @@ impl EventDataView {
} else {
Err(format_err!("Unable to parse ReceivedPaymentEvent"))
}
} else if event_type_tag == &TypeTag::Struct(WithdrawEvent::struct_tag()) {
} else if event_type_tag == &TypeTag::Struct(Box::new(WithdrawEvent::struct_tag())) {
if let Ok(sent_event) = WithdrawEvent::try_from_bytes(event_data) {
Ok(EventDataView::SentPayment {
amount: sent_event.amount(),
Expand All @@ -189,7 +189,7 @@ impl EventDataView {
} else {
Err(format_err!("Unable to parse SentPaymentEvent"))
}
} else if event_type_tag == &TypeTag::Struct(MintEvent::struct_tag()) {
} else if event_type_tag == &TypeTag::Struct(Box::new(MintEvent::struct_tag())) {
if let Ok(mint_event) = MintEvent::try_from_bytes(event_data) {
Ok(EventDataView::Mint {
amount: mint_event.amount(),
Expand All @@ -198,7 +198,7 @@ impl EventDataView {
} else {
Err(format_err!("Unable to parse MintEvent"))
}
} else if event_type_tag == &TypeTag::Struct(ProposalCreatedEvent::struct_tag()) {
} else if event_type_tag == &TypeTag::Struct(Box::new(ProposalCreatedEvent::struct_tag())) {
if let Ok(event) = ProposalCreatedEvent::try_from_bytes(event_data) {
Ok(EventDataView::ProposalCreated {
proposal_id: event.proposal_id,
Expand All @@ -207,7 +207,7 @@ impl EventDataView {
} else {
Err(format_err!("Unable to parse ProposalCreatedEvent"))
}
} else if event_type_tag == &TypeTag::Struct(VoteChangedEvent::struct_tag()) {
} else if event_type_tag == &TypeTag::Struct(Box::new(VoteChangedEvent::struct_tag())) {
if let Ok(event) = VoteChangedEvent::try_from_bytes(event_data) {
Ok(EventDataView::VoteChanged {
proposal_id: event.proposal_id,
Expand All @@ -219,15 +219,15 @@ impl EventDataView {
} else {
Err(format_err!("Unable to parse VoteChangedEvent"))
}
} else if event_type_tag == &TypeTag::Struct(AcceptTokenEvent::struct_tag()) {
} else if event_type_tag == &TypeTag::Struct(Box::new(AcceptTokenEvent::struct_tag())) {
if let Ok(event) = AcceptTokenEvent::try_from_bytes(event_data) {
Ok(EventDataView::AcceptToken {
token_code: event.token_code().to_string(),
})
} else {
Err(format_err!("Unable to parse VoteChangedEvent"))
}
} else if event_type_tag == &TypeTag::Struct(BlockRewardEvent::struct_tag()) {
} else if event_type_tag == &TypeTag::Struct(Box::new(BlockRewardEvent::struct_tag())) {
Ok(BlockRewardEvent::try_from_bytes(event_data)
.map_err(|_| format_err!("Unable to parse {}", BlockRewardEvent::struct_tag()))?
.into())
Expand Down
2 changes: 1 addition & 1 deletion commons/bcs_ext/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -8,5 +8,5 @@ version = "1.12.5"

[dependencies]
anyhow = "1.0.41"
bcs = "0.1.3"
bcs = "0.1.4"
serde = {version = "1.0.130"}
2 changes: 1 addition & 1 deletion commons/proptest-helpers/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,6 @@ version = "1.12.5"

[dependencies]
crossbeam = "0.7.3"
diem-proptest-helpers = { package = "diem-proptest-helpers", git = "https://github.com/starcoinorg/move", rev = "204da96abcb6eb82bc50fcbcd4331f6cc3d17439" }
diem-proptest-helpers = { package = "diem-proptest-helpers", git = "https://github.com/starcoinorg/move", rev = "a781b641dd345c3e8f3e83ed080597f6c23a157c" }
proptest = "1.0.0"
proptest-derive = "0.3.0"
2 changes: 2 additions & 0 deletions config/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -39,3 +39,5 @@ serde_json = { version = "1.0", features = ["arbitrary_precision"] }
starcoin-time-service = { path = "../commons/time-service" }
thiserror = "1.0"
toml = { version = "0.5.9", default-features = false }
gas-algebra-ext = { path = "../vm/gas-algebra-ext" }
starcoin-gas = { path = "../vm/starcoin-gas" }
14 changes: 5 additions & 9 deletions config/example/proxima/genesis_config.json
Original file line number Diff line number Diff line change
Expand Up @@ -443,27 +443,23 @@
"memory_gas": 1
},
{
"instruction_gas": 4,
"memory_gas": 1
},
{
"instruction_gas": 4,
"instruction_gas": 10,
"memory_gas": 1
},
{
"instruction_gas": 4,
"instruction_gas": 8,
"memory_gas": 1
},
{
"instruction_gas": 4,
"instruction_gas": 40,
"memory_gas": 1
},
{
"instruction_gas": 4,
"instruction_gas": 20,
"memory_gas": 1
},
{
"instruction_gas": 4,
"instruction_gas": 73,
"memory_gas": 1
},
{
Expand Down
Loading