mirror of
https://github.com/pezkuwichain/revive.git
synced 2026-06-14 13:21:04 +00:00
call and create set uncapped resource limits (#161)
- polkadot-sdk#6890 companion - Adjust the gas price constant for the required polkadot-sdk version as a drive-by
This commit is contained in:
Generated
+378
-380
File diff suppressed because it is too large
Load Diff
+1
-1
@@ -78,7 +78,7 @@ assert_fs = "1.1.2"
|
|||||||
# polkadot-sdk and friends
|
# polkadot-sdk and friends
|
||||||
codec = { version = "3.6.12", default-features = false, package = "parity-scale-codec" }
|
codec = { version = "3.6.12", default-features = false, package = "parity-scale-codec" }
|
||||||
scale-info = { version = "2.11.1", default-features = false }
|
scale-info = { version = "2.11.1", default-features = false }
|
||||||
polkadot-sdk = { git = "https://github.com/paritytech/polkadot-sdk", rev = "243b751abbb94369bbd92c83d8ab159ddfc3c556" }
|
polkadot-sdk = { git = "https://github.com/paritytech/polkadot-sdk", rev = "cb0d8544dc8828c7b5e7f6a5fc20ce8c6ef9bbb4" }
|
||||||
|
|
||||||
# llvm
|
# llvm
|
||||||
[workspace.dependencies.inkwell]
|
[workspace.dependencies.inkwell]
|
||||||
|
|||||||
@@ -26,6 +26,6 @@ pragma solidity ^0.8;
|
|||||||
|
|
||||||
contract GasPrice {
|
contract GasPrice {
|
||||||
constructor() payable {
|
constructor() payable {
|
||||||
assert(tx.gasprice == 1);
|
assert(tx.gasprice == 1000);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -48,6 +48,9 @@ where
|
|||||||
let output_length_pointer = context.build_alloca_at_entry(context.xlen_type(), "output_length");
|
let output_length_pointer = context.build_alloca_at_entry(context.xlen_type(), "output_length");
|
||||||
context.build_store(output_length_pointer, output_length)?;
|
context.build_store(output_length_pointer, output_length)?;
|
||||||
|
|
||||||
|
let deposit_pointer = context.build_alloca_at_entry(context.word_type(), "deposit_pointer");
|
||||||
|
context.build_store(deposit_pointer, context.word_type().const_all_ones())?;
|
||||||
|
|
||||||
let flags = if static_call {
|
let flags = if static_call {
|
||||||
REENTRANT_CALL_FLAG | STATIC_CALL_FLAG
|
REENTRANT_CALL_FLAG | STATIC_CALL_FLAG
|
||||||
} else {
|
} else {
|
||||||
@@ -60,9 +63,13 @@ where
|
|||||||
let arguments = &[
|
let arguments = &[
|
||||||
flags.as_basic_value_enum(),
|
flags.as_basic_value_enum(),
|
||||||
address_pointer.value.as_basic_value_enum(),
|
address_pointer.value.as_basic_value_enum(),
|
||||||
context.integer_const(64, u64::MAX).as_basic_value_enum(),
|
context
|
||||||
context.integer_const(64, u64::MAX).as_basic_value_enum(),
|
.integer_const(revive_common::BIT_LENGTH_X64, u64::MAX)
|
||||||
context.sentinel_pointer().value.as_basic_value_enum(),
|
.as_basic_value_enum(),
|
||||||
|
context
|
||||||
|
.integer_const(revive_common::BIT_LENGTH_X64, u64::MAX)
|
||||||
|
.as_basic_value_enum(),
|
||||||
|
deposit_pointer.value.as_basic_value_enum(),
|
||||||
value_pointer.value.as_basic_value_enum(),
|
value_pointer.value.as_basic_value_enum(),
|
||||||
input_pointer.value.as_basic_value_enum(),
|
input_pointer.value.as_basic_value_enum(),
|
||||||
input_length.as_basic_value_enum(),
|
input_length.as_basic_value_enum(),
|
||||||
@@ -132,6 +139,9 @@ where
|
|||||||
let output_length_pointer = context.build_alloca_at_entry(context.xlen_type(), "output_length");
|
let output_length_pointer = context.build_alloca_at_entry(context.xlen_type(), "output_length");
|
||||||
context.build_store(output_length_pointer, output_length)?;
|
context.build_store(output_length_pointer, output_length)?;
|
||||||
|
|
||||||
|
let deposit_pointer = context.build_alloca_at_entry(context.word_type(), "deposit_pointer");
|
||||||
|
context.build_store(deposit_pointer, context.word_type().const_all_ones())?;
|
||||||
|
|
||||||
let flags = context.xlen_type().const_int(0u64, false);
|
let flags = context.xlen_type().const_int(0u64, false);
|
||||||
|
|
||||||
let argument_type = revive_runtime_api::calling_convention::delegate_call(context.llvm());
|
let argument_type = revive_runtime_api::calling_convention::delegate_call(context.llvm());
|
||||||
@@ -145,7 +155,7 @@ where
|
|||||||
context
|
context
|
||||||
.integer_const(revive_common::BIT_LENGTH_X64, u64::MAX)
|
.integer_const(revive_common::BIT_LENGTH_X64, u64::MAX)
|
||||||
.as_basic_value_enum(),
|
.as_basic_value_enum(),
|
||||||
context.sentinel_pointer().value.as_basic_value_enum(),
|
deposit_pointer.value.as_basic_value_enum(),
|
||||||
input_pointer.value.as_basic_value_enum(),
|
input_pointer.value.as_basic_value_enum(),
|
||||||
input_length.as_basic_value_enum(),
|
input_length.as_basic_value_enum(),
|
||||||
output_pointer.value.as_basic_value_enum(),
|
output_pointer.value.as_basic_value_enum(),
|
||||||
|
|||||||
@@ -53,13 +53,20 @@ where
|
|||||||
);
|
);
|
||||||
context.build_store(address_pointer, context.word_const(0))?;
|
context.build_store(address_pointer, context.word_const(0))?;
|
||||||
|
|
||||||
|
let deposit_pointer = context.build_alloca_at_entry(context.word_type(), "deposit_pointer");
|
||||||
|
context.build_store(deposit_pointer, context.word_type().const_all_ones())?;
|
||||||
|
|
||||||
let argument_type = revive_runtime_api::calling_convention::instantiate(context.llvm());
|
let argument_type = revive_runtime_api::calling_convention::instantiate(context.llvm());
|
||||||
let argument_pointer = context.build_alloca_at_entry(argument_type, "instantiate_arguments");
|
let argument_pointer = context.build_alloca_at_entry(argument_type, "instantiate_arguments");
|
||||||
let arguments = &[
|
let arguments = &[
|
||||||
code_hash_pointer.value.as_basic_value_enum(),
|
code_hash_pointer.value.as_basic_value_enum(),
|
||||||
context.integer_const(64, 0).as_basic_value_enum(),
|
context
|
||||||
context.integer_const(64, 0).as_basic_value_enum(),
|
.integer_const(revive_common::BIT_LENGTH_X64, u64::MAX)
|
||||||
context.sentinel_pointer().value.as_basic_value_enum(),
|
.as_basic_value_enum(),
|
||||||
|
context
|
||||||
|
.integer_const(revive_common::BIT_LENGTH_X64, u64::MAX)
|
||||||
|
.as_basic_value_enum(),
|
||||||
|
deposit_pointer.value.as_basic_value_enum(),
|
||||||
value_pointer.value.as_basic_value_enum(),
|
value_pointer.value.as_basic_value_enum(),
|
||||||
input_data_pointer.value.as_basic_value_enum(),
|
input_data_pointer.value.as_basic_value_enum(),
|
||||||
input_length.as_basic_value_enum(),
|
input_length.as_basic_value_enum(),
|
||||||
|
|||||||
Reference in New Issue
Block a user