Commit 0162faf4 authored by vicotor's avatar vicotor

update base proto

parent fdba2053
syntax = "proto3";
package base.v1;
import "google/protobuf/timestamp.proto";
import "google/protobuf/any.proto";
import "base/v1/resource.proto";
message MetaTxProof{
bytes rset = 1;
bytes wset = 2;
bytes proof = 3;
int64 state_block_num = 4;
}
message MetaTxBase {
EthTransaction tx = 1;
Address from = 2;
google.protobuf.Timestamp receive_time = 3;
}
message MetaTx {
MetaTxBase base = 1;
MetaTxProof proof = 2;
}
message MetaBlockHeader {
Hash parent_hash = 1;
Hash block_hash = 2;
Address miner = 3;
Hash state_root = 4;
Hash txs_root = 5;
Hash receipts_root = 6;
BigInt block_number = 7;
EthBloom block_bloom = 8;
uint64 gas_limit = 9;
uint64 gas_used = 10;
uint64 timestamp = 11;
bytes extra = 12;
}
message MetaBlockBody {
repeated MetaTx txs = 1;
}
message MetaBlock {
MetaBlockHeader header = 1;
repeated MetaTx txs = 2;
}
syntax = "proto3";
package base.v1;
import "base/v1/resource.proto";
message RLPData {
bytes data = 1;
}
message Account {
Address address = 1;
bytes nonce = 2;
bytes balance = 3;
Hash state_root = 4;
}
...@@ -26,155 +26,13 @@ message Address { ...@@ -26,155 +26,13 @@ message Address {
bytes address = 1; bytes address = 1;
} }
message RLPData {
// // Lengths of hashes and addresses in bytes. bytes data = 1;
// const (
// // HashLength is the expected length of the hash
// HashLength = 32
// // AddressLength is the expected length of the address
// AddressLength = 20
// )
message EthTx {
EthTxData Inner = 1;
google.protobuf.Timestamp time =2;
}
message EthTxData{
uint64 account_nonce =1;
bytes price =2 ;
uint64 gas_limit =3;
Address recipient =4;
bytes amount =5;
bytes payload =6;
bytes v =7;
bytes r=8;
bytes s=9;
//This is only used when marshaling to JSON.
Hash hash=10;
bytes from=11;
}
message StdTxData{
uint64 account_nonce =1;
bytes price =2 ;
uint64 gas_limit =3;
Address recipient =4;
bytes amount =5;
bytes payload =6;
bytes v =7;
bytes r=8;
bytes s=9;
//This is only used when marshaling to JSON.
Hash hash=10;
bytes from=11;
}
message StdTx{
StdTxData Inner = 1;
google.protobuf.Timestamp time =2;
}
message TxProof{
bytes rset = 1;
bytes wset = 2;
bytes proof =3;
int64 state_block_num =4;
}
// 1. any eth--> proto3 eth tx --> grpc --->proto3 eth tx --> eth
message Transaction{
TxProof tx_proof=1;
int64 timeout_block_num =2;
google.protobuf.Any tx =3; // EthTx StdTx
}
//2. eth std: proto3 eth tx --> grpc --->proto3 eth tx
// proto3 std tx --> grpc --->proto3 std tx
message TransactionEth{
TxProof tx_proof=1;
int64 timeout_block_num =2;
EthTx tx =3;
}
message RepeatedEthTx{
repeated TransactionEth txs =1;
}
message TransactionStd{
TxProof tx_proof=1;
int64 timeout_block_num =2;
StdTx tx =3;
}
message RepeatedStdTx{
repeated TransactionStd txs =1;
} }
message Account {
//3. bytes Address address = 1;
message TransactionBytes{ bytes nonce = 2;
TxProof tx_proof=1; bytes balance = 3;
int64 timeout_block_num =2; Hash state_root = 4;
bytes tx =3; // EthTx StdTx // proto3 定义的交易,没有对应的函数转bytes。
bytes from =4;
} }
//ype checkTx struct{
// tx interface
// From []byte
// type
//}
// type tx struct{
// checkTx
// wset []byte
// rset []byte
// proof []byte
// stateblocknum int64
// }
// type Transaction struct {
// data txdata // Consensus contents of a transaction
// time time.Time // Time first seen locally (spam avoidance)
// // caches
// hash atomic.Value
// size atomic.Value
// from atomic.Value
// }
// type txdata struct {
// AccountNonce uint64 `json:"nonce" gencodec:"required"`
// Price *big.Int `json:"gasPrice" gencodec:"required"`
// GasLimit uint64 `json:"gas" gencodec:"required"`
// Recipient *common.Address `json:"to" rlp:"nil"` // nil means contract creation
// Amount *big.Int `json:"value" gencodec:"required"`
// Payload []byte `json:"input" gencodec:"required"`
// // Signature values
// V *big.Int `json:"v" gencodec:"required"`
// R *big.Int `json:"r" gencodec:"required"`
// S *big.Int `json:"s" gencodec:"required"`
// // This is only used when marshaling to JSON.
// Hash *common.Hash `json:"hash" rlp:"-"`
// }
\ No newline at end of file
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment