-
Couldn't load subscription status.
- Fork 227
[VM2] Support authorization keys #5326
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
Merged
Merged
Changes from 6 commits
Commits
Show all changes
11 commits
Select commit
Hold shift + click to select a range
6d69038
carry authorization keys to vm2
igor-casper a8110e0
fix compile error
igor-casper 5920040
propagate keys to backend
igor-casper 4671478
fmt
igor-casper 783007e
fix tests
igor-casper d1776d3
fix regression test
igor-casper 3a9bae8
Merge branch 'feat-2.1' into core-217
igor-casper 5560807
address cr comments
igor-casper a812cba
fmt
igor-casper 6b807ac
Merge branch 'feat-2.1' into core-217
igor-casper 291446d
Merge branch 'feat-2.1' into core-217
igor-casper File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -379,6 +379,7 @@ impl ExecutorV2 { | |
| .with_parent_block_hash(parent_block_hash) | ||
| .with_block_height(block_height) | ||
| .with_runtime_native_config(runtime_native_config) | ||
| .with_authorization_keys(BTreeSet::from_iter([initiator])) | ||
| .build() | ||
| .map_err(InstallContractError::FailedBuildingExecuteRequest)?; | ||
|
|
||
|
|
@@ -499,6 +500,7 @@ impl ExecutorV2 { | |
| block_height, | ||
| sandboxed, | ||
| runtime_native_config, | ||
| authorization_keys, | ||
| } = execute_request; | ||
|
|
||
| let (entity_addr, source_purse) = get_purse_for_entity(&mut tracking_copy, caller_key)?; | ||
|
|
@@ -577,6 +579,7 @@ impl ExecutorV2 { | |
| block_info, | ||
| transaction_hash, | ||
| gas_limit, | ||
| authorization_keys.clone(), | ||
| ); | ||
| } | ||
| EntityKind::SmartContract(ContractRuntimeTag::VmCasperV2) => { | ||
|
|
@@ -686,6 +689,7 @@ impl ExecutorV2 { | |
| block_info, | ||
| transaction_hash, | ||
| gas_limit, | ||
| authorization_keys, | ||
| ); | ||
| } | ||
| Some(stored_value) => { | ||
|
|
@@ -752,6 +756,7 @@ impl ExecutorV2 { | |
| runtime_native_config, | ||
| parent_block_hash: parent_block_hash.inner().value(), | ||
| block_height, | ||
| authorization_keys, | ||
| }; | ||
|
|
||
| // Check that the input argument size does not exceed the VM memory limit | ||
|
|
@@ -887,11 +892,16 @@ impl ExecutorV2 { | |
| block_info: BlockInfo, | ||
| transaction_hash: TransactionHash, | ||
| gas_limit: u64, | ||
| authorization_keys: BTreeSet<AccountHash>, | ||
| ) -> Result<ExecuteResult, ExecuteError> | ||
| where | ||
| R: GlobalStateReader + 'static, | ||
| { | ||
| let authorization_keys = BTreeSet::from_iter([initiator]); | ||
| let authorization_keys = if authorization_keys.is_empty() { | ||
| BTreeSet::from_iter([initiator]) | ||
| } else { | ||
| authorization_keys | ||
| }; | ||
|
||
| let initiator_addr = InitiatorAddr::AccountHash(initiator); | ||
| let executable_item = | ||
| ExecutableItem::Invocation(TransactionInvocationTarget::ByHash(entity_addr.value())); | ||
|
|
@@ -1112,6 +1122,7 @@ impl Executor for ExecutorV2 { | |
| .with_block_height(request.block_height) | ||
| .with_sandboxed(true) // Enable sandboxed mode | ||
| .with_runtime_native_config(runtime_native_config) | ||
| .with_authorization_keys(BTreeSet::from_iter([request.initiator])) | ||
| .build() | ||
| .map_err(|error| { | ||
| ExecuteError::InternalHost(InternalHostError::ExecuteRequestBuildFailure(error)) | ||
|
|
||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You should also support authorization keys in the installer