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

Regenerate for new crypto cost types #266

Merged
merged 1 commit into from
Jun 13, 2023
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
45 changes: 40 additions & 5 deletions src/next/generated.rs
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ pub const XDR_FILES_SHA256: [(&str, &str); 12] = [
),
(
"xdr/next/Stellar-contract-config-setting.x",
"92645b4ee5ca32d9a44419751661501092b9d9ef9b391266ab2336af29723a20",
"d653b5434b79b82ccf6252c2a9cfeef3c8c13537d59e9e0baa3c31a7524a5ef3",
),
(
"xdr/next/Stellar-contract-env-meta.x",
Expand Down Expand Up @@ -3151,7 +3151,17 @@ impl WriteXdr for ConfigSettingContractBandwidthV0 {
// // Roundtrip cost of invoking a VM function from the host.
// InvokeVmFunction = 19,
// // Cost of charging a value to the budgeting system.
// ChargeBudget = 20
// ChargeBudget = 20,
// // Cost of computing a keccak256 hash from bytes.
// ComputeKeccak256Hash = 21,
// // Cost of computing an ECDSA secp256k1 pubkey from bytes.
// ComputeEcdsaSecp256k1Key = 22,
// // Cost of computing an ECDSA secp256k1 signature from bytes.
// ComputeEcdsaSecp256k1Sig = 23,
// // Cost of verifying an ECDSA secp256k1 signature.
// VerifyEcdsaSecp256k1Sig = 24,
// // Cost of recovering an ECDSA secp256k1 key from a signature.
// RecoverEcdsaSecp256k1Key = 25
// };
//
// enum
Expand Down Expand Up @@ -3185,10 +3195,15 @@ pub enum ContractCostType {
VmInstantiation = 18,
InvokeVmFunction = 19,
ChargeBudget = 20,
ComputeKeccak256Hash = 21,
ComputeEcdsaSecp256k1Key = 22,
ComputeEcdsaSecp256k1Sig = 23,
VerifyEcdsaSecp256k1Sig = 24,
RecoverEcdsaSecp256k1Key = 25,
}

impl ContractCostType {
pub const VARIANTS: [ContractCostType; 21] = [
pub const VARIANTS: [ContractCostType; 26] = [
ContractCostType::WasmInsnExec,
ContractCostType::WasmMemAlloc,
ContractCostType::HostMemAlloc,
Expand All @@ -3210,8 +3225,13 @@ impl ContractCostType {
ContractCostType::VmInstantiation,
ContractCostType::InvokeVmFunction,
ContractCostType::ChargeBudget,
ContractCostType::ComputeKeccak256Hash,
ContractCostType::ComputeEcdsaSecp256k1Key,
ContractCostType::ComputeEcdsaSecp256k1Sig,
ContractCostType::VerifyEcdsaSecp256k1Sig,
ContractCostType::RecoverEcdsaSecp256k1Key,
];
pub const VARIANTS_STR: [&'static str; 21] = [
pub const VARIANTS_STR: [&'static str; 26] = [
"WasmInsnExec",
"WasmMemAlloc",
"HostMemAlloc",
Expand All @@ -3233,6 +3253,11 @@ impl ContractCostType {
"VmInstantiation",
"InvokeVmFunction",
"ChargeBudget",
"ComputeKeccak256Hash",
"ComputeEcdsaSecp256k1Key",
"ComputeEcdsaSecp256k1Sig",
"VerifyEcdsaSecp256k1Sig",
"RecoverEcdsaSecp256k1Key",
];

#[must_use]
Expand All @@ -3259,11 +3284,16 @@ impl ContractCostType {
Self::VmInstantiation => "VmInstantiation",
Self::InvokeVmFunction => "InvokeVmFunction",
Self::ChargeBudget => "ChargeBudget",
Self::ComputeKeccak256Hash => "ComputeKeccak256Hash",
Self::ComputeEcdsaSecp256k1Key => "ComputeEcdsaSecp256k1Key",
Self::ComputeEcdsaSecp256k1Sig => "ComputeEcdsaSecp256k1Sig",
Self::VerifyEcdsaSecp256k1Sig => "VerifyEcdsaSecp256k1Sig",
Self::RecoverEcdsaSecp256k1Key => "RecoverEcdsaSecp256k1Key",
}
}

#[must_use]
pub const fn variants() -> [ContractCostType; 21] {
pub const fn variants() -> [ContractCostType; 26] {
Self::VARIANTS
}
}
Expand Down Expand Up @@ -3315,6 +3345,11 @@ impl TryFrom<i32> for ContractCostType {
18 => ContractCostType::VmInstantiation,
19 => ContractCostType::InvokeVmFunction,
20 => ContractCostType::ChargeBudget,
21 => ContractCostType::ComputeKeccak256Hash,
22 => ContractCostType::ComputeEcdsaSecp256k1Key,
23 => ContractCostType::ComputeEcdsaSecp256k1Sig,
24 => ContractCostType::VerifyEcdsaSecp256k1Sig,
25 => ContractCostType::RecoverEcdsaSecp256k1Key,
#[allow(unreachable_patterns)]
_ => return Err(Error::Invalid),
};
Expand Down
2 changes: 1 addition & 1 deletion xdr/next
2 changes: 1 addition & 1 deletion xdr/next-version
Original file line number Diff line number Diff line change
@@ -1 +1 @@
72c85fd191a460bad69926024d76b18db55d381b
0f5e556bb8778a2da8930bc81d0ed21f08c14b80