-
Notifications
You must be signed in to change notification settings - Fork 20
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
runtime/consensus: Add support for querying round roots
- Loading branch information
Showing
14 changed files
with
218 additions
and
15 deletions.
There are no files selected for viewing
This file contains 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 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 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 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 |
---|---|---|
@@ -0,0 +1,28 @@ | ||
use oasis_core_runtime::common::namespace::Namespace; | ||
|
||
/// Kind of root. | ||
#[derive(Clone, Debug, Default, cbor::Encode, cbor::Decode)] | ||
#[cfg_attr(test, derive(PartialEq, Eq))] | ||
#[repr(u8)] | ||
pub enum RootKind { | ||
#[default] | ||
Invalid = 0, | ||
State = 1, | ||
IO = 2, | ||
} | ||
|
||
impl RootKind { | ||
/// Whether the root kind is valid. | ||
pub fn is_valid(&self) -> bool { | ||
!matches!(self, Self::Invalid) | ||
} | ||
} | ||
|
||
/// Internal round root call body. | ||
#[derive(Clone, Debug, Default, cbor::Encode, cbor::Decode)] | ||
#[cfg_attr(test, derive(PartialEq, Eq))] | ||
pub struct RoundRootBody { | ||
pub runtime_id: Namespace, | ||
pub round: u64, | ||
pub kind: RootKind, | ||
} |
This file contains 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 |
---|---|---|
@@ -0,0 +1,2 @@ | ||
{ | ||
} |
This file contains 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 |
---|---|---|
@@ -1 +1 @@ | ||
[{"inputs":[{"internalType":"uint64","name":"code","type":"uint64"},{"internalType":"bytes","name":"module","type":"bytes"}],"name":"SubcallFailed","type":"error"},{"inputs":[{"internalType":"bytes","name":"method","type":"bytes"},{"internalType":"bytes","name":"body","type":"bytes"}],"name":"test","outputs":[{"internalType":"bytes","name":"","type":"bytes"}],"stateMutability":"payable","type":"function"},{"inputs":[{"internalType":"bytes","name":"method","type":"bytes"},{"internalType":"bytes","name":"body","type":"bytes"}],"name":"test_delegatecall","outputs":[{"internalType":"bytes","name":"","type":"bytes"}],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"bytes","name":"method","type":"bytes"},{"internalType":"bytes","name":"body","type":"bytes"}],"name":"test_spin","outputs":[{"internalType":"bytes","name":"","type":"bytes"}],"stateMutability":"nonpayable","type":"function"}] | ||
[{"inputs":[{"internalType":"uint64","name":"code","type":"uint64"},{"internalType":"bytes","name":"module","type":"bytes"}],"name":"SubcallFailed","type":"error"},{"inputs":[{"internalType":"bytes","name":"method","type":"bytes"},{"internalType":"bytes","name":"body","type":"bytes"}],"name":"test","outputs":[{"internalType":"bytes","name":"","type":"bytes"}],"stateMutability":"payable","type":"function"},{"inputs":[],"name":"test_consensus_round_root","outputs":[{"internalType":"bytes","name":"","type":"bytes"}],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"bytes","name":"method","type":"bytes"},{"internalType":"bytes","name":"body","type":"bytes"}],"name":"test_delegatecall","outputs":[{"internalType":"bytes","name":"","type":"bytes"}],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"bytes","name":"method","type":"bytes"},{"internalType":"bytes","name":"body","type":"bytes"}],"name":"test_spin","outputs":[{"internalType":"bytes","name":"","type":"bytes"}],"stateMutability":"nonpayable","type":"function"}] |
This file contains 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 |
---|---|---|
@@ -1 +1 @@ | ||
608060405234801561000f575f80fd5b5061062e8061001d5f395ff3fe608060405260043610610033575f3560e01c80630c5561a61461003757806323bfb16a1461006057806350d82f381461007f575b5f80fd5b61004a610045366004610377565b61009e565b604051610057919061042b565b60405180910390f35b34801561006b575f80fd5b5061004a61007a366004610377565b610162565b34801561008a575f80fd5b5061004a610099366004610377565b610212565b60605f80610103600160981b016001600160a01b0316878787876040516020016100cb9493929190610465565b60408051601f19818403018152908290526100e59161048b565b5f604051808303815f865af19150503d805f811461011e576040519150601f19603f3d011682016040523d82523d5f602084013e610123565b606091505b50915091508161014e5760405162461bcd60e51b8152600401610145906104a6565b60405180910390fd5b610157816102e1565b979650505050505050565b60605f80610103600160981b016001600160a01b03168787878760405160200161018f9493929190610465565b60408051601f19818403018152908290526101a99161048b565b5f60405180830381855af49150503d805f81146101e1576040519150601f19603f3d011682016040523d82523d5f602084013e6101e6565b606091505b5091509150816102085760405162461bcd60e51b8152600401610145906104a6565b9695505050505050565b60605f80610103600160981b016001600160a01b03168787878760405160200161023f9493929190610465565b60408051601f19818403018152908290526102599161048b565b5f604051808303815f865af19150503d805f8114610292576040519150601f19603f3d011682016040523d82523d5f602084013e610297565b606091505b5091509150816102b95760405162461bcd60e51b8152600401610145906104a6565b5f5b60648112156102d657806102ce816104ce565b9150506102bb565b509695505050505050565b60605f80838060200190518101906102f9919061050c565b915091508167ffffffffffffffff165f1461032b57818160405163575a7c4d60e01b81526004016101459291906105ce565b9392505050565b5f8083601f840112610342575f80fd5b50813567ffffffffffffffff811115610359575f80fd5b602083019150836020828501011115610370575f80fd5b9250929050565b5f805f806040858703121561038a575f80fd5b843567ffffffffffffffff808211156103a1575f80fd5b6103ad88838901610332565b909650945060208701359150808211156103c5575f80fd5b506103d287828801610332565b95989497509550505050565b5f5b838110156103f85781810151838201526020016103e0565b50505f910152565b5f81518084526104178160208601602086016103de565b601f01601f19169290920160200192915050565b602081525f61032b6020830184610400565b81835281816020850137505f828201602090810191909152601f909101601f19169091010190565b604081525f61047860408301868861043d565b828103602084015261015781858761043d565b5f825161049c8184602087016103de565b9190910192915050565b6020808252600e908201526d1cdd5898d85b1b0819985a5b195960921b604082015260600190565b5f6001600160ff1b0182016104f157634e487b7160e01b5f52601160045260245ffd5b5060010190565b634e487b7160e01b5f52604160045260245ffd5b5f806040838503121561051d575f80fd5b825167ffffffffffffffff8082168214610535575f80fd5b602085015191935080821115610549575f80fd5b818501915085601f83011261055c575f80fd5b81518181111561056e5761056e6104f8565b604051601f8201601f19908116603f01168101908382118183101715610596576105966104f8565b816040528281528860208487010111156105ae575f80fd5b6105bf8360208301602088016103de565b80955050505050509250929050565b67ffffffffffffffff83168152604060208201525f6105f06040830184610400565b94935050505056fea26469706673582212202369658d710f3f71613ae8645e6c9ac9e88e7736389b455e83675353c8aed56664736f6c63430008150033 | ||
608060405234801561000f575f80fd5b506108308061001d5f395ff3fe60806040526004361061003e575f3560e01c80630c5561a61461004257806323bfb16a1461006b57806350d82f381461008a578063c7391861146100a9575b5f80fd5b61005561005036600461057e565b6100bd565b6040516100629190610632565b60405180910390f35b348015610076575f80fd5b5061005561008536600461057e565b610181565b348015610095575f80fd5b506100556100a436600461057e565b610231565b3480156100b4575f80fd5b506100556102f6565b60605f80610103600160981b016001600160a01b0316878787876040516020016100ea949392919061066c565b60408051601f198184030181529082905261010491610692565b5f604051808303815f865af19150503d805f811461013d576040519150601f19603f3d011682016040523d82523d5f602084013e610142565b606091505b50915091508161016d5760405162461bcd60e51b8152600401610164906106ad565b60405180910390fd5b610176816104e8565b979650505050505050565b60605f80610103600160981b016001600160a01b0316878787876040516020016101ae949392919061066c565b60408051601f19818403018152908290526101c891610692565b5f60405180830381855af49150503d805f8114610200576040519150601f19603f3d011682016040523d82523d5f602084013e610205565b606091505b5091509150816102275760405162461bcd60e51b8152600401610164906106ad565b9695505050505050565b60605f80610103600160981b016001600160a01b03168787878760405160200161025e949392919061066c565b60408051601f198184030181529082905261027891610692565b5f604051808303815f865af19150503d805f81146102b1576040519150601f19603f3d011682016040523d82523d5f602084013e6102b6565b606091505b5091509150816102d85760405162461bcd60e51b8152600401610164906106ad565b5f5b60648112156102eb576001016102da565b509695505050505050565b604080518082018252601381527218dbdb9cd95b9cdd5ccb949bdd5b99149bdbdd606a1b602080830191909152915160a360f81b92810192909252601960fa1b6021830152631ada5b9960e21b6022830152600160f81b6026830152606560f81b6027830152641c9bdd5b9960da1b6028830152600160f91b602d830152603560f91b602e830152691c9d5b9d1a5b5957da5960b21b602f830152600b60fb1b6039830152600160fd1b603a830152600160ff1b603b8301526060915f918291610103600160981b019190605b0160408051601f19818403018152908290526103e292916020016106d5565b60408051601f19818403018152908290526103fc91610692565b5f604051808303815f865af19150503d805f8114610435576040519150601f19603f3d011682016040523d82523d5f602084013e61043a565b606091505b5091509150816104985760405162461bcd60e51b815260206004820152602360248201527f636f6e73656e73757320726f756e6420726f6f742073756263616c6c206661696044820152621b195960ea1b6064820152608401610164565b5f80828060200190518101906104ae9190610716565b915091508167ffffffffffffffff165f146104e057818160405163575a7c4d60e01b81526004016101649291906107d8565b949350505050565b60605f80838060200190518101906105009190610716565b915091508167ffffffffffffffff165f1461053257818160405163575a7c4d60e01b81526004016101649291906107d8565b9392505050565b5f8083601f840112610549575f80fd5b50813567ffffffffffffffff811115610560575f80fd5b602083019150836020828501011115610577575f80fd5b9250929050565b5f805f8060408587031215610591575f80fd5b843567ffffffffffffffff808211156105a8575f80fd5b6105b488838901610539565b909650945060208701359150808211156105cc575f80fd5b506105d987828801610539565b95989497509550505050565b5f5b838110156105ff5781810151838201526020016105e7565b50505f910152565b5f815180845261061e8160208601602086016105e5565b601f01601f19169290920160200192915050565b602081525f6105326020830184610607565b81835281816020850137505f828201602090810191909152601f909101601f19169091010190565b604081525f61067f604083018688610644565b8281036020840152610176818587610644565b5f82516106a38184602087016105e5565b9190910192915050565b6020808252600e908201526d1cdd5898d85b1b0819985a5b195960921b604082015260600190565b604081525f6106e76040830185610607565b82810360208401526106f98185610607565b95945050505050565b634e487b7160e01b5f52604160045260245ffd5b5f8060408385031215610727575f80fd5b825167ffffffffffffffff808216821461073f575f80fd5b602085015191935080821115610753575f80fd5b818501915085601f830112610766575f80fd5b81518181111561077857610778610702565b604051601f8201601f19908116603f011681019083821181831017156107a0576107a0610702565b816040528281528860208487010111156107b8575f80fd5b6107c98360208301602088016105e5565b80955050505050509250929050565b67ffffffffffffffff83168152604060208201525f6104e0604083018461060756fea264697066735822122029a34c1a7cda70295558c88edd184a88d6c65683f77f25fde5fae8ad4f1f735864736f6c63430008170033 |
This file contains 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
Oops, something went wrong.