Commit 1b0e8466 authored by vicotor's avatar vicotor

update base api

parent 0162faf4
syntax = "proto3";
package base.v1;
import "google/protobuf/timestamp.proto";
import "google/protobuf/any.proto";
import "base/v1/resource.proto";
import "base/v1/meta.proto";
// BatchTx include one batchHash and all original tx contained in batch.
// it will broadcast to nebula over p2p module, and then save in p2p module.
message BatchTx {
Hash batch_hash = 1;
repeated MetaProofTx txs = 2;
}
syntax = "proto3";
package base.v1;
import "google/protobuf/timestamp.proto";
import "google/protobuf/any.proto";
import "base/v1/resource.proto";
import "base/v1/eth_tx.proto";
message EthBloom {
bytes data = 1;
}
message EthBlockHeader {
Hash parent_hash = 1;
Hash uncle_hash = 2;
Hash block_hash = 3;
Address miner = 4;
Hash state_root = 5;
Hash txs_root = 6;
Hash receipts_root = 7;
BigInt block_number = 8;
EthBloom block_bloom = 9;
BigInt difficulty = 10;
uint64 gas_limit = 11;
uint64 gas_used = 12;
uint64 timestamp = 13;
bytes extra = 14;
Hash mix_hash = 15;
BigInt block_nonce = 16;
BigInt base_fee = 17;
}
message EthBlockBody {
repeated EthTransaction txs = 1;
repeated EthBlockHeader uncles = 2;
}
message EthBlock {
EthBlockHeader header = 1;
repeated EthBlockHeader uncles = 2;
repeated EthTransaction txs = 3;
}
\ No newline at end of file
...@@ -6,17 +6,13 @@ import "google/protobuf/timestamp.proto"; ...@@ -6,17 +6,13 @@ import "google/protobuf/timestamp.proto";
import "google/protobuf/any.proto"; import "google/protobuf/any.proto";
import "base/v1/resource.proto"; import "base/v1/resource.proto";
message EthAccessTuple { message AccessTuple {
Address address = 1; Address address = 1;
repeated Hash storage_keys = 2; repeated Hash storage_keys = 2;
} }
message EthAccessList { message AccessList {
repeated EthAccessTuple access_list = 1; repeated AccessTuple access_list = 1;
}
message EthBloom {
bytes data = 1;
} }
message EthTxParam { message EthTxParam {
...@@ -53,7 +49,7 @@ message EthAccessListTx { ...@@ -53,7 +49,7 @@ message EthAccessListTx {
Address to = 5; Address to = 5;
BigInt value = 6; BigInt value = 6;
bytes data = 7; bytes data = 7;
EthAccessList access_list = 8; AccessList access_list = 8;
BigInt v = 9; BigInt v = 9;
BigInt r = 10; BigInt r = 10;
BigInt s = 11; BigInt s = 11;
...@@ -68,14 +64,14 @@ message EthDynamicFeeTx { ...@@ -68,14 +64,14 @@ message EthDynamicFeeTx {
Address to = 6; Address to = 6;
BigInt value = 7; BigInt value = 7;
bytes data = 8; bytes data = 8;
EthAccessList access_list = 9; AccessList access_list = 9;
BigInt v = 10; BigInt v = 10;
BigInt r = 11; BigInt r = 11;
BigInt s = 12; BigInt s = 12;
} }
message EthTransaction { message EthTransaction {
google.protobuf.Any tx = 1; google.protobuf.Any tx = 1; // one of EthLegacyTx, EthAccessListTx, EthDynamicFeeTx
} }
// EthTxLog reference ethereum Log struct. // EthTxLog reference ethereum Log struct.
...@@ -105,34 +101,3 @@ message Receipt { ...@@ -105,34 +101,3 @@ message Receipt {
BigInt block_number = 11; BigInt block_number = 11;
uint32 tx_index = 12; uint32 tx_index = 12;
} }
message EthBlockHeader {
Hash parent_hash = 1;
Hash uncle_hash = 2;
Hash block_hash = 3;
Address miner = 4;
Hash state_root = 5;
Hash txs_root = 6;
Hash receipts_root = 7;
BigInt block_number = 8;
EthBloom block_bloom = 9;
BigInt difficulty = 10;
uint64 gas_limit = 11;
uint64 gas_used = 12;
uint64 timestamp = 13;
bytes extra = 14;
Hash mix_hash = 15;
BigInt block_nonce = 16;
BigInt base_fee = 17;
}
message EthBlockBody {
repeated EthTransaction txs = 1;
repeated EthBlockHeader uncles = 2;
}
message EthBlock {
EthBlockHeader header = 1;
repeated EthBlockHeader uncles = 2;
repeated EthTransaction txs = 3;
}
\ No newline at end of file
...@@ -5,8 +5,9 @@ package base.v1; ...@@ -5,8 +5,9 @@ package base.v1;
import "google/protobuf/timestamp.proto"; import "google/protobuf/timestamp.proto";
import "google/protobuf/any.proto"; import "google/protobuf/any.proto";
import "base/v1/resource.proto"; import "base/v1/resource.proto";
import "base/v1/eth_tx.proto";
message MetaTxProof{ message MetaProof{
bytes rset = 1; bytes rset = 1;
bytes wset = 2; bytes wset = 2;
bytes proof = 3; bytes proof = 3;
...@@ -14,14 +15,28 @@ message MetaTxProof{ ...@@ -14,14 +15,28 @@ message MetaTxProof{
} }
message MetaTxBase { message MetaTxBase {
EthTransaction tx = 1; BigInt chain_id = 1;
Address from = 2; uint64 nonce = 2;
google.protobuf.Timestamp receive_time = 3; BigInt gas_price = 3;
uint64 gas = 4;
Address to = 5;
BigInt value = 6;
bytes data = 7;
AccessList access_list = 8;
BigInt v = 9;
BigInt r = 10;
BigInt s = 11;
Address from = 12;
google.protobuf.Timestamp receive_time = 13;
} }
message MetaTx { message MetaProofTx {
MetaTxBase base = 1; MetaTxBase base = 1;
MetaTxProof proof = 2; MetaProof proof = 2;
}
message MetaTx {
} }
message MetaBlockHeader { message MetaBlockHeader {
......
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