Skip to content
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

Juno MVP #20

Draft
wants to merge 8 commits into
base: main
Choose a base branch
from
6 changes: 5 additions & 1 deletion p2p/proto/block.proto
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ message Signatures {
// Note: commitments may change to be for the previous blocks like comet/tendermint
// hash of block header sent to L1
message BlockHeader {
Hash parent_header = 1;
Hash parent_hash = 1;
uint64 number = 2;
google.protobuf.Timestamp time = 3; // TODO: see if this needs to be Felt252 or can be converted
Address sequencer_address = 4;
Expand All @@ -29,6 +29,8 @@ message BlockHeader {
Merkle transactions = 8; // By order of execution. TBD: required? the client can execute (powerful machine) and match state diff
Merkle events = 9; // By order of issuance. TBD: in receipts?
Merkle receipts = 10; // By order of issuance.
string protocol_version = 11; // Starknet version
Felt252 gas_price = 12;
}

message BlockProof {
Expand All @@ -45,6 +47,8 @@ message NewBlock {
}
}

// Requests a peer's CurrentBlockHeader
message CurrentBlockHeaderRequest {}

// result is (BlockHeader, Signature?)* in order of creation (incr/dec)
message BlockHeadersRequest {
Expand Down
7 changes: 4 additions & 3 deletions p2p/proto/event.proto
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,10 @@ syntax = "proto3";
import "p2p/proto/common.proto";

message Event {
Felt252 from_address = 1;
repeated Felt252 keys = 2;
repeated Felt252 data = 3;
Hash transaction_hash = 1;
Felt252 from_address = 2;
repeated Felt252 keys = 3;
repeated Felt252 data = 4;
}

message EventsRequest {
Expand Down
14 changes: 8 additions & 6 deletions p2p/proto/receipt.proto
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@ message Receipt {
uint32 range_check = 5;
uint32 poseidon = 6;
uint32 keccak = 7;
uint32 output = 8;
}

BuiltinCounter builtins = 1;
Expand All @@ -37,11 +38,12 @@ message Receipt {
}

message Common {
Hash transaction_hash = 1;
Felt252 actual_fee = 2;
repeated MessageToL1 messages_sent = 3;
ExecutionResources execution_resources = 4;
string revert_reason = 5;
Hash transaction_hash = 1;
Felt252 actual_fee = 2;
repeated MessageToL1 messages_sent = 3;
ExecutionResources execution_resources = 4;
string revert_reason = 5;
optional MessageToL2 consumed_message = 6;
}


Expand All @@ -68,7 +70,7 @@ message Receipt {
Felt252 contract_address = 2;
}

oneof receipt {
oneof type {
Invoke invoke = 1;
L1Handler l1_handler = 2;
Declare declare = 3;
Expand Down
7 changes: 7 additions & 0 deletions p2p/proto/state.proto
Original file line number Diff line number Diff line change
Expand Up @@ -18,8 +18,15 @@ message StateDiff
repeated ContractStoredValue values = 4;
}

message ContractAddrToClassHash {
Address contract_addr = 1;
Hash class_hash = 2;
}

uint32 domain = 1; // volition state domain
repeated ContractDiff contract_diffs = 2;
repeated ContractAddrToClassHash replaced_classes = 3;
repeated ContractAddrToClassHash deployed_contracts = 4;
}

message EntryPoint {
Expand Down