libra_client 0.1.7 → 0.2.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/Gemfile.lock +5 -5
- data/lib/libra/account_resource.rb +3 -24
- data/lib/libra/version.rb +1 -1
- data/libra_client.gemspec +1 -1
- data/proto-lib/consensus_pb.rb +6 -7
- data/proto-lib/ledger_info_pb.rb +2 -0
- data/proto-lib/mempool_pb.rb +48 -5
- data/proto-lib/node_debug_interface_pb.rb +0 -7
- data/proto-lib/node_debug_interface_services_pb.rb +0 -2
- data/proto-lib/storage_pb.rb +8 -0
- data/proto-lib/storage_services_pb.rb +2 -0
- data/proto-lib/transaction_info_pb.rb +1 -0
- data/proto-lib/transaction_pb.rb +2 -49
- data/proto-lib/vm_errors_pb.rb +5 -213
- data/protos/consensus.proto +7 -8
- data/protos/ledger_info.proto +6 -0
- data/protos/mempool.proto +96 -9
- data/protos/node_debug_interface.proto +0 -11
- data/protos/storage.proto +14 -0
- data/protos/transaction.proto +4 -84
- data/protos/transaction_info.proto +3 -0
- data/protos/vm_errors.proto +7 -264
- metadata +5 -5
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 2c8d3f56fb64563e73ec6437bbf9a8efc784cda313807d79d11b28504ae4b452
|
4
|
+
data.tar.gz: c38ec316dd0afea81364efa5a24a3adfe6622d73c6d6af6632bbec17127d6a23
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: a9187bcbc157d55abba5f71368bae68978e08d807a90ae34a2e01391f0dace0437223a1a03c47fc1234488477253d0f34c027d484b1601f152699669579ebc91
|
7
|
+
data.tar.gz: 0a874fa45d88a56c0dd5acfe0fb0b9dcf3dd707b0b2c9186e0373e816441fbe0f769d0e1e8452e4aef8f74b7fbce9525fda4ba9d20d7c1c48a41d66457e5317b
|
data/Gemfile.lock
CHANGED
@@ -1,8 +1,8 @@
|
|
1
1
|
PATH
|
2
2
|
remote: .
|
3
3
|
specs:
|
4
|
-
libra_client (0.
|
5
|
-
canoser (~> 0.1
|
4
|
+
libra_client (0.2.0)
|
5
|
+
canoser (~> 0.2.1)
|
6
6
|
grpc (~> 1.23)
|
7
7
|
rest-client (~> 2.0)
|
8
8
|
|
@@ -10,13 +10,13 @@ GEM
|
|
10
10
|
remote: https://rubygems.org/
|
11
11
|
specs:
|
12
12
|
byebug (11.0.1)
|
13
|
-
canoser (0.1
|
13
|
+
canoser (0.2.1)
|
14
14
|
domain_name (0.5.20190701)
|
15
15
|
unf (>= 0.0.5, < 1.0.0)
|
16
|
-
google-protobuf (3.9.
|
16
|
+
google-protobuf (3.9.2-x86_64-linux)
|
17
17
|
googleapis-common-protos-types (1.0.4)
|
18
18
|
google-protobuf (~> 3.0)
|
19
|
-
grpc (1.
|
19
|
+
grpc (1.24.0-x86_64-linux)
|
20
20
|
google-protobuf (~> 3.8)
|
21
21
|
googleapis-common-protos-types (~> 1.0)
|
22
22
|
grpc-tools (1.23.0)
|
@@ -1,7 +1,7 @@
|
|
1
1
|
|
2
2
|
module Libra
|
3
3
|
class AccountState < Canoser::Struct
|
4
|
-
define_field :blob, {}
|
4
|
+
define_field :blob, {}
|
5
5
|
end
|
6
6
|
|
7
7
|
EVENT_KEY_LENGTH = 32
|
@@ -11,35 +11,14 @@ module Libra
|
|
11
11
|
define_field :key, [Canoser::Uint8] #EVENT_KEY_LENGTH
|
12
12
|
end
|
13
13
|
|
14
|
-
# pub struct AccountResource {
|
15
|
-
# balance: u64,
|
16
|
-
# sequence_number: u64,
|
17
|
-
# authentication_key: ByteArray,
|
18
|
-
# delegated_withdrawal_capability: bool,
|
19
|
-
# sent_events: EventHandle,
|
20
|
-
# received_events: EventHandle,
|
21
|
-
# }
|
22
14
|
|
23
|
-
# impl CanonicalSerialize for AccountResource {
|
24
|
-
# fn serialize(&self, serializer: &mut impl CanonicalSerializer) -> Result<()> {
|
25
|
-
# // TODO(drussi): the order in which these fields are serialized depends on some
|
26
|
-
# // implementation details in the VM.
|
27
|
-
# serializer
|
28
|
-
# .encode_struct(&self.authentication_key)?
|
29
|
-
# .encode_u64(self.balance)?
|
30
|
-
# .encode_bool(self.delegated_withdrawal_capability)?
|
31
|
-
# .encode_struct(&self.received_events)?
|
32
|
-
# .encode_struct(&self.sent_events)?
|
33
|
-
# .encode_u64(self.sequence_number)?;
|
34
|
-
# Ok(())
|
35
|
-
# }
|
36
|
-
# }
|
37
15
|
class AccountResource < Canoser::Struct
|
38
16
|
define_field :authentication_key, [Canoser::Uint8]
|
39
17
|
define_field :balance, Canoser::Uint64
|
18
|
+
define_field :delegated_key_rotation_capability, Canoser::Bool
|
40
19
|
define_field :delegated_withdrawal_capability, Canoser::Bool
|
41
20
|
define_field :received_events, EventHandle
|
42
21
|
define_field :sent_events, EventHandle
|
43
22
|
define_field :sequence_number, Canoser::Uint64
|
44
|
-
end
|
23
|
+
end
|
45
24
|
end
|
data/lib/libra/version.rb
CHANGED
data/libra_client.gemspec
CHANGED
@@ -43,7 +43,7 @@ Gem::Specification.new do |spec|
|
|
43
43
|
spec.add_development_dependency "grpc-tools", "~> 1.23"
|
44
44
|
|
45
45
|
spec.add_dependency "grpc", "~> 1.23"
|
46
|
-
spec.add_dependency "canoser", "~> 0.1
|
46
|
+
spec.add_dependency "canoser", "~> 0.2.1"
|
47
47
|
spec.add_dependency "rest-client", "~> 2.0"
|
48
48
|
#spec.add_dependency "openssl", "~> 3.0.0" #not ready, need SHA3 support.
|
49
49
|
|
data/proto-lib/consensus_pb.rb
CHANGED
@@ -58,13 +58,12 @@ Google::Protobuf::DescriptorPool.generated_pool.build do
|
|
58
58
|
end
|
59
59
|
add_message "network.VoteData" do
|
60
60
|
optional :block_id, :bytes, 1
|
61
|
-
optional :
|
62
|
-
optional :
|
63
|
-
optional :
|
64
|
-
optional :
|
65
|
-
optional :
|
66
|
-
optional :
|
67
|
-
optional :grandparent_block_round, :uint64, 8
|
61
|
+
optional :executed_state_id, :bytes, 2
|
62
|
+
optional :round, :uint64, 3
|
63
|
+
optional :parent_block_id, :bytes, 4
|
64
|
+
optional :parent_block_round, :uint64, 5
|
65
|
+
optional :grandparent_block_id, :bytes, 6
|
66
|
+
optional :grandparent_block_round, :uint64, 7
|
68
67
|
end
|
69
68
|
add_message "network.Vote" do
|
70
69
|
optional :vote_data, :message, 1, "network.VoteData"
|
data/proto-lib/ledger_info_pb.rb
CHANGED
@@ -3,6 +3,7 @@
|
|
3
3
|
|
4
4
|
require 'google/protobuf'
|
5
5
|
|
6
|
+
require 'validator_set_pb'
|
6
7
|
Google::Protobuf::DescriptorPool.generated_pool.build do
|
7
8
|
add_file("ledger_info.proto", :syntax => :proto3) do
|
8
9
|
add_message "types.LedgerInfo" do
|
@@ -12,6 +13,7 @@ Google::Protobuf::DescriptorPool.generated_pool.build do
|
|
12
13
|
optional :consensus_block_id, :bytes, 4
|
13
14
|
optional :epoch_num, :uint64, 5
|
14
15
|
optional :timestamp_usecs, :uint64, 6
|
16
|
+
optional :next_validator_set, :message, 7, "types.ValidatorSet"
|
15
17
|
end
|
16
18
|
add_message "types.LedgerInfoWithSignatures" do
|
17
19
|
repeated :signatures, :message, 1, "types.ValidatorSignature"
|
data/proto-lib/mempool_pb.rb
CHANGED
@@ -4,15 +4,58 @@
|
|
4
4
|
require 'google/protobuf'
|
5
5
|
|
6
6
|
require 'transaction_pb'
|
7
|
+
require 'mempool_status_pb'
|
7
8
|
Google::Protobuf::DescriptorPool.generated_pool.build do
|
8
9
|
add_file("mempool.proto", :syntax => :proto3) do
|
9
|
-
add_message "
|
10
|
-
optional :
|
11
|
-
|
10
|
+
add_message "mempool.AddTransactionWithValidationRequest" do
|
11
|
+
optional :signed_txn, :message, 1, "types.SignedTransaction"
|
12
|
+
optional :max_gas_cost, :uint64, 2
|
13
|
+
optional :latest_sequence_number, :uint64, 3
|
14
|
+
optional :account_balance, :uint64, 4
|
15
|
+
end
|
16
|
+
add_message "mempool.AddTransactionWithValidationResponse" do
|
17
|
+
optional :current_version, :uint64, 1
|
18
|
+
optional :status, :message, 2, "mempool.MempoolAddTransactionStatus"
|
19
|
+
end
|
20
|
+
add_message "mempool.GetBlockRequest" do
|
21
|
+
optional :max_block_size, :uint64, 1
|
22
|
+
repeated :transactions, :message, 2, "mempool.TransactionExclusion"
|
23
|
+
end
|
24
|
+
add_message "mempool.GetBlockResponse" do
|
25
|
+
optional :block, :message, 1, "types.SignedTransactionsBlock"
|
26
|
+
end
|
27
|
+
add_message "mempool.TransactionExclusion" do
|
28
|
+
optional :sender, :bytes, 1
|
29
|
+
optional :sequence_number, :uint64, 2
|
30
|
+
end
|
31
|
+
add_message "mempool.CommitTransactionsRequest" do
|
32
|
+
repeated :transactions, :message, 1, "mempool.CommittedTransaction"
|
33
|
+
optional :block_timestamp_usecs, :uint64, 2
|
34
|
+
end
|
35
|
+
add_message "mempool.CommitTransactionsResponse" do
|
36
|
+
end
|
37
|
+
add_message "mempool.CommittedTransaction" do
|
38
|
+
optional :sender, :bytes, 1
|
39
|
+
optional :sequence_number, :uint64, 2
|
40
|
+
optional :is_rejected, :bool, 3
|
41
|
+
end
|
42
|
+
add_message "mempool.HealthCheckRequest" do
|
43
|
+
end
|
44
|
+
add_message "mempool.HealthCheckResponse" do
|
45
|
+
optional :is_healthy, :bool, 1
|
12
46
|
end
|
13
47
|
end
|
14
48
|
end
|
15
49
|
|
16
|
-
module
|
17
|
-
|
50
|
+
module Mempool
|
51
|
+
AddTransactionWithValidationRequest = Google::Protobuf::DescriptorPool.generated_pool.lookup("mempool.AddTransactionWithValidationRequest").msgclass
|
52
|
+
AddTransactionWithValidationResponse = Google::Protobuf::DescriptorPool.generated_pool.lookup("mempool.AddTransactionWithValidationResponse").msgclass
|
53
|
+
GetBlockRequest = Google::Protobuf::DescriptorPool.generated_pool.lookup("mempool.GetBlockRequest").msgclass
|
54
|
+
GetBlockResponse = Google::Protobuf::DescriptorPool.generated_pool.lookup("mempool.GetBlockResponse").msgclass
|
55
|
+
TransactionExclusion = Google::Protobuf::DescriptorPool.generated_pool.lookup("mempool.TransactionExclusion").msgclass
|
56
|
+
CommitTransactionsRequest = Google::Protobuf::DescriptorPool.generated_pool.lookup("mempool.CommitTransactionsRequest").msgclass
|
57
|
+
CommitTransactionsResponse = Google::Protobuf::DescriptorPool.generated_pool.lookup("mempool.CommitTransactionsResponse").msgclass
|
58
|
+
CommittedTransaction = Google::Protobuf::DescriptorPool.generated_pool.lookup("mempool.CommittedTransaction").msgclass
|
59
|
+
HealthCheckRequest = Google::Protobuf::DescriptorPool.generated_pool.lookup("mempool.HealthCheckRequest").msgclass
|
60
|
+
HealthCheckResponse = Google::Protobuf::DescriptorPool.generated_pool.lookup("mempool.HealthCheckResponse").msgclass
|
18
61
|
end
|
@@ -20,11 +20,6 @@ Google::Protobuf::DescriptorPool.generated_pool.build do
|
|
20
20
|
optional :timestamp, :int64, 2
|
21
21
|
optional :json, :string, 3
|
22
22
|
end
|
23
|
-
add_message "debug.DumpJemallocHeapProfileRequest" do
|
24
|
-
end
|
25
|
-
add_message "debug.DumpJemallocHeapProfileResponse" do
|
26
|
-
optional :status_code, :int32, 1
|
27
|
-
end
|
28
23
|
end
|
29
24
|
end
|
30
25
|
|
@@ -34,6 +29,4 @@ module Debug
|
|
34
29
|
GetEventsRequest = Google::Protobuf::DescriptorPool.generated_pool.lookup("debug.GetEventsRequest").msgclass
|
35
30
|
GetEventsResponse = Google::Protobuf::DescriptorPool.generated_pool.lookup("debug.GetEventsResponse").msgclass
|
36
31
|
Event = Google::Protobuf::DescriptorPool.generated_pool.lookup("debug.Event").msgclass
|
37
|
-
DumpJemallocHeapProfileRequest = Google::Protobuf::DescriptorPool.generated_pool.lookup("debug.DumpJemallocHeapProfileRequest").msgclass
|
38
|
-
DumpJemallocHeapProfileResponse = Google::Protobuf::DescriptorPool.generated_pool.lookup("debug.DumpJemallocHeapProfileResponse").msgclass
|
39
32
|
end
|
@@ -23,8 +23,6 @@ module Debug
|
|
23
23
|
rpc :GetNodeDetails, GetNodeDetailsRequest, GetNodeDetailsResponse
|
24
24
|
# Returns recent events generated by event! macro
|
25
25
|
rpc :GetEvents, GetEventsRequest, GetEventsResponse
|
26
|
-
# Triggers a dump of heap profile.
|
27
|
-
rpc :DumpJemallocHeapProfile, DumpJemallocHeapProfileRequest, DumpJemallocHeapProfileResponse
|
28
26
|
end
|
29
27
|
|
30
28
|
Stub = Service.rpc_stub_class
|
data/proto-lib/storage_pb.rb
CHANGED
@@ -45,6 +45,12 @@ Google::Protobuf::DescriptorPool.generated_pool.build do
|
|
45
45
|
optional :account_state_root_hash, :bytes, 3
|
46
46
|
repeated :ledger_frozen_subtree_hashes, :bytes, 4
|
47
47
|
end
|
48
|
+
add_message "storage.GetLatestLedgerInfosPerEpochRequest" do
|
49
|
+
optional :start_epoch, :uint64, 1
|
50
|
+
end
|
51
|
+
add_message "storage.GetLatestLedgerInfosPerEpochResponse" do
|
52
|
+
repeated :latest_ledger_infos, :message, 1, "types.LedgerInfoWithSignatures"
|
53
|
+
end
|
48
54
|
end
|
49
55
|
end
|
50
56
|
|
@@ -58,4 +64,6 @@ module Storage
|
|
58
64
|
GetStartupInfoRequest = Google::Protobuf::DescriptorPool.generated_pool.lookup("storage.GetStartupInfoRequest").msgclass
|
59
65
|
GetStartupInfoResponse = Google::Protobuf::DescriptorPool.generated_pool.lookup("storage.GetStartupInfoResponse").msgclass
|
60
66
|
StartupInfo = Google::Protobuf::DescriptorPool.generated_pool.lookup("storage.StartupInfo").msgclass
|
67
|
+
GetLatestLedgerInfosPerEpochRequest = Google::Protobuf::DescriptorPool.generated_pool.lookup("storage.GetLatestLedgerInfosPerEpochRequest").msgclass
|
68
|
+
GetLatestLedgerInfosPerEpochResponse = Google::Protobuf::DescriptorPool.generated_pool.lookup("storage.GetLatestLedgerInfosPerEpochResponse").msgclass
|
61
69
|
end
|
@@ -39,6 +39,8 @@ module Storage
|
|
39
39
|
rpc :GetAccountStateWithProofByVersion, GetAccountStateWithProofByVersionRequest, GetAccountStateWithProofByVersionResponse
|
40
40
|
# Returns information needed for libra core to start up.
|
41
41
|
rpc :GetStartupInfo, GetStartupInfoRequest, GetStartupInfoResponse
|
42
|
+
# Returns latest ledger infos per epoch.
|
43
|
+
rpc :GetLatestLedgerInfosPerEpoch, GetLatestLedgerInfosPerEpochRequest, GetLatestLedgerInfosPerEpochResponse
|
42
44
|
end
|
43
45
|
|
44
46
|
Stub = Service.rpc_stub_class
|
data/proto-lib/transaction_pb.rb
CHANGED
@@ -10,31 +10,7 @@ require 'transaction_info_pb'
|
|
10
10
|
require 'google/protobuf/wrappers_pb'
|
11
11
|
Google::Protobuf::DescriptorPool.generated_pool.build do
|
12
12
|
add_file("transaction.proto", :syntax => :proto3) do
|
13
|
-
add_message "types.RawTransaction" do
|
14
|
-
optional :sender_account, :bytes, 1
|
15
|
-
optional :sequence_number, :uint64, 2
|
16
|
-
optional :max_gas_amount, :uint64, 5
|
17
|
-
optional :gas_unit_price, :uint64, 6
|
18
|
-
optional :expiration_time, :uint64, 7
|
19
|
-
oneof :payload do
|
20
|
-
optional :program, :message, 3, "types.Program"
|
21
|
-
optional :write_set, :message, 4, "types.WriteSet"
|
22
|
-
optional :script, :message, 8, "types.Script"
|
23
|
-
optional :module, :message, 9, "types.Module"
|
24
|
-
end
|
25
|
-
end
|
26
|
-
add_message "types.Program" do
|
27
|
-
optional :code, :bytes, 1
|
28
|
-
repeated :arguments, :message, 2, "types.TransactionArgument"
|
29
|
-
repeated :modules, :bytes, 3
|
30
|
-
end
|
31
|
-
add_message "types.Script" do
|
32
|
-
optional :code, :bytes, 1
|
33
|
-
repeated :arguments, :message, 2, "types.TransactionArgument"
|
34
|
-
end
|
35
13
|
add_message "types.TransactionArgument" do
|
36
|
-
optional :type, :enum, 1, "types.TransactionArgument.ArgType"
|
37
|
-
optional :data, :bytes, 2
|
38
14
|
end
|
39
15
|
add_enum "types.TransactionArgument.ArgType" do
|
40
16
|
value :U64, 0
|
@@ -42,13 +18,8 @@ Google::Protobuf::DescriptorPool.generated_pool.build do
|
|
42
18
|
value :STRING, 2
|
43
19
|
value :BYTEARRAY, 3
|
44
20
|
end
|
45
|
-
add_message "types.Module" do
|
46
|
-
optional :code, :bytes, 1
|
47
|
-
end
|
48
21
|
add_message "types.SignedTransaction" do
|
49
|
-
optional :
|
50
|
-
optional :sender_public_key, :bytes, 2
|
51
|
-
optional :sender_signature, :bytes, 3
|
22
|
+
optional :signed_txn, :bytes, 5
|
52
23
|
end
|
53
24
|
add_message "types.SignedTransactionWithProof" do
|
54
25
|
optional :version, :uint64, 1
|
@@ -61,14 +32,6 @@ Google::Protobuf::DescriptorPool.generated_pool.build do
|
|
61
32
|
optional :validator_public_key, :bytes, 2
|
62
33
|
optional :validator_signature, :bytes, 3
|
63
34
|
end
|
64
|
-
add_message "types.WriteSet" do
|
65
|
-
repeated :write_set, :message, 1, "types.WriteOp"
|
66
|
-
end
|
67
|
-
add_message "types.WriteOp" do
|
68
|
-
optional :access_path, :message, 1, "types.AccessPath"
|
69
|
-
optional :value, :bytes, 2
|
70
|
-
optional :type, :enum, 3, "types.WriteOpType"
|
71
|
-
end
|
72
35
|
add_message "types.AccountState" do
|
73
36
|
optional :address, :bytes, 1
|
74
37
|
optional :blob, :bytes, 2
|
@@ -78,6 +41,7 @@ Google::Protobuf::DescriptorPool.generated_pool.build do
|
|
78
41
|
repeated :account_states, :message, 2, "types.AccountState"
|
79
42
|
repeated :events, :message, 3, "types.Event"
|
80
43
|
optional :gas_used, :uint64, 4
|
44
|
+
optional :major_status, :uint64, 5
|
81
45
|
end
|
82
46
|
add_message "types.TransactionListWithProof" do
|
83
47
|
repeated :transactions, :message, 1, "types.SignedTransaction"
|
@@ -87,27 +51,16 @@ Google::Protobuf::DescriptorPool.generated_pool.build do
|
|
87
51
|
optional :proof_of_first_transaction, :message, 5, "types.AccumulatorProof"
|
88
52
|
optional :proof_of_last_transaction, :message, 6, "types.AccumulatorProof"
|
89
53
|
end
|
90
|
-
add_enum "types.WriteOpType" do
|
91
|
-
value :Write, 0
|
92
|
-
value :Delete, 1
|
93
|
-
end
|
94
54
|
end
|
95
55
|
end
|
96
56
|
|
97
57
|
module Types
|
98
|
-
RawTransaction = Google::Protobuf::DescriptorPool.generated_pool.lookup("types.RawTransaction").msgclass
|
99
|
-
Program = Google::Protobuf::DescriptorPool.generated_pool.lookup("types.Program").msgclass
|
100
|
-
Script = Google::Protobuf::DescriptorPool.generated_pool.lookup("types.Script").msgclass
|
101
58
|
TransactionArgument = Google::Protobuf::DescriptorPool.generated_pool.lookup("types.TransactionArgument").msgclass
|
102
59
|
TransactionArgument::ArgType = Google::Protobuf::DescriptorPool.generated_pool.lookup("types.TransactionArgument.ArgType").enummodule
|
103
|
-
Module = Google::Protobuf::DescriptorPool.generated_pool.lookup("types.Module").msgclass
|
104
60
|
SignedTransaction = Google::Protobuf::DescriptorPool.generated_pool.lookup("types.SignedTransaction").msgclass
|
105
61
|
SignedTransactionWithProof = Google::Protobuf::DescriptorPool.generated_pool.lookup("types.SignedTransactionWithProof").msgclass
|
106
62
|
SignedTransactionsBlock = Google::Protobuf::DescriptorPool.generated_pool.lookup("types.SignedTransactionsBlock").msgclass
|
107
|
-
WriteSet = Google::Protobuf::DescriptorPool.generated_pool.lookup("types.WriteSet").msgclass
|
108
|
-
WriteOp = Google::Protobuf::DescriptorPool.generated_pool.lookup("types.WriteOp").msgclass
|
109
63
|
AccountState = Google::Protobuf::DescriptorPool.generated_pool.lookup("types.AccountState").msgclass
|
110
64
|
TransactionToCommit = Google::Protobuf::DescriptorPool.generated_pool.lookup("types.TransactionToCommit").msgclass
|
111
65
|
TransactionListWithProof = Google::Protobuf::DescriptorPool.generated_pool.lookup("types.TransactionListWithProof").msgclass
|
112
|
-
WriteOpType = Google::Protobuf::DescriptorPool.generated_pool.lookup("types.WriteOpType").enummodule
|
113
66
|
end
|
data/proto-lib/vm_errors_pb.rb
CHANGED
@@ -6,224 +6,16 @@ require 'google/protobuf'
|
|
6
6
|
require 'language_storage_pb'
|
7
7
|
Google::Protobuf::DescriptorPool.generated_pool.build do
|
8
8
|
add_file("vm_errors.proto", :syntax => :proto3) do
|
9
|
-
add_message "types.VMValidationStatus" do
|
10
|
-
optional :code, :enum, 1, "types.VMValidationStatusCode"
|
11
|
-
optional :message, :string, 2
|
12
|
-
end
|
13
|
-
add_message "types.VMVerificationStatusList" do
|
14
|
-
repeated :status_list, :message, 1, "types.VMVerificationStatus"
|
15
|
-
end
|
16
|
-
add_message "types.VMVerificationStatus" do
|
17
|
-
optional :status_kind, :enum, 1, "types.VMVerificationStatus.StatusKind"
|
18
|
-
optional :module_idx, :uint32, 2
|
19
|
-
optional :error_kind, :enum, 3, "types.VMVerificationErrorKind"
|
20
|
-
optional :message, :string, 4
|
21
|
-
optional :dependency_id, :message, 5, "types.ModuleId"
|
22
|
-
end
|
23
|
-
add_enum "types.VMVerificationStatus.StatusKind" do
|
24
|
-
value :SCRIPT, 0
|
25
|
-
value :MODULE, 1
|
26
|
-
value :DEPENDENCY, 2
|
27
|
-
end
|
28
|
-
add_message "types.Aborted" do
|
29
|
-
optional :aborted_error_code, :uint64, 1
|
30
|
-
end
|
31
|
-
add_message "types.ArithmeticError" do
|
32
|
-
optional :error_code, :enum, 1, "types.ArithmeticError.ArithmeticErrorType"
|
33
|
-
end
|
34
|
-
add_enum "types.ArithmeticError.ArithmeticErrorType" do
|
35
|
-
value :UnknownArithmeticError, 0
|
36
|
-
value :Underflow, 1
|
37
|
-
value :Overflow, 2
|
38
|
-
value :DivisionByZero, 3
|
39
|
-
end
|
40
|
-
add_message "types.DynamicReferenceError" do
|
41
|
-
optional :error_code, :enum, 1, "types.DynamicReferenceError.DynamicReferenceErrorType"
|
42
|
-
end
|
43
|
-
add_enum "types.DynamicReferenceError.DynamicReferenceErrorType" do
|
44
|
-
value :UnknownDynamicReferenceError, 0
|
45
|
-
value :MoveOfBorrowedResource, 1
|
46
|
-
value :GlobalRefAlreadyReleased, 2
|
47
|
-
value :MissingReleaseRef, 3
|
48
|
-
value :GlobalAlreadyBorrowed, 4
|
49
|
-
end
|
50
|
-
add_message "types.ExecutionStatus" do
|
51
|
-
oneof :execution_status do
|
52
|
-
optional :runtime_status, :enum, 1, "types.RuntimeStatus"
|
53
|
-
optional :aborted, :message, 2, "types.Aborted"
|
54
|
-
optional :arithmetic_error, :message, 3, "types.ArithmeticError"
|
55
|
-
optional :reference_error, :message, 4, "types.DynamicReferenceError"
|
56
|
-
end
|
57
|
-
end
|
58
9
|
add_message "types.VMStatus" do
|
59
|
-
|
60
|
-
|
61
|
-
|
62
|
-
|
63
|
-
|
64
|
-
optional :execution, :message, 5, "types.ExecutionStatus"
|
65
|
-
end
|
66
|
-
end
|
67
|
-
add_enum "types.VMValidationStatusCode" do
|
68
|
-
value :UnknownValidationStatus, 0
|
69
|
-
value :InvalidSignature, 1
|
70
|
-
value :InvalidAuthKey, 2
|
71
|
-
value :SequenceNumberTooOld, 3
|
72
|
-
value :SequenceNumberTooNew, 4
|
73
|
-
value :InsufficientBalanceForTransactionFee, 5
|
74
|
-
value :TransactionExpired, 6
|
75
|
-
value :SendingAccountDoesNotExist, 7
|
76
|
-
value :RejectedWriteSet, 8
|
77
|
-
value :InvalidWriteSet, 9
|
78
|
-
value :ExceededMaxTransactionSize, 10
|
79
|
-
value :UnknownScript, 11
|
80
|
-
value :UnknownModule, 12
|
81
|
-
value :MaxGasUnitsExceedsMaxGasUnitsBound, 13
|
82
|
-
value :MaxGasUnitsBelowMinTransactionGasUnits, 14
|
83
|
-
value :GasUnitPriceBelowMinBound, 15
|
84
|
-
value :GasUnitPriceAboveMaxBound, 16
|
85
|
-
end
|
86
|
-
add_enum "types.VMVerificationErrorKind" do
|
87
|
-
value :UnknownVerificationError, 0
|
88
|
-
value :IndexOutOfBounds, 1
|
89
|
-
value :CodeUnitIndexOutOfBounds, 2
|
90
|
-
value :RangeOutOfBounds, 3
|
91
|
-
value :InvalidSignatureToken, 4
|
92
|
-
value :InvalidFieldDefReference, 5
|
93
|
-
value :RecursiveStructDefinition, 6
|
94
|
-
value :InvalidResourceField, 7
|
95
|
-
value :InvalidFallThrough, 8
|
96
|
-
value :JoinFailure, 9
|
97
|
-
value :NegativeStackSizeWithinBlock, 10
|
98
|
-
value :UnbalancedStack, 11
|
99
|
-
value :InvalidMainFunctionSignature, 12
|
100
|
-
value :DuplicateElement, 13
|
101
|
-
value :InvalidModuleHandle, 14
|
102
|
-
value :UnimplementedHandle, 15
|
103
|
-
value :InconsistentFields, 16
|
104
|
-
value :UnusedFields, 17
|
105
|
-
value :LookupFailed, 18
|
106
|
-
value :VisibilityMismatch, 19
|
107
|
-
value :TypeResolutionFailure, 20
|
108
|
-
value :TypeMismatch, 21
|
109
|
-
value :MissingDependency, 22
|
110
|
-
value :PopReferenceError, 23
|
111
|
-
value :PopResourceError, 24
|
112
|
-
value :ReleaseRefTypeMismatchError, 25
|
113
|
-
value :BrTypeMismatchError, 26
|
114
|
-
value :AbortTypeMismatchError, 27
|
115
|
-
value :StLocTypeMismatchError, 28
|
116
|
-
value :StLocUnsafeToDestroyError, 29
|
117
|
-
value :RetUnsafeToDestroyError, 30
|
118
|
-
value :RetTypeMismatchError, 31
|
119
|
-
value :FreezeRefTypeMismatchError, 32
|
120
|
-
value :FreezeRefExistsMutableBorrowError, 33
|
121
|
-
value :BorrowFieldTypeMismatchError, 34
|
122
|
-
value :BorrowFieldBadFieldError, 35
|
123
|
-
value :BorrowFieldExistsMutableBorrowError, 36
|
124
|
-
value :CopyLocUnavailableError, 37
|
125
|
-
value :CopyLocResourceError, 38
|
126
|
-
value :CopyLocExistsBorrowError, 39
|
127
|
-
value :MoveLocUnavailableError, 40
|
128
|
-
value :MoveLocExistsBorrowError, 41
|
129
|
-
value :BorrowLocReferenceError, 42
|
130
|
-
value :BorrowLocUnavailableError, 43
|
131
|
-
value :BorrowLocExistsBorrowError, 44
|
132
|
-
value :CallTypeMismatchError, 45
|
133
|
-
value :CallBorrowedMutableReferenceError, 46
|
134
|
-
value :PackTypeMismatchError, 47
|
135
|
-
value :UnpackTypeMismatchError, 48
|
136
|
-
value :ReadRefTypeMismatchError, 49
|
137
|
-
value :ReadRefResourceError, 50
|
138
|
-
value :ReadRefExistsMutableBorrowError, 51
|
139
|
-
value :WriteRefTypeMismatchError, 52
|
140
|
-
value :WriteRefResourceError, 53
|
141
|
-
value :WriteRefExistsBorrowError, 54
|
142
|
-
value :WriteRefNoMutableReferenceError, 55
|
143
|
-
value :IntegerOpTypeMismatchError, 56
|
144
|
-
value :BooleanOpTypeMismatchError, 57
|
145
|
-
value :EqualityOpTypeMismatchError, 58
|
146
|
-
value :ExistsResourceTypeMismatchError, 59
|
147
|
-
value :ExistsNoResourceError, 60
|
148
|
-
value :BorrowGlobalTypeMismatchError, 61
|
149
|
-
value :BorrowGlobalNoResourceError, 62
|
150
|
-
value :MoveFromTypeMismatchError, 63
|
151
|
-
value :MoveFromNoResourceError, 64
|
152
|
-
value :MoveToSenderTypeMismatchError, 65
|
153
|
-
value :MoveToSenderNoResourceError, 66
|
154
|
-
value :CreateAccountTypeMismatchError, 67
|
155
|
-
value :GlobalReferenceError, 68
|
156
|
-
value :ModuleAddressDoesNotMatchSender, 69
|
157
|
-
value :NoModuleHandles, 70
|
158
|
-
value :MissingAcquiresResourceAnnotationError, 71
|
159
|
-
value :ExtraneousAcquiresResourceAnnotationError, 72
|
160
|
-
value :DuplicateAcquiresResourceAnnotationError, 73
|
161
|
-
value :InvalidAcquiresResourceAnnotationError, 74
|
162
|
-
end
|
163
|
-
add_enum "types.VMInvariantViolationError" do
|
164
|
-
value :UnknownInvariantViolationError, 0
|
165
|
-
value :OutOfBoundsIndex, 1
|
166
|
-
value :OutOfBoundsRange, 2
|
167
|
-
value :EmptyValueStack, 3
|
168
|
-
value :EmptyCallStack, 4
|
169
|
-
value :PCOverflow, 5
|
170
|
-
value :LinkerError, 6
|
171
|
-
value :LocalReferenceError, 7
|
172
|
-
value :StorageError, 8
|
173
|
-
value :InternalTypeError, 9
|
174
|
-
value :EventKeyMismatch, 10
|
175
|
-
end
|
176
|
-
add_enum "types.BinaryError" do
|
177
|
-
value :UnknownBinaryError, 0
|
178
|
-
value :Malformed, 1
|
179
|
-
value :BadMagic, 2
|
180
|
-
value :UnknownVersion, 3
|
181
|
-
value :UnknownTableType, 4
|
182
|
-
value :UnknownSignatureType, 5
|
183
|
-
value :UnknownSerializedType, 6
|
184
|
-
value :UnknownOpcode, 7
|
185
|
-
value :BadHeaderTable, 8
|
186
|
-
value :UnexpectedSignatureType, 9
|
187
|
-
value :DuplicateTable, 10
|
188
|
-
end
|
189
|
-
add_enum "types.RuntimeStatus" do
|
190
|
-
value :UnknownRuntimeStatus, 0
|
191
|
-
value :Executed, 1
|
192
|
-
value :OutOfGas, 2
|
193
|
-
value :ResourceDoesNotExist, 3
|
194
|
-
value :ResourceAlreadyExists, 4
|
195
|
-
value :EvictedAccountAccess, 5
|
196
|
-
value :AccountAddressAlreadyExists, 6
|
197
|
-
value :TypeError, 7
|
198
|
-
value :MissingData, 8
|
199
|
-
value :DataFormatError, 9
|
200
|
-
value :InvalidData, 10
|
201
|
-
value :RemoteDataError, 11
|
202
|
-
value :CannotWriteExistingResource, 12
|
203
|
-
value :ValueSerializationError, 13
|
204
|
-
value :ValueDeserializationError, 14
|
205
|
-
value :DuplicateModuleName, 15
|
206
|
-
value :ExecutionStackOverflow, 16
|
207
|
-
value :CallStackOverflow, 17
|
10
|
+
optional :major_status, :uint64, 1
|
11
|
+
optional :has_sub_status, :bool, 2
|
12
|
+
optional :sub_status, :uint64, 3
|
13
|
+
optional :has_message, :bool, 4
|
14
|
+
optional :message, :string, 5
|
208
15
|
end
|
209
16
|
end
|
210
17
|
end
|
211
18
|
|
212
19
|
module Types
|
213
|
-
VMValidationStatus = Google::Protobuf::DescriptorPool.generated_pool.lookup("types.VMValidationStatus").msgclass
|
214
|
-
VMVerificationStatusList = Google::Protobuf::DescriptorPool.generated_pool.lookup("types.VMVerificationStatusList").msgclass
|
215
|
-
VMVerificationStatus = Google::Protobuf::DescriptorPool.generated_pool.lookup("types.VMVerificationStatus").msgclass
|
216
|
-
VMVerificationStatus::StatusKind = Google::Protobuf::DescriptorPool.generated_pool.lookup("types.VMVerificationStatus.StatusKind").enummodule
|
217
|
-
Aborted = Google::Protobuf::DescriptorPool.generated_pool.lookup("types.Aborted").msgclass
|
218
|
-
ArithmeticError = Google::Protobuf::DescriptorPool.generated_pool.lookup("types.ArithmeticError").msgclass
|
219
|
-
ArithmeticError::ArithmeticErrorType = Google::Protobuf::DescriptorPool.generated_pool.lookup("types.ArithmeticError.ArithmeticErrorType").enummodule
|
220
|
-
DynamicReferenceError = Google::Protobuf::DescriptorPool.generated_pool.lookup("types.DynamicReferenceError").msgclass
|
221
|
-
DynamicReferenceError::DynamicReferenceErrorType = Google::Protobuf::DescriptorPool.generated_pool.lookup("types.DynamicReferenceError.DynamicReferenceErrorType").enummodule
|
222
|
-
ExecutionStatus = Google::Protobuf::DescriptorPool.generated_pool.lookup("types.ExecutionStatus").msgclass
|
223
20
|
VMStatus = Google::Protobuf::DescriptorPool.generated_pool.lookup("types.VMStatus").msgclass
|
224
|
-
VMValidationStatusCode = Google::Protobuf::DescriptorPool.generated_pool.lookup("types.VMValidationStatusCode").enummodule
|
225
|
-
VMVerificationErrorKind = Google::Protobuf::DescriptorPool.generated_pool.lookup("types.VMVerificationErrorKind").enummodule
|
226
|
-
VMInvariantViolationError = Google::Protobuf::DescriptorPool.generated_pool.lookup("types.VMInvariantViolationError").enummodule
|
227
|
-
BinaryError = Google::Protobuf::DescriptorPool.generated_pool.lookup("types.BinaryError").enummodule
|
228
|
-
RuntimeStatus = Google::Protobuf::DescriptorPool.generated_pool.lookup("types.RuntimeStatus").enummodule
|
229
21
|
end
|
data/protos/consensus.proto
CHANGED
@@ -98,19 +98,18 @@ message QuorumCert {
|
|
98
98
|
message VoteData {
|
99
99
|
// The id of the block being vote for.
|
100
100
|
bytes block_id = 1;
|
101
|
-
// The round of the block being voted for
|
102
|
-
uint64 round = 2;
|
103
101
|
// The id and the version of the state after executing the block.
|
104
|
-
bytes executed_state_id =
|
105
|
-
|
102
|
+
bytes executed_state_id = 2;
|
103
|
+
// The round of the block being voted for
|
104
|
+
uint64 round = 3;
|
106
105
|
// The id of the parent block
|
107
|
-
bytes parent_block_id =
|
106
|
+
bytes parent_block_id = 4;
|
108
107
|
// The round of the parent block
|
109
|
-
uint64 parent_block_round =
|
108
|
+
uint64 parent_block_round = 5;
|
110
109
|
// The id of the grandparent block
|
111
|
-
bytes grandparent_block_id =
|
110
|
+
bytes grandparent_block_id = 6;
|
112
111
|
// The round of the grandparent block
|
113
|
-
uint64 grandparent_block_round =
|
112
|
+
uint64 grandparent_block_round = 7;
|
114
113
|
}
|
115
114
|
|
116
115
|
message Vote {
|
data/protos/ledger_info.proto
CHANGED
@@ -5,6 +5,8 @@ syntax = "proto3";
|
|
5
5
|
|
6
6
|
package types;
|
7
7
|
|
8
|
+
import "validator_set.proto";
|
9
|
+
|
8
10
|
/// Even though we don't always need all hashes, we pass them in and return them
|
9
11
|
/// always so that we keep them in sync on the client and don't make the client
|
10
12
|
/// worry about which one(s) to pass in which cases
|
@@ -60,6 +62,10 @@ message LedgerInfo {
|
|
60
62
|
// they can be certain that their transaction will never be included in a block in the future
|
61
63
|
// (assuming that their transaction has not yet been included)
|
62
64
|
uint64 timestamp_usecs = 6;
|
65
|
+
|
66
|
+
// An optional field with the validator set for the next epoch in case it's the last
|
67
|
+
// ledger info in the current epoch.
|
68
|
+
ValidatorSet next_validator_set = 7;
|
63
69
|
}
|
64
70
|
|
65
71
|
/// The validator node returns this structure which includes signatures
|
data/protos/mempool.proto
CHANGED
@@ -3,16 +3,103 @@
|
|
3
3
|
|
4
4
|
syntax = "proto3";
|
5
5
|
|
6
|
-
package
|
6
|
+
package mempool;
|
7
7
|
|
8
8
|
import "transaction.proto";
|
9
|
+
import "mempool_status.proto";
|
9
10
|
|
10
|
-
|
11
|
-
|
12
|
-
|
13
|
-
|
14
|
-
|
15
|
-
|
16
|
-
|
17
|
-
|
11
|
+
// -----------------------------------------------------------------------------
|
12
|
+
// ---------------- Mempool Service Definition
|
13
|
+
// -----------------------------------------------------------------------------
|
14
|
+
service Mempool {
|
15
|
+
// Adds a new transaction to the mempool with validation against existing
|
16
|
+
// transactions in the mempool. Note that this function performs additional
|
17
|
+
// validation that AC is unable to perform. (because AC knows only about a
|
18
|
+
// single transaction, but mempool potentially knows about multiple pending
|
19
|
+
// transactions)
|
20
|
+
rpc AddTransactionWithValidation(AddTransactionWithValidationRequest)
|
21
|
+
returns (AddTransactionWithValidationResponse) {}
|
22
|
+
|
23
|
+
// Fetch ordered block of transactions
|
24
|
+
rpc GetBlock(GetBlockRequest) returns (GetBlockResponse) {}
|
25
|
+
|
26
|
+
// Remove committed transactions from Mempool
|
27
|
+
rpc CommitTransactions(CommitTransactionsRequest)
|
28
|
+
returns (CommitTransactionsResponse) {}
|
29
|
+
|
30
|
+
// Check the health of mempool
|
31
|
+
rpc HealthCheck(HealthCheckRequest)
|
32
|
+
returns (HealthCheckResponse) {}
|
33
|
+
}
|
34
|
+
|
35
|
+
// -----------------------------------------------------------------------------
|
36
|
+
// ---------------- AddTransactionWithValidation
|
37
|
+
// -----------------------------------------------------------------------------
|
38
|
+
|
39
|
+
message AddTransactionWithValidationRequest {
|
40
|
+
// Transaction from a wallet
|
41
|
+
types.SignedTransaction signed_txn = 1;
|
42
|
+
// Max amount of gas required to execute the transaction
|
43
|
+
// Without running the program, it is very difficult to determine this number,
|
44
|
+
// so we use the max gas specified by the signed transaction.
|
45
|
+
// This field is still included separately from the signed transaction so that
|
46
|
+
// if we have a better methodology in the future, we can more accurately
|
47
|
+
// specify the max gas.
|
48
|
+
uint64 max_gas_cost = 2;
|
49
|
+
// Latest sequence number of the involved account from state db.
|
50
|
+
uint64 latest_sequence_number = 3;
|
51
|
+
// Latest account balance of the involved account from state db.
|
52
|
+
uint64 account_balance = 4;
|
53
|
+
}
|
54
|
+
|
55
|
+
message AddTransactionWithValidationResponse {
|
56
|
+
// The ledger version at the time of the transaction submitted. The submitted
|
57
|
+
// transaction will have version bigger than this 'current_version'
|
58
|
+
uint64 current_version = 1;
|
59
|
+
// The result of the transaction submission
|
60
|
+
MempoolAddTransactionStatus status = 2;
|
61
|
+
}
|
62
|
+
|
63
|
+
// -----------------------------------------------------------------------------
|
64
|
+
// ---------------- GetBlock
|
65
|
+
// -----------------------------------------------------------------------------
|
66
|
+
message GetBlockRequest {
|
67
|
+
uint64 max_block_size = 1;
|
68
|
+
repeated TransactionExclusion transactions = 2;
|
69
|
+
}
|
70
|
+
|
71
|
+
message GetBlockResponse { types.SignedTransactionsBlock block = 1; }
|
72
|
+
|
73
|
+
message TransactionExclusion {
|
74
|
+
bytes sender = 1;
|
75
|
+
uint64 sequence_number = 2;
|
76
|
+
}
|
77
|
+
|
78
|
+
// -----------------------------------------------------------------------------
|
79
|
+
// ---------------- CommitTransactions
|
80
|
+
// -----------------------------------------------------------------------------
|
81
|
+
message CommitTransactionsRequest {
|
82
|
+
repeated CommittedTransaction transactions = 1;
|
83
|
+
// agreed monotonic timestamp microseconds since the epoch for a committed block
|
84
|
+
// used by Mempool to GC expired transactions
|
85
|
+
uint64 block_timestamp_usecs = 2;
|
86
|
+
}
|
87
|
+
|
88
|
+
message CommitTransactionsResponse {}
|
89
|
+
|
90
|
+
message CommittedTransaction {
|
91
|
+
bytes sender = 1;
|
92
|
+
uint64 sequence_number = 2;
|
93
|
+
bool is_rejected = 3;
|
94
|
+
}
|
95
|
+
|
96
|
+
// -----------------------------------------------------------------------------
|
97
|
+
// ---------------- HealthCheck
|
98
|
+
// -----------------------------------------------------------------------------
|
99
|
+
message HealthCheckRequest {
|
100
|
+
}
|
101
|
+
|
102
|
+
message HealthCheckResponse {
|
103
|
+
// Indicate whether Mempool is in healthy condition.
|
104
|
+
bool is_healthy = 1;
|
18
105
|
}
|
@@ -20,21 +20,10 @@ message Event {
|
|
20
20
|
string json = 3;
|
21
21
|
}
|
22
22
|
|
23
|
-
message DumpJemallocHeapProfileRequest {}
|
24
|
-
|
25
|
-
message DumpJemallocHeapProfileResponse {
|
26
|
-
// Status code from jemalloc mallctl call. 0 indicates success.
|
27
|
-
int32 status_code = 1;
|
28
|
-
}
|
29
|
-
|
30
23
|
service NodeDebugInterface {
|
31
24
|
// Returns debug information about node
|
32
25
|
rpc GetNodeDetails(GetNodeDetailsRequest) returns (GetNodeDetailsResponse) {}
|
33
26
|
|
34
27
|
// Returns recent events generated by event! macro
|
35
28
|
rpc GetEvents(GetEventsRequest) returns (GetEventsResponse) {}
|
36
|
-
|
37
|
-
// Triggers a dump of heap profile.
|
38
|
-
rpc DumpJemallocHeapProfile(DumpJemallocHeapProfileRequest)
|
39
|
-
returns (DumpJemallocHeapProfileResponse) {}
|
40
29
|
}
|
data/protos/storage.proto
CHANGED
@@ -45,6 +45,10 @@ service Storage {
|
|
45
45
|
// Returns information needed for libra core to start up.
|
46
46
|
rpc GetStartupInfo(GetStartupInfoRequest)
|
47
47
|
returns (GetStartupInfoResponse);
|
48
|
+
|
49
|
+
// Returns latest ledger infos per epoch.
|
50
|
+
rpc GetLatestLedgerInfosPerEpoch(GetLatestLedgerInfosPerEpochRequest)
|
51
|
+
returns (GetLatestLedgerInfosPerEpochResponse);
|
48
52
|
}
|
49
53
|
|
50
54
|
message SaveTransactionsRequest {
|
@@ -113,3 +117,13 @@ message StartupInfo {
|
|
113
117
|
// From left to right, root hashes of all frozen subtrees.
|
114
118
|
repeated bytes ledger_frozen_subtree_hashes = 4;
|
115
119
|
}
|
120
|
+
|
121
|
+
message GetLatestLedgerInfosPerEpochRequest {
|
122
|
+
/// The last epoch number with available information to the client.
|
123
|
+
uint64 start_epoch = 1;
|
124
|
+
}
|
125
|
+
|
126
|
+
message GetLatestLedgerInfosPerEpochResponse {
|
127
|
+
/// Vector of latest ledger infos per epoch (not sorted)
|
128
|
+
repeated types.LedgerInfoWithSignatures latest_ledger_infos = 1;
|
129
|
+
}
|
data/protos/transaction.proto
CHANGED
@@ -11,49 +11,6 @@ import "proof.proto";
|
|
11
11
|
import "transaction_info.proto";
|
12
12
|
import "google/protobuf/wrappers.proto";
|
13
13
|
|
14
|
-
// A generic structure that describes a transaction that a client submits
|
15
|
-
message RawTransaction {
|
16
|
-
// Sender's account address
|
17
|
-
bytes sender_account = 1;
|
18
|
-
// Sequence number of this transaction corresponding to sender's account.
|
19
|
-
uint64 sequence_number = 2;
|
20
|
-
oneof payload {
|
21
|
-
// The transaction script to execute.
|
22
|
-
Program program = 3;
|
23
|
-
// A write set, used for genesis blocks and other magic transactions.
|
24
|
-
// This bypasses the rules for regular transactions so will typically be
|
25
|
-
// rejected. Only under special circumstances will it be accepted.
|
26
|
-
WriteSet write_set = 4;
|
27
|
-
// The transaction script to execute.
|
28
|
-
Script script = 8;
|
29
|
-
// The MOVE Module to publish.
|
30
|
-
Module module = 9;
|
31
|
-
}
|
32
|
-
// Maximal total gas specified by wallet to spend for this transaction.
|
33
|
-
uint64 max_gas_amount = 5;
|
34
|
-
// The price to be paid for each unit of gas.
|
35
|
-
uint64 gas_unit_price = 6;
|
36
|
-
// Expiration time for this transaction. If storage is queried and
|
37
|
-
// the time returned is greater than or equal to this time and this
|
38
|
-
// transaction has not been included, you can be certain that it will
|
39
|
-
// never be included.
|
40
|
-
// If set to 0, there will be no expiration time
|
41
|
-
uint64 expiration_time = 7;
|
42
|
-
}
|
43
|
-
|
44
|
-
// The code for the transaction to execute
|
45
|
-
message Program {
|
46
|
-
bytes code = 1;
|
47
|
-
repeated TransactionArgument arguments = 2;
|
48
|
-
repeated bytes modules = 3;
|
49
|
-
}
|
50
|
-
|
51
|
-
// The code for the transaction to execute
|
52
|
-
message Script {
|
53
|
-
bytes code = 1;
|
54
|
-
repeated TransactionArgument arguments = 2;
|
55
|
-
}
|
56
|
-
|
57
14
|
// An argument to the transaction if the transaction takes arguments
|
58
15
|
message TransactionArgument {
|
59
16
|
enum ArgType {
|
@@ -62,27 +19,12 @@ message TransactionArgument {
|
|
62
19
|
STRING = 2;
|
63
20
|
BYTEARRAY = 3;
|
64
21
|
}
|
65
|
-
ArgType type = 1;
|
66
|
-
bytes data = 2;
|
67
|
-
}
|
68
|
-
|
69
|
-
// A Move Module to publish
|
70
|
-
message Module {
|
71
|
-
bytes code = 1;
|
72
22
|
}
|
73
23
|
|
74
24
|
// A generic structure that represents signed RawTransaction
|
75
25
|
message SignedTransaction {
|
76
|
-
//
|
77
|
-
|
78
|
-
// across different language implementations, but for our use cases for
|
79
|
-
// transaction it is not necessary because the client is the only one to
|
80
|
-
// produce this bytes, which is then persisted in storage.
|
81
|
-
bytes raw_txn_bytes = 1;
|
82
|
-
// public key that corresponds to RawTransaction::sender_account
|
83
|
-
bytes sender_public_key = 2;
|
84
|
-
// signature for the hash
|
85
|
-
bytes sender_signature = 3;
|
26
|
+
// LCS byte code representation of a SignedTransaction
|
27
|
+
bytes signed_txn = 5;
|
86
28
|
}
|
87
29
|
|
88
30
|
message SignedTransactionWithProof {
|
@@ -110,30 +52,6 @@ message SignedTransactionsBlock {
|
|
110
52
|
bytes validator_signature = 3;
|
111
53
|
}
|
112
54
|
|
113
|
-
// Set of WriteOps to save to storage.
|
114
|
-
message WriteSet {
|
115
|
-
// Set of WriteOp for storage update.
|
116
|
-
repeated WriteOp write_set = 1;
|
117
|
-
}
|
118
|
-
|
119
|
-
// Write Operation on underlying storage.
|
120
|
-
message WriteOp {
|
121
|
-
// AccessPath of the write set.
|
122
|
-
AccessPath access_path = 1;
|
123
|
-
// The value of the write op. Empty if `type` is Delete.
|
124
|
-
bytes value = 2;
|
125
|
-
// WriteOp type.
|
126
|
-
WriteOpType type = 3;
|
127
|
-
}
|
128
|
-
|
129
|
-
// Type of write operation
|
130
|
-
enum WriteOpType {
|
131
|
-
// The WriteOp is to create/update the field from storage.
|
132
|
-
Write = 0;
|
133
|
-
// The WriteOp is to delete the field from storage.
|
134
|
-
Delete = 1;
|
135
|
-
}
|
136
|
-
|
137
55
|
// Account state as a whole.
|
138
56
|
// After execution, updates to accounts are passed in this form to storage for
|
139
57
|
// persistence.
|
@@ -154,6 +72,8 @@ message TransactionToCommit {
|
|
154
72
|
repeated Event events = 3;
|
155
73
|
// The amount of gas used.
|
156
74
|
uint64 gas_used = 4;
|
75
|
+
// The major status of executing the transaction.
|
76
|
+
uint64 major_status = 5;
|
157
77
|
}
|
158
78
|
|
159
79
|
// A list of consecutive transactions with proof. This is mainly used for state
|
data/protos/vm_errors.proto
CHANGED
@@ -24,269 +24,12 @@ import "language_storage.proto";
|
|
24
24
|
// errors that can occur during execution due to things such as division
|
25
25
|
// by zero, running out of gas, etc. These do not signify an issue with
|
26
26
|
// the VM.
|
27
|
-
|
28
|
-
// NB: we make a distinction between a status and an error here: A
|
29
|
-
// status contains errors, along with possible affirmation of a successful
|
30
|
-
// execution or valid prologue.
|
31
|
-
|
32
|
-
// The status of a transaction as determined by the prologue.
|
33
|
-
enum VMValidationStatusCode {
|
34
|
-
// We don't want the default value to be valid
|
35
|
-
UnknownValidationStatus = 0;
|
36
|
-
// The transaction has a bad signature
|
37
|
-
InvalidSignature = 1;
|
38
|
-
// Bad account authentication key
|
39
|
-
InvalidAuthKey = 2;
|
40
|
-
// Sequence number is too old
|
41
|
-
SequenceNumberTooOld = 3;
|
42
|
-
// Sequence number is too new
|
43
|
-
SequenceNumberTooNew = 4;
|
44
|
-
// Insufficient balance to pay minimum transaction fee
|
45
|
-
InsufficientBalanceForTransactionFee = 5;
|
46
|
-
// The transaction has expired
|
47
|
-
TransactionExpired = 6;
|
48
|
-
// The sending account does not exist
|
49
|
-
SendingAccountDoesNotExist = 7;
|
50
|
-
// This write set transaction was rejected because it did not meet the
|
51
|
-
// requirements for one.
|
52
|
-
RejectedWriteSet = 8;
|
53
|
-
// This write set transaction cannot be applied to the current state.
|
54
|
-
InvalidWriteSet = 9;
|
55
|
-
// Length of program field in raw transaction exceeded max length
|
56
|
-
ExceededMaxTransactionSize = 10;
|
57
|
-
// This script is not on our whitelist of script.
|
58
|
-
UnknownScript = 11;
|
59
|
-
// Transaction is trying to publish a new module.
|
60
|
-
UnknownModule = 12;
|
61
|
-
// Max gas units submitted with transaction exceeds max gas units bound
|
62
|
-
// in VM
|
63
|
-
MaxGasUnitsExceedsMaxGasUnitsBound = 13;
|
64
|
-
// Max gas units submitted with transaction not enough to cover the
|
65
|
-
// intrinsic cost of the transaction.
|
66
|
-
MaxGasUnitsBelowMinTransactionGasUnits = 14;
|
67
|
-
// Gas unit price submitted with transaction is below minimum gas price
|
68
|
-
// set in the VM.
|
69
|
-
GasUnitPriceBelowMinBound = 15;
|
70
|
-
// Gas unit price submitted with the transaction is above the maximum
|
71
|
-
// gas price set in the VM.
|
72
|
-
GasUnitPriceAboveMaxBound = 16;
|
73
|
-
}
|
74
|
-
|
75
|
-
message VMValidationStatus {
|
76
|
-
VMValidationStatusCode code = 1;
|
77
|
-
string message = 2;
|
78
|
-
}
|
79
|
-
|
80
|
-
message VMVerificationStatusList {
|
81
|
-
repeated VMVerificationStatus status_list = 1;
|
82
|
-
}
|
83
|
-
|
84
|
-
message VMVerificationStatus {
|
85
|
-
enum StatusKind {
|
86
|
-
SCRIPT = 0;
|
87
|
-
MODULE = 1;
|
88
|
-
DEPENDENCY = 2;
|
89
|
-
}
|
90
|
-
StatusKind status_kind = 1;
|
91
|
-
// For StatusKind::SCRIPT and DEPENDENCY this is ignored.
|
92
|
-
uint32 module_idx = 2;
|
93
|
-
VMVerificationErrorKind error_kind = 3;
|
94
|
-
string message = 4;
|
95
|
-
// For StatusKind::SCRIPT and MODULE this is ignored.
|
96
|
-
ModuleId dependency_id = 5;
|
97
|
-
}
|
98
|
-
|
99
|
-
// When a code module/script is published it is verified. These are the
|
100
|
-
// possible errors that can arise from the verification process.
|
101
|
-
enum VMVerificationErrorKind {
|
102
|
-
// Likewise default to a unknown verification error
|
103
|
-
UnknownVerificationError = 0;
|
104
|
-
IndexOutOfBounds = 1;
|
105
|
-
CodeUnitIndexOutOfBounds = 2;
|
106
|
-
RangeOutOfBounds = 3;
|
107
|
-
InvalidSignatureToken = 4;
|
108
|
-
InvalidFieldDefReference = 5;
|
109
|
-
RecursiveStructDefinition = 6;
|
110
|
-
InvalidResourceField = 7;
|
111
|
-
InvalidFallThrough = 8;
|
112
|
-
JoinFailure = 9;
|
113
|
-
NegativeStackSizeWithinBlock = 10;
|
114
|
-
UnbalancedStack = 11;
|
115
|
-
InvalidMainFunctionSignature = 12;
|
116
|
-
DuplicateElement = 13;
|
117
|
-
InvalidModuleHandle = 14;
|
118
|
-
UnimplementedHandle = 15;
|
119
|
-
InconsistentFields = 16;
|
120
|
-
UnusedFields = 17;
|
121
|
-
LookupFailed = 18;
|
122
|
-
VisibilityMismatch = 19;
|
123
|
-
TypeResolutionFailure = 20;
|
124
|
-
TypeMismatch = 21;
|
125
|
-
MissingDependency = 22;
|
126
|
-
PopReferenceError = 23;
|
127
|
-
PopResourceError = 24;
|
128
|
-
ReleaseRefTypeMismatchError = 25;
|
129
|
-
BrTypeMismatchError = 26;
|
130
|
-
AbortTypeMismatchError = 27;
|
131
|
-
StLocTypeMismatchError = 28;
|
132
|
-
StLocUnsafeToDestroyError = 29;
|
133
|
-
RetUnsafeToDestroyError = 30;
|
134
|
-
RetTypeMismatchError = 31;
|
135
|
-
FreezeRefTypeMismatchError = 32;
|
136
|
-
FreezeRefExistsMutableBorrowError = 33;
|
137
|
-
BorrowFieldTypeMismatchError = 34;
|
138
|
-
BorrowFieldBadFieldError = 35;
|
139
|
-
BorrowFieldExistsMutableBorrowError = 36;
|
140
|
-
CopyLocUnavailableError = 37;
|
141
|
-
CopyLocResourceError = 38;
|
142
|
-
CopyLocExistsBorrowError = 39;
|
143
|
-
MoveLocUnavailableError = 40;
|
144
|
-
MoveLocExistsBorrowError = 41;
|
145
|
-
BorrowLocReferenceError = 42;
|
146
|
-
BorrowLocUnavailableError = 43;
|
147
|
-
BorrowLocExistsBorrowError = 44;
|
148
|
-
CallTypeMismatchError = 45;
|
149
|
-
CallBorrowedMutableReferenceError = 46;
|
150
|
-
PackTypeMismatchError = 47;
|
151
|
-
UnpackTypeMismatchError = 48;
|
152
|
-
ReadRefTypeMismatchError = 49;
|
153
|
-
ReadRefResourceError = 50;
|
154
|
-
ReadRefExistsMutableBorrowError = 51;
|
155
|
-
WriteRefTypeMismatchError = 52;
|
156
|
-
WriteRefResourceError = 53;
|
157
|
-
WriteRefExistsBorrowError = 54;
|
158
|
-
WriteRefNoMutableReferenceError = 55;
|
159
|
-
IntegerOpTypeMismatchError = 56;
|
160
|
-
BooleanOpTypeMismatchError = 57;
|
161
|
-
EqualityOpTypeMismatchError = 58;
|
162
|
-
ExistsResourceTypeMismatchError = 59;
|
163
|
-
ExistsNoResourceError = 60;
|
164
|
-
BorrowGlobalTypeMismatchError = 61;
|
165
|
-
BorrowGlobalNoResourceError = 62;
|
166
|
-
MoveFromTypeMismatchError = 63;
|
167
|
-
MoveFromNoResourceError = 64;
|
168
|
-
MoveToSenderTypeMismatchError = 65;
|
169
|
-
MoveToSenderNoResourceError = 66;
|
170
|
-
CreateAccountTypeMismatchError = 67;
|
171
|
-
GlobalReferenceError = 68;
|
172
|
-
// The self address of a module the transaction is publishing is not the sender address
|
173
|
-
ModuleAddressDoesNotMatchSender = 69;
|
174
|
-
// The module does not have any module handles. Each module or script must have at least one module handle.
|
175
|
-
NoModuleHandles = 70;
|
176
|
-
MissingAcquiresResourceAnnotationError = 71;
|
177
|
-
ExtraneousAcquiresResourceAnnotationError = 72;
|
178
|
-
DuplicateAcquiresResourceAnnotationError = 73;
|
179
|
-
InvalidAcquiresResourceAnnotationError = 74;
|
180
|
-
}
|
181
|
-
|
182
|
-
// These are errors that the VM might raise if a violation of internal
|
183
|
-
// invariants takes place.
|
184
|
-
enum VMInvariantViolationError {
|
185
|
-
UnknownInvariantViolationError = 0;
|
186
|
-
OutOfBoundsIndex = 1;
|
187
|
-
OutOfBoundsRange = 2;
|
188
|
-
EmptyValueStack = 3;
|
189
|
-
EmptyCallStack = 4;
|
190
|
-
PCOverflow = 5;
|
191
|
-
LinkerError = 6;
|
192
|
-
LocalReferenceError = 7;
|
193
|
-
StorageError = 8;
|
194
|
-
InternalTypeError = 9;
|
195
|
-
EventKeyMismatch = 10;
|
196
|
-
}
|
197
|
-
|
198
|
-
// Errors that can arise from binary decoding (deserialization)
|
199
|
-
enum BinaryError {
|
200
|
-
UnknownBinaryError = 0;
|
201
|
-
Malformed = 1;
|
202
|
-
BadMagic = 2;
|
203
|
-
UnknownVersion = 3;
|
204
|
-
UnknownTableType = 4;
|
205
|
-
UnknownSignatureType = 5;
|
206
|
-
UnknownSerializedType = 6;
|
207
|
-
UnknownOpcode = 7;
|
208
|
-
BadHeaderTable = 8;
|
209
|
-
UnexpectedSignatureType = 9;
|
210
|
-
DuplicateTable = 10;
|
211
|
-
}
|
212
|
-
|
213
|
-
//*************************
|
214
|
-
// Runtime errors/status
|
215
|
-
//*************************
|
216
|
-
|
217
|
-
enum RuntimeStatus {
|
218
|
-
UnknownRuntimeStatus = 0;
|
219
|
-
Executed = 1;
|
220
|
-
OutOfGas = 2;
|
221
|
-
// We tried to access a resource that does not exist under the account.
|
222
|
-
ResourceDoesNotExist = 3;
|
223
|
-
// We tried to create a resource under an account where that resource
|
224
|
-
// already exists.
|
225
|
-
ResourceAlreadyExists = 4;
|
226
|
-
// We accessed an account that is evicted.
|
227
|
-
EvictedAccountAccess = 5;
|
228
|
-
// We tried to create an account at an address where an account already
|
229
|
-
// exists.
|
230
|
-
AccountAddressAlreadyExists = 6;
|
231
|
-
TypeError = 7;
|
232
|
-
MissingData = 8;
|
233
|
-
DataFormatError = 9;
|
234
|
-
InvalidData = 10;
|
235
|
-
RemoteDataError = 11;
|
236
|
-
CannotWriteExistingResource = 12;
|
237
|
-
ValueSerializationError = 13;
|
238
|
-
ValueDeserializationError = 14;
|
239
|
-
// The sender is trying to publish a module named `M`, but the sender's account already contains
|
240
|
-
// a module with this name.
|
241
|
-
DuplicateModuleName = 15;
|
242
|
-
ExecutionStackOverflow = 16;
|
243
|
-
CallStackOverflow = 17;
|
244
|
-
}
|
245
|
-
|
246
|
-
// user-defined abort error code number
|
247
|
-
message Aborted {
|
248
|
-
uint64 aborted_error_code = 1;
|
249
|
-
}
|
250
|
-
|
251
|
-
message ArithmeticError {
|
252
|
-
enum ArithmeticErrorType {
|
253
|
-
UnknownArithmeticError = 0;
|
254
|
-
Underflow = 1;
|
255
|
-
Overflow = 2;
|
256
|
-
DivisionByZero = 3;
|
257
|
-
// Fill with more later
|
258
|
-
}
|
259
|
-
ArithmeticErrorType error_code = 1;
|
260
|
-
}
|
261
|
-
|
262
|
-
message DynamicReferenceError {
|
263
|
-
enum DynamicReferenceErrorType {
|
264
|
-
UnknownDynamicReferenceError = 0;
|
265
|
-
MoveOfBorrowedResource = 1;
|
266
|
-
GlobalRefAlreadyReleased = 2;
|
267
|
-
MissingReleaseRef = 3;
|
268
|
-
GlobalAlreadyBorrowed = 4;
|
269
|
-
// Fill with with more later
|
270
|
-
}
|
271
|
-
DynamicReferenceErrorType error_code = 1;
|
272
|
-
}
|
273
|
-
|
274
|
-
message ExecutionStatus {
|
275
|
-
oneof execution_status {
|
276
|
-
RuntimeStatus runtime_status = 1;
|
277
|
-
Aborted aborted = 2;
|
278
|
-
ArithmeticError arithmetic_error = 3;
|
279
|
-
DynamicReferenceError reference_error = 4;
|
280
|
-
}
|
281
|
-
}
|
282
|
-
|
283
|
-
// The status of the VM
|
284
27
|
message VMStatus {
|
285
|
-
|
286
|
-
|
287
|
-
|
288
|
-
|
289
|
-
|
290
|
-
|
291
|
-
|
28
|
+
// e.g. assertion violation, out of gas
|
29
|
+
uint64 major_status = 1;
|
30
|
+
// Any substatus code. e.g. assertion error number
|
31
|
+
bool has_sub_status = 2;
|
32
|
+
uint64 sub_status = 3;
|
33
|
+
bool has_message = 4;
|
34
|
+
string message = 5;
|
292
35
|
}
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: libra_client
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.1
|
4
|
+
version: 0.2.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- yuan xinyu
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date: 2019-
|
11
|
+
date: 2019-10-06 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bundler
|
@@ -100,14 +100,14 @@ dependencies:
|
|
100
100
|
requirements:
|
101
101
|
- - "~>"
|
102
102
|
- !ruby/object:Gem::Version
|
103
|
-
version: 0.1
|
103
|
+
version: 0.2.1
|
104
104
|
type: :runtime
|
105
105
|
prerelease: false
|
106
106
|
version_requirements: !ruby/object:Gem::Requirement
|
107
107
|
requirements:
|
108
108
|
- - "~>"
|
109
109
|
- !ruby/object:Gem::Version
|
110
|
-
version: 0.1
|
110
|
+
version: 0.2.1
|
111
111
|
- !ruby/object:Gem::Dependency
|
112
112
|
name: rest-client
|
113
113
|
requirement: !ruby/object:Gem::Requirement
|
@@ -224,7 +224,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
224
224
|
version: '0'
|
225
225
|
requirements: []
|
226
226
|
rubyforge_project:
|
227
|
-
rubygems_version: 2.7.
|
227
|
+
rubygems_version: 2.7.6
|
228
228
|
signing_key:
|
229
229
|
specification_version: 4
|
230
230
|
summary: A ruby client for Libra network.
|