From e4c8d1e1fedf7136cc44aed33a88ef7641c54871 Mon Sep 17 00:00:00 2001 From: Kirill Date: Thu, 2 May 2024 15:40:01 +0400 Subject: [PATCH 01/18] Refactor p2p handlers: move commong iterator logic to a helper --- p2p/starknet/handlers.go | 307 +++++++++++++++++---------------------- 1 file changed, 135 insertions(+), 172 deletions(-) diff --git a/p2p/starknet/handlers.go b/p2p/starknet/handlers.go index 62bb6e4f24..e15e3d5930 100644 --- a/p2p/starknet/handlers.go +++ b/p2p/starknet/handlers.go @@ -7,6 +7,8 @@ import ( "fmt" "sync" + "github.com/NethermindEth/juno/core" + "github.com/NethermindEth/juno/adapters/core2p2p" "github.com/NethermindEth/juno/adapters/p2p2core" "github.com/NethermindEth/juno/blockchain" @@ -57,11 +59,14 @@ func streamHandler[ReqT proto.Message](ctx context.Context, stream network.Strea buffer := getBuffer() defer bufferPool.Put(buffer) + // todo add limit reader + // todo add read timeout if _, err := buffer.ReadFrom(stream); err != nil { log.Debugw("Error reading from stream", "peer", stream.ID(), "protocol", stream.Protocol(), "err", err) return } + // todo double check that wrong proto request is not possible var zero ReqT req := zero.ProtoReflect().New().Interface() if err := proto.Unmarshal(buffer.Bytes(), req); err != nil { @@ -71,10 +76,12 @@ func streamHandler[ReqT proto.Message](ctx context.Context, stream network.Strea response, err := reqHandler(req.(ReqT)) if err != nil { - log.Debugw("Error handling request peer %v protocol %v err %v\n", stream.ID(), stream.Protocol(), err) + // todo report error to client? + log.Debugw("Error handling request", "peer", stream.ID(), "protocol", stream.Protocol(), "err", err) return } + // todo add write timeout response(func(msg proto.Message) bool { if ctx.Err() != nil { return false @@ -82,6 +89,7 @@ func streamHandler[ReqT proto.Message](ctx context.Context, stream network.Strea if _, err := protodelim.MarshalTo(stream, msg); err != nil { // todo: figure out if we need buffered io here log.Debugw("Error writing response", "peer", stream.ID(), "protocol", stream.Protocol(), "err", err) + return false } return true @@ -112,75 +120,64 @@ func (h *Handler) CurrentBlockHeaderHandler(stream network.Stream) { streamHandler[*spec.CurrentBlockHeaderRequest](h.ctx, stream, h.onCurrentBlockHeaderRequest, h.log) } -type yieldFunc = func(proto.Message) bool - -func (h *Handler) onCurrentBlockHeaderRequest(req *spec.CurrentBlockHeaderRequest) (iter.Seq[proto.Message], error) { +func (h *Handler) onCurrentBlockHeaderRequest(*spec.CurrentBlockHeaderRequest) (iter.Seq[proto.Message], error) { curHeight, err := h.bcReader.Height() if err != nil { return nil, err } - it, err := newIteratorByNumber(h.bcReader, curHeight, 1, 1, true) - if err != nil { - return nil, err - } - return h.blockHeaders(it, blockHeadersRequestFin()), nil + return h.onBlockHeadersRequest(&spec.BlockHeadersRequest{ + Iteration: &spec.Iteration{ + Start: &spec.Iteration_BlockNumber{ + BlockNumber: curHeight, + }, + Direction: spec.Iteration_Forward, + Limit: 1, + Step: 1, + }, + }) } func (h *Handler) onBlockHeadersRequest(req *spec.BlockHeadersRequest) (iter.Seq[proto.Message], error) { - it, err := h.newIterator(req.Iteration) - if err != nil { - return nil, err + finMsg := &spec.BlockHeadersResponse{ + Part: []*spec.BlockHeadersResponsePart{ + { + HeaderMessage: &spec.BlockHeadersResponsePart_Fin{}, + }, + }, } - return h.blockHeaders(it, blockHeadersRequestFin()), nil -} -func (h *Handler) blockHeaders(it *iterator, fin Stream[proto.Message]) iter.Seq[proto.Message] { - return func(yield func(proto.Message) bool) { - for it.Valid() { - header, err := it.Header() - if err != nil { - h.log.Debugw("Failed to fetch header", "blockNumber", it.BlockNumber(), "err", err) - break - } + return h.processIterationRequest(req.Iteration, finMsg, func(it blockDataAccessor) (proto.Message, error) { + header, err := it.Header() + if err != nil { + return nil, err + } - h.log.Debugw("Created Header Iterator", "blockNumber", header.Number) + h.log.Debugw("Created Header Iterator", "blockNumber", header.Number) - commitments, err := h.bcReader.BlockCommitmentsByNumber(header.Number) - if err != nil { - h.log.Debugw("Failed to fetch block commitments", "blockNumber", it.BlockNumber(), "err", err) - break - } + commitments, err := h.bcReader.BlockCommitmentsByNumber(header.Number) + if err != nil { + return nil, err + } - msg := &spec.BlockHeadersResponse{ - Part: []*spec.BlockHeadersResponsePart{ - { - HeaderMessage: &spec.BlockHeadersResponsePart_Header{ - Header: core2p2p.AdaptHeader(header, commitments), - }, + return &spec.BlockHeadersResponse{ + Part: []*spec.BlockHeadersResponsePart{ + { + HeaderMessage: &spec.BlockHeadersResponsePart_Header{ + Header: core2p2p.AdaptHeader(header, commitments), }, - { - HeaderMessage: &spec.BlockHeadersResponsePart_Signatures{ - Signatures: &spec.Signatures{ - Block: core2p2p.AdaptBlockID(header), - Signatures: utils.Map(header.Signatures, core2p2p.AdaptSignature), - }, + }, + { + HeaderMessage: &spec.BlockHeadersResponsePart_Signatures{ + Signatures: &spec.Signatures{ + Block: core2p2p.AdaptBlockID(header), + Signatures: utils.Map(header.Signatures, core2p2p.AdaptSignature), }, }, }, - } - - if !yield(msg) { - return - } - - it.Next() - } - - if finMsg, ok := fin(); ok { - yield(finMsg) - } - } + }, + }, nil + }) } func (h *Handler) onBlockBodiesRequest(req *spec.BlockBodiesRequest) (iter.Seq[proto.Message], error) { @@ -189,10 +186,6 @@ func (h *Handler) onBlockBodiesRequest(req *spec.BlockBodiesRequest) (iter.Seq[p return nil, err } - fin := newFin(&spec.BlockBodiesResponse{ - BodyMessage: &spec.BlockBodiesResponse_Fin{}, - }) - return func(yield func(proto.Message) bool) { outerLoop: for it.Valid() { @@ -223,140 +216,134 @@ func (h *Handler) onBlockBodiesRequest(req *spec.BlockBodiesRequest) (iter.Seq[p it.Next() } - if finMs, ok := fin(); ok { - yield(finMs) + finMsg := &spec.BlockBodiesResponse{ + BodyMessage: &spec.BlockBodiesResponse_Fin{}, } + yield(finMsg) }, nil } func (h *Handler) onEventsRequest(req *spec.EventsRequest) (iter.Seq[proto.Message], error) { - it, err := h.newIterator(req.Iteration) - if err != nil { - return nil, err - } - - fin := newFin(&spec.EventsResponse{ + finMsg := &spec.EventsResponse{ Responses: &spec.EventsResponse_Fin{}, - }) - return func(yield yieldFunc) { - for it.Valid() { - block, err := it.Block() - if err != nil { - h.log.Debugw("Failed to fetch block for Events", "blockNumber", it.BlockNumber(), "err", err) - break - } + } + return h.processIterationRequest(req.Iteration, finMsg, func(it blockDataAccessor) (proto.Message, error) { + block, err := it.Block() + if err != nil { + return nil, err + } - events := make([]*spec.Event, 0, len(block.Receipts)) - for _, receipt := range block.Receipts { - for _, event := range receipt.Events { - events = append(events, core2p2p.AdaptEvent(event, receipt.TransactionHash)) - } + events := make([]*spec.Event, 0, len(block.Receipts)) + for _, receipt := range block.Receipts { + for _, event := range receipt.Events { + events = append(events, core2p2p.AdaptEvent(event, receipt.TransactionHash)) } + } - msg := &spec.EventsResponse{ - Id: core2p2p.AdaptBlockID(block.Header), - Responses: &spec.EventsResponse_Events{ - Events: &spec.Events{ - Items: events, - }, + return &spec.EventsResponse{ + Id: core2p2p.AdaptBlockID(block.Header), + Responses: &spec.EventsResponse_Events{ + Events: &spec.Events{ + Items: events, }, - } - - if !yield(msg) { - return - } + }, + }, nil + }) +} - it.Next() +func (h *Handler) onReceiptsRequest(req *spec.ReceiptsRequest) (iter.Seq[proto.Message], error) { + finMsg := &spec.ReceiptsResponse{Responses: &spec.ReceiptsResponse_Fin{}} + return h.processIterationRequest(req.Iteration, finMsg, func(it blockDataAccessor) (proto.Message, error) { + block, err := it.Block() + if err != nil { + return nil, err } - if finMsg, ok := fin(); ok { - yield(finMsg) + receipts := make([]*spec.Receipt, len(block.Receipts)) + for i := 0; i < len(block.Receipts); i++ { + receipts[i] = core2p2p.AdaptReceipt(block.Receipts[i], block.Transactions[i]) } - }, nil + + return &spec.ReceiptsResponse{ + Id: core2p2p.AdaptBlockID(block.Header), + Responses: &spec.ReceiptsResponse_Receipts{ + Receipts: &spec.Receipts{Items: receipts}, + }, + }, nil + }) } -func (h *Handler) onReceiptsRequest(req *spec.ReceiptsRequest) (iter.Seq[proto.Message], error) { - it, err := h.newIterator(req.Iteration) - if err != nil { - return nil, err +func (h *Handler) onTransactionsRequest(req *spec.TransactionsRequest) (iter.Seq[proto.Message], error) { + finMsg := &spec.TransactionsResponse{ + Responses: &spec.TransactionsResponse_Fin{}, } - - fin := newFin(&spec.ReceiptsResponse{Responses: &spec.ReceiptsResponse_Fin{}}) - - return func(yield yieldFunc) { - for it.Valid() { - block, err := it.Block() - if err != nil { - h.log.Debugw("Failed to fetch block for Receipts", "blockNumber", it.BlockNumber(), "err", err) - break - } - - receipts := make([]*spec.Receipt, len(block.Receipts)) - for i := 0; i < len(block.Receipts); i++ { - receipts[i] = core2p2p.AdaptReceipt(block.Receipts[i], block.Transactions[i]) - } - - rs := &spec.Receipts{Items: receipts} - msg := &spec.ReceiptsResponse{ - Id: core2p2p.AdaptBlockID(block.Header), - Responses: &spec.ReceiptsResponse_Receipts{Receipts: rs}, - } - - if !yield(msg) { - return - } - - it.Next() + return h.processIterationRequest(req.Iteration, finMsg, func(it blockDataAccessor) (proto.Message, error) { + block, err := it.Block() + if err != nil { + return nil, err } - if finMsg, ok := fin(); ok { - yield(finMsg) - } - }, nil + return &spec.TransactionsResponse{ + Id: core2p2p.AdaptBlockID(block.Header), + Responses: &spec.TransactionsResponse_Transactions{ + Transactions: &spec.Transactions{ + Items: utils.Map(block.Transactions, core2p2p.AdaptTransaction), + }, + }, + }, nil + }) } -func (h *Handler) onTransactionsRequest(req *spec.TransactionsRequest) (iter.Seq[proto.Message], error) { - it, err := h.newIterator(req.Iteration) +// blockDataAccessor provides access to either entire block or header +// for current iteration +type blockDataAccessor interface { + Block() (*core.Block, error) + Header() (*core.Header, error) +} + +// iterationProcessor is an alias for a function that will generate corresponding data +// given block data for current iteration through blockDataAccessor +type iterationProcessor = func(it blockDataAccessor) (proto.Message, error) + +// processIterationRequest is helper function that simplifies data processing for provided spec.Iteration object +// caller usually passes iteration object from received request, finMsg as final message to a peer +// and iterationProcessor function that will generate response for each iteration +func (h *Handler) processIterationRequest(iteration *spec.Iteration, finMsg proto.Message, f iterationProcessor) (iter.Seq[proto.Message], error) { + it, err := h.newIterator(iteration) if err != nil { return nil, err } - fin := newFin(&spec.TransactionsResponse{ - Responses: &spec.TransactionsResponse_Fin{}, - }) - + type yieldFunc = func(proto.Message) bool return func(yield yieldFunc) { + // while iterator is valid for it.Valid() { - block, err := it.Block() + // pass it to handler function (some might be interested in header, others in entire block) + msg, err := f(it) if err != nil { - h.log.Debugw("Failed to fetch block for Transactions", "blockNumber", it.BlockNumber(), "err", err) + h.log.Errorw("Failed to generate data", "blockNumber", it.BlockNumber(), "err", err) break } - msg := &spec.TransactionsResponse{ - Id: core2p2p.AdaptBlockID(block.Header), - Responses: &spec.TransactionsResponse_Transactions{ - Transactions: &spec.Transactions{ - Items: utils.Map(block.Transactions, core2p2p.AdaptTransaction), - }, - }, - } + // push generated msg to caller if !yield(msg) { + // if caller is not interested in remaining data (example: connection to a peer is closed) exit + // note that in this case we won't send finMsg return } it.Next() } - if finMsg, ok := fin(); ok { - yield(finMsg) - } + // either we iterated over whole sequence or reached break statement in loop above + // note that return value of yield is not checked because this is the last message anyway + yield(finMsg) }, nil } func (h *Handler) newIterator(it *spec.Iteration) (*iterator, error) { forward := it.Direction == spec.Iteration_Forward - + // todo restrict limit max value ? switch v := it.Start.(type) { case *spec.Iteration_BlockNumber: return newIteratorByNumber(h.bcReader, v.BlockNumber, it.Limit, it.Step, forward) @@ -366,27 +353,3 @@ func (h *Handler) newIterator(it *spec.Iteration) (*iterator, error) { return nil, fmt.Errorf("unsupported iteration start type %T", v) } } - -func newFin(finMsg proto.Message) Stream[proto.Message] { - var finSent bool - - return func() (proto.Message, bool) { - if finSent { - return nil, false - } - finSent = true - - return finMsg, true - } -} - -// todo change this logic later on -func blockHeadersRequestFin() Stream[proto.Message] { - return newFin(&spec.BlockHeadersResponse{ - Part: []*spec.BlockHeadersResponsePart{ - { - HeaderMessage: &spec.BlockHeadersResponsePart_Fin{}, - }, - }, - }) -} From c5c0f7015196b18f984bc4507a4b02d256352d53 Mon Sep 17 00:00:00 2001 From: Kirill Date: Mon, 6 May 2024 13:42:52 +0400 Subject: [PATCH 02/18] Update p2p spec --- adapters/core2p2p/block.go | 12 +- adapters/core2p2p/transaction.go | 58 +- adapters/p2p2core/block.go | 5 +- adapters/p2p2core/state.go | 10 + adapters/p2p2core/transaction.go | 32 +- p2p/starknet/buf.gen.yaml | 5 + p2p/starknet/handlers.go | 46 +- p2p/starknet/p2p/proto/block.proto | 86 -- p2p/starknet/p2p/proto/class.proto | 62 + p2p/starknet/p2p/proto/common.proto | 19 +- p2p/starknet/p2p/proto/discovery.proto | 19 - p2p/starknet/p2p/proto/event.proto | 18 +- p2p/starknet/p2p/proto/header.proto | 52 + p2p/starknet/p2p/proto/mempool.proto | 30 - p2p/starknet/p2p/proto/receipt.proto | 24 +- p2p/starknet/p2p/proto/snapshot.proto | 109 -- p2p/starknet/p2p/proto/state.proto | 78 +- p2p/starknet/p2p/proto/transaction.proto | 96 +- p2p/starknet/spec/block.pb.go | 1096 ---------------- p2p/starknet/spec/class.pb.go | 848 ++++++++++++ p2p/starknet/spec/common.pb.go | 132 +- p2p/starknet/spec/event.pb.go | 180 +-- p2p/starknet/spec/header.pb.go | 627 +++++++++ p2p/starknet/spec/receipt.pb.go | 562 +++----- p2p/starknet/spec/snapshot.pb.go | 1509 ---------------------- p2p/starknet/spec/state.pb.go | 906 +++---------- p2p/starknet/spec/transaction.pb.go | 926 +++++++------ p2p/sync.go | 85 +- 28 files changed, 2720 insertions(+), 4912 deletions(-) create mode 100644 p2p/starknet/buf.gen.yaml delete mode 100644 p2p/starknet/p2p/proto/block.proto create mode 100644 p2p/starknet/p2p/proto/class.proto delete mode 100644 p2p/starknet/p2p/proto/discovery.proto create mode 100644 p2p/starknet/p2p/proto/header.proto delete mode 100644 p2p/starknet/p2p/proto/mempool.proto delete mode 100644 p2p/starknet/p2p/proto/snapshot.proto delete mode 100644 p2p/starknet/spec/block.pb.go create mode 100644 p2p/starknet/spec/class.pb.go create mode 100644 p2p/starknet/spec/header.pb.go delete mode 100644 p2p/starknet/spec/snapshot.pb.go diff --git a/adapters/core2p2p/block.go b/adapters/core2p2p/block.go index 262c35ef86..7061b575e1 100644 --- a/adapters/core2p2p/block.go +++ b/adapters/core2p2p/block.go @@ -1,13 +1,10 @@ package core2p2p import ( - "time" - "github.com/NethermindEth/juno/core" "github.com/NethermindEth/juno/core/felt" "github.com/NethermindEth/juno/p2p/starknet/spec" "github.com/NethermindEth/juno/utils" - "google.golang.org/protobuf/types/known/timestamppb" ) func AdaptBlockID(header *core.Header) *spec.BlockID { @@ -28,15 +25,14 @@ func AdaptSignature(sig []*felt.Felt) *spec.ConsensusSignature { } } -func AdaptHeader(header *core.Header, commitments *core.BlockCommitments) *spec.BlockHeader { - return &spec.BlockHeader{ +func AdaptHeader(header *core.Header, commitments *core.BlockCommitments) *spec.SignedBlockHeader { + // todo revisit + return &spec.SignedBlockHeader{ ParentHash: AdaptHash(header.ParentHash), Number: header.Number, - Time: timestamppb.New(time.Unix(int64(header.Timestamp), 0)), + Time: header.Timestamp, SequencerAddress: AdaptAddress(header.SequencerAddress), - ProofFact: nil, // not defined yet Receipts: nil, // not defined yet - StateDiffs: nil, // not defined yet State: &spec.Patricia{ Height: core.ContractStorageTrieHeight, Root: AdaptHash(header.GlobalStateRoot), diff --git a/adapters/core2p2p/transaction.go b/adapters/core2p2p/transaction.go index 358a884856..8323580809 100644 --- a/adapters/core2p2p/transaction.go +++ b/adapters/core2p2p/transaction.go @@ -35,16 +35,15 @@ func AdaptTransaction(transaction core.Transaction) *spec.Transaction { case tx.Version.Is(3): specTx.Txn = &spec.Transaction_DeployAccountV3_{ DeployAccountV3: &spec.Transaction_DeployAccountV3{ - MaxFee: AdaptFelt(tx.MaxFee), - Signature: AdaptAccountSignature(tx.Signature()), - ClassHash: AdaptHash(tx.ClassHash), - Nonce: AdaptFelt(tx.Nonce), - AddressSalt: AdaptFelt(tx.ContractAddressSalt), - Calldata: AdaptFeltSlice(tx.ConstructorCallData), - L1Gas: adaptResourceLimits(tx.ResourceBounds[core.ResourceL1Gas]), - L2Gas: adaptResourceLimits(tx.ResourceBounds[core.ResourceL2Gas]), - Tip: AdaptFelt(new(felt.Felt).SetUint64(tx.Tip)), - Paymaster: nil, + // MaxFee: AdaptFelt(tx.MaxFee), // todo support max_fee? + Signature: AdaptAccountSignature(tx.Signature()), + ClassHash: AdaptHash(tx.ClassHash), + Nonce: AdaptFelt(tx.Nonce), + AddressSalt: AdaptFelt(tx.ContractAddressSalt), + Calldata: AdaptFeltSlice(tx.ConstructorCallData), + ResourceBounds: adaptResourceBounds(tx.ResourceBounds), + Tip: AdaptFelt(new(felt.Felt).SetUint64(tx.Tip)), + // Paymaster: nil, todo support paymaster? NonceDomain: fmt.Sprintf("%v", tx.NonceDAMode), FeeDomain: fmt.Sprintf("%v", tx.FeeDAMode), }, @@ -87,18 +86,17 @@ func AdaptTransaction(transaction core.Transaction) *spec.Transaction { case tx.Version.Is(3): specTx.Txn = &spec.Transaction_DeclareV3_{ DeclareV3: &spec.Transaction_DeclareV3{ - Sender: AdaptAddress(tx.SenderAddress), - MaxFee: AdaptFelt(tx.MaxFee), + Sender: AdaptAddress(tx.SenderAddress), + // MaxFee: AdaptFelt(tx.MaxFee), // todo support max_fee? Signature: AdaptAccountSignature(tx.Signature()), ClassHash: AdaptHash(tx.ClassHash), Nonce: AdaptFelt(tx.Nonce), CompiledClassHash: AdaptFelt(tx.CompiledClassHash), - L1Gas: adaptResourceLimits(tx.ResourceBounds[core.ResourceL1Gas]), - L2Gas: adaptResourceLimits(tx.ResourceBounds[core.ResourceL2Gas]), + ResourceBounds: adaptResourceBounds(tx.ResourceBounds), Tip: AdaptFelt(new(felt.Felt).SetUint64(tx.Tip)), - Paymaster: nil, - NonceDomain: fmt.Sprintf("%v", tx.NonceDAMode), - FeeDomain: fmt.Sprintf("%v", tx.FeeDAMode), + // Paymaster: nil, // todo support paymaster? + NonceDomain: fmt.Sprintf("%v", tx.NonceDAMode), + FeeDomain: fmt.Sprintf("%v", tx.FeeDAMode), }, } default: @@ -129,15 +127,14 @@ func AdaptTransaction(transaction core.Transaction) *spec.Transaction { case tx.Version.Is(3): specTx.Txn = &spec.Transaction_InvokeV3_{ InvokeV3: &spec.Transaction_InvokeV3{ - Sender: AdaptAddress(tx.SenderAddress), - MaxFee: AdaptFelt(tx.MaxFee), - Signature: AdaptAccountSignature(tx.Signature()), - Calldata: AdaptFeltSlice(tx.CallData), - Nonce: AdaptFelt(tx.Nonce), - L1Gas: adaptResourceLimits(tx.ResourceBounds[core.ResourceL1Gas]), - L2Gas: adaptResourceLimits(tx.ResourceBounds[core.ResourceL2Gas]), - Tip: AdaptFelt(new(felt.Felt).SetUint64(tx.Tip)), - Paymaster: nil, + Sender: AdaptAddress(tx.SenderAddress), + // MaxFee: AdaptFelt(tx.MaxFee), // todo support max_fee? + Signature: AdaptAccountSignature(tx.Signature()), + Calldata: AdaptFeltSlice(tx.CallData), + Nonce: AdaptFelt(tx.Nonce), + ResourceBounds: adaptResourceBounds(tx.ResourceBounds), + Tip: AdaptFelt(new(felt.Felt).SetUint64(tx.Tip)), + // Paymaster: nil, // todo support paymaster? NonceDomain: fmt.Sprintf("%v", tx.NonceDAMode), FeeDomain: fmt.Sprintf("%v", tx.FeeDAMode), }, @@ -160,6 +157,13 @@ func adaptResourceLimits(bounds core.ResourceBounds) *spec.ResourceLimits { } } +func adaptResourceBounds(rb map[core.Resource]core.ResourceBounds) *spec.ResourceBounds { + return &spec.ResourceBounds{ + L1Gas: adaptResourceLimits(rb[core.ResourceL1Gas]), + L2Gas: adaptResourceLimits(rb[core.ResourceL2Gas]), + } +} + func adaptDeployTransaction(tx *core.DeployTransaction) *spec.Transaction_Deploy_ { return &spec.Transaction_Deploy_{ Deploy: &spec.Transaction_Deploy{ @@ -172,7 +176,7 @@ func adaptDeployTransaction(tx *core.DeployTransaction) *spec.Transaction_Deploy func adaptL1HandlerTransaction(tx *core.L1HandlerTransaction) *spec.Transaction_L1Handler { return &spec.Transaction_L1Handler{ - L1Handler: &spec.Transaction_L1HandlerV1{ + L1Handler: &spec.Transaction_L1HandlerV0{ Nonce: AdaptFelt(tx.Nonce), Address: AdaptAddress(tx.ContractAddress), EntryPointSelector: AdaptFelt(tx.EntryPointSelector), diff --git a/adapters/p2p2core/block.go b/adapters/p2p2core/block.go index 9d4c0c62be..b3b000415e 100644 --- a/adapters/p2p2core/block.go +++ b/adapters/p2p2core/block.go @@ -23,7 +23,8 @@ func AdaptSignature(cs *spec.ConsensusSignature) []*felt.Felt { return []*felt.Felt{AdaptFelt(cs.R), AdaptFelt(cs.S)} } -func AdaptBlockHeader(h *spec.BlockHeader) core.Header { +func AdaptBlockHeader(h *spec.SignedBlockHeader) core.Header { + // todo double check all values return core.Header{ Hash: nil, // todo: add this when building the block ParentHash: AdaptHash(h.ParentHash), @@ -32,7 +33,7 @@ func AdaptBlockHeader(h *spec.BlockHeader) core.Header { SequencerAddress: AdaptAddress(h.SequencerAddress), TransactionCount: uint64(h.Transactions.NLeaves), EventCount: uint64(h.Events.NLeaves), - Timestamp: uint64(h.Time.AsTime().Unix()), + Timestamp: h.Time, ProtocolVersion: h.ProtocolVersion, EventsBloom: nil, // Todo: add this in when building the block GasPrice: AdaptFelt(h.GasPrice), diff --git a/adapters/p2p2core/state.go b/adapters/p2p2core/state.go index fa6e857c37..bb5ca5df92 100644 --- a/adapters/p2p2core/state.go +++ b/adapters/p2p2core/state.go @@ -10,6 +10,16 @@ import ( ) func AdaptStateDiff(s *spec.StateDiff, classes []*spec.Class) *core.StateDiff { + /** + + Address *Address `protobuf:"bytes,1,opt,name=address,proto3" json:"address,omitempty"` + Nonce *Felt252 `protobuf:"bytes,2,opt,name=nonce,proto3,oneof" json:"nonce,omitempty"` // Present only if the nonce was updated + ClassHash *Hash `protobuf:"bytes,3,opt,name=class_hash,json=classHash,proto3,oneof" json:"class_hash,omitempty"` // Present only if the contract was deployed or replaced in this block. + IsReplaced *bool `protobuf:"varint,4,opt,name=is_replaced,json=isReplaced,proto3,oneof" json:"is_replaced,omitempty"` // Present only if the contract was deployed or replaced, in order to determine whether the contract was deployed or replaced. + Values []*ContractStoredValue `protobuf:"bytes,5,rep,name=values,proto3" json:"values,omitempty"` + Domain uint32 + */ + var ( declaredV0Classes []*felt.Felt declaredV1Classes = make(map[felt.Felt]*felt.Felt) diff --git a/adapters/p2p2core/transaction.go b/adapters/p2p2core/transaction.go index b8506a55b4..3a9cd53400 100644 --- a/adapters/p2p2core/transaction.go +++ b/adapters/p2p2core/transaction.go @@ -83,17 +83,17 @@ func AdaptTransaction(t *spec.Transaction, network *utils.Network) core.Transact } declareTx := &core.DeclareTransaction{ - ClassHash: AdaptHash(tx.ClassHash), - SenderAddress: AdaptAddress(tx.Sender), - MaxFee: AdaptFelt(tx.MaxFee), + ClassHash: AdaptHash(tx.ClassHash), + SenderAddress: AdaptAddress(tx.Sender), + // MaxFee: AdaptFelt(tx.MaxFee), todo either remove or add support for max_fee TransactionSignature: adaptAccountSignature(tx.Signature), Nonce: AdaptFelt(tx.Nonce), Version: txVersion(3), CompiledClassHash: AdaptFelt(tx.CompiledClassHash), Tip: AdaptFelt(tx.Tip).Uint64(), ResourceBounds: map[core.Resource]core.ResourceBounds{ - core.ResourceL1Gas: adaptResourceLimits(tx.L1Gas), - core.ResourceL2Gas: adaptResourceLimits(tx.L2Gas), + core.ResourceL1Gas: adaptResourceLimits(tx.ResourceBounds.L1Gas), + core.ResourceL2Gas: adaptResourceLimits(tx.ResourceBounds.L2Gas), }, PaymasterData: nil, // Todo: P2P needs to change the pay master data to a list AccountDeploymentData: nil, // Todo: update p2p spec to include this @@ -164,13 +164,13 @@ func AdaptTransaction(t *spec.Transaction, network *utils.Network) core.Transact ConstructorCallData: callData, Version: txVersion(3), }, - MaxFee: AdaptFelt(tx.MaxFee), + // MaxFee: AdaptFelt(tx.MaxFee), // todo support max_fee? TransactionSignature: adaptAccountSignature(tx.Signature), Nonce: AdaptFelt(tx.Nonce), Tip: AdaptFelt(tx.Tip).Uint64(), ResourceBounds: map[core.Resource]core.ResourceBounds{ - core.ResourceL1Gas: adaptResourceLimits(tx.L1Gas), - core.ResourceL2Gas: adaptResourceLimits(tx.L2Gas), + core.ResourceL1Gas: adaptResourceLimits(tx.ResourceBounds.L1Gas), + core.ResourceL2Gas: adaptResourceLimits(tx.ResourceBounds.L2Gas), }, PaymasterData: nil, // Todo: P2P needs to change the pay master data to a list NonceDAMode: core.DataAvailabilityMode(nDAMode), @@ -226,15 +226,15 @@ func AdaptTransaction(t *spec.Transaction, network *utils.Network) core.Transact ContractAddress: nil, // is it ok? CallData: utils.Map(tx.Calldata, AdaptFelt), TransactionSignature: adaptAccountSignature(tx.Signature), - MaxFee: AdaptFelt(tx.MaxFee), - Version: txVersion(3), - Nonce: AdaptFelt(tx.Nonce), - SenderAddress: AdaptAddress(tx.Sender), - EntryPointSelector: nil, - Tip: AdaptFelt(tx.Tip).Uint64(), + // MaxFee: AdaptFelt(tx.MaxFee), todo support max_fee? + Version: txVersion(3), + Nonce: AdaptFelt(tx.Nonce), + SenderAddress: AdaptAddress(tx.Sender), + EntryPointSelector: nil, + Tip: AdaptFelt(tx.Tip).Uint64(), ResourceBounds: map[core.Resource]core.ResourceBounds{ - core.ResourceL1Gas: adaptResourceLimits(tx.L1Gas), - core.ResourceL2Gas: adaptResourceLimits(tx.L2Gas), + core.ResourceL1Gas: adaptResourceLimits(tx.ResourceBounds.L1Gas), + core.ResourceL2Gas: adaptResourceLimits(tx.ResourceBounds.L2Gas), }, PaymasterData: nil, // Todo: P2P needs to change the pay master data to a list NonceDAMode: core.DataAvailabilityMode(nDAMode), diff --git a/p2p/starknet/buf.gen.yaml b/p2p/starknet/buf.gen.yaml new file mode 100644 index 0000000000..86cf20f336 --- /dev/null +++ b/p2p/starknet/buf.gen.yaml @@ -0,0 +1,5 @@ +version: v1beta1 +plugins: + - name: go + out: spec + opt: paths=source_relative,M=somepackage \ No newline at end of file diff --git a/p2p/starknet/handlers.go b/p2p/starknet/handlers.go index e15e3d5930..1299739b35 100644 --- a/p2p/starknet/handlers.go +++ b/p2p/starknet/handlers.go @@ -7,11 +7,10 @@ import ( "fmt" "sync" - "github.com/NethermindEth/juno/core" - "github.com/NethermindEth/juno/adapters/core2p2p" "github.com/NethermindEth/juno/adapters/p2p2core" "github.com/NethermindEth/juno/blockchain" + "github.com/NethermindEth/juno/core" "github.com/NethermindEth/juno/p2p/starknet/spec" "github.com/NethermindEth/juno/utils" "github.com/NethermindEth/juno/utils/iter" @@ -22,15 +21,21 @@ import ( type Handler struct { bcReader blockchain.Reader - ctx context.Context log utils.SimpleLogger + + ctx context.Context + cancel context.CancelFunc + wg sync.WaitGroup } func NewHandler(bcReader blockchain.Reader, log utils.SimpleLogger) *Handler { + ctx, cancel := context.WithCancel(context.Background()) return &Handler{ bcReader: bcReader, log: log, - ctx: context.Background(), + ctx: ctx, + cancel: cancel, + wg: sync.WaitGroup{}, } } @@ -47,9 +52,12 @@ func getBuffer() *bytes.Buffer { return buffer } -func streamHandler[ReqT proto.Message](ctx context.Context, stream network.Stream, - reqHandler func(req ReqT) (iter.Seq[proto.Message], error), log utils.SimpleLogger, +func streamHandler[ReqT proto.Message](ctx context.Context, wg *sync.WaitGroup, + stream network.Stream, reqHandler func(req ReqT) (iter.Seq[proto.Message], error), log utils.SimpleLogger, ) { + wg.Add(1) + defer wg.Done() + defer func() { if err := stream.Close(); err != nil { log.Debugw("Error closing stream", "peer", stream.ID(), "protocol", stream.Protocol(), "err", err) @@ -97,27 +105,27 @@ func streamHandler[ReqT proto.Message](ctx context.Context, stream network.Strea } func (h *Handler) BlockHeadersHandler(stream network.Stream) { - streamHandler[*spec.BlockHeadersRequest](h.ctx, stream, h.onBlockHeadersRequest, h.log) + streamHandler[*spec.BlockHeadersRequest](h.ctx, &h.wg, stream, h.onBlockHeadersRequest, h.log) } func (h *Handler) BlockBodiesHandler(stream network.Stream) { - streamHandler[*spec.BlockBodiesRequest](h.ctx, stream, h.onBlockBodiesRequest, h.log) + streamHandler[*spec.BlockBodiesRequest](h.ctx, &h.wg, stream, h.onBlockBodiesRequest, h.log) } func (h *Handler) EventsHandler(stream network.Stream) { - streamHandler[*spec.EventsRequest](h.ctx, stream, h.onEventsRequest, h.log) + streamHandler[*spec.EventsRequest](h.ctx, &h.wg, stream, h.onEventsRequest, h.log) } func (h *Handler) ReceiptsHandler(stream network.Stream) { - streamHandler[*spec.ReceiptsRequest](h.ctx, stream, h.onReceiptsRequest, h.log) + streamHandler[*spec.ReceiptsRequest](h.ctx, &h.wg, stream, h.onReceiptsRequest, h.log) } func (h *Handler) TransactionsHandler(stream network.Stream) { - streamHandler[*spec.TransactionsRequest](h.ctx, stream, h.onTransactionsRequest, h.log) + streamHandler[*spec.TransactionsRequest](h.ctx, &h.wg, stream, h.onTransactionsRequest, h.log) } func (h *Handler) CurrentBlockHeaderHandler(stream network.Stream) { - streamHandler[*spec.CurrentBlockHeaderRequest](h.ctx, stream, h.onCurrentBlockHeaderRequest, h.log) + streamHandler[*spec.CurrentBlockHeaderRequest](h.ctx, &h.wg, stream, h.onCurrentBlockHeaderRequest, h.log) } func (h *Handler) onCurrentBlockHeaderRequest(*spec.CurrentBlockHeaderRequest) (iter.Seq[proto.Message], error) { @@ -305,10 +313,12 @@ type blockDataAccessor interface { // given block data for current iteration through blockDataAccessor type iterationProcessor = func(it blockDataAccessor) (proto.Message, error) -// processIterationRequest is helper function that simplifies data processing for provided spec.Iteration object +// processIterationRequest is helper method that simplifies data processing for provided spec.Iteration object // caller usually passes iteration object from received request, finMsg as final message to a peer // and iterationProcessor function that will generate response for each iteration -func (h *Handler) processIterationRequest(iteration *spec.Iteration, finMsg proto.Message, f iterationProcessor) (iter.Seq[proto.Message], error) { +func (h *Handler) processIterationRequest( + iteration *spec.Iteration, finMsg proto.Message, f iterationProcessor, +) (iter.Seq[proto.Message], error) { it, err := h.newIterator(iteration) if err != nil { return nil, err @@ -353,3 +363,11 @@ func (h *Handler) newIterator(it *spec.Iteration) (*iterator, error) { return nil, fmt.Errorf("unsupported iteration start type %T", v) } } + +func (h *Handler) Close() { + fmt.Println("Canceling") + h.cancel() + fmt.Println("Waiting") + h.wg.Wait() + fmt.Println("Done") +} diff --git a/p2p/starknet/p2p/proto/block.proto b/p2p/starknet/p2p/proto/block.proto deleted file mode 100644 index 46c19fb7ce..0000000000 --- a/p2p/starknet/p2p/proto/block.proto +++ /dev/null @@ -1,86 +0,0 @@ -syntax = "proto3"; -import "p2p/proto/common.proto"; -import "p2p/proto/state.proto"; -import "google/protobuf/timestamp.proto"; - -// for now, we assume a small consensus, so this fits in 1M. Else, these will be repeated -message Signatures { - BlockID block = 1; - - repeated ConsensusSignature signatures = 2; // - // can be more explicit here about the signature structure as this is not part of account abstraction -} - -// Note: commitments may change to be for the previous blocks like comet/tendermint -// hash of block header sent to L1 -message BlockHeader { - 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; - Merkle state_diffs = 5; // By order of (contract, key), taking last in case of duplicates. - // This means the proposer needs to sort after finishing the block (TBD: patricia? ) - // State is optional and appears every X blocks for the last block. This is to support - // snapshot sync and also so that light nodes can sync on state without state diffs. - Patricia state = 6; // hash of contract and class patricia tries. Same as in L1. Later more trees will be included - Hash proof_fact = 7; // for Kth block behind. A hash of the output of the proof - - // The following merkles can be built on the fly while sequencing/validating txs. - 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 { - bytes proof = 1; // proof size is currently 142K -} - -// sent to all peers (except the ones this was received from, if any). -// for a fraction of peers, also send the GetBlockHeaders and GetBlockBodies response (as if they asked for it for this block) -message NewBlock { - oneof maybe_full { - BlockID id = 1; - BlockHeadersResponse header = 2; - BlockBodiesResponse body = 3; - } -} - -// Requests a peer's CurrentBlockHeader -message CurrentBlockHeaderRequest {} - -// result is (BlockHeader, Signature?)* in order of creation (incr/dec) -message BlockHeadersRequest { - Iteration iteration = 1; -} - -message BlockHeadersResponsePart { - oneof header_message { - BlockHeader header = 1; - Signatures signatures = 2; - Fin fin = 3; // no support for interleaving for now - } -} - -message BlockHeadersResponse { - repeated BlockHeadersResponsePart part = 1; -} - -// result is (StateDiff*, Classes*, BlockProof?)* currently in creation order (incr/dec), but may change in the future -message BlockBodiesRequest { - Iteration iteration = 1; -} - -message BlockBodiesResponse { - optional BlockID id = 1; // may not appear if Fin is sent to end the whole response - - oneof body_message { - StateDiff diff = 2; - Classes classes = 3; - BlockProof proof = 4; - Fin fin = 5; - } -} - - diff --git a/p2p/starknet/p2p/proto/class.proto b/p2p/starknet/p2p/proto/class.proto new file mode 100644 index 0000000000..9db01b34b9 --- /dev/null +++ b/p2p/starknet/p2p/proto/class.proto @@ -0,0 +1,62 @@ +syntax = "proto3"; +import "p2p/proto/common.proto"; + +option go_package = "github.com/NethermindEth/juno/p2p/starknet/spec"; + + +message EntryPoint { + Felt252 selector = 1; + Felt252 offset = 2; +} + +message Cairo0Class { + bytes abi = 1; + repeated EntryPoint externals = 2; + repeated EntryPoint l1_handlers = 3; + repeated EntryPoint constructors = 4; + bytes program = 5; +} + +message SierraEntryPoint { + uint64 index = 1; + Felt252 selector = 2; +} + +message Cairo1EntryPoints { + repeated SierraEntryPoint externals = 1; + repeated SierraEntryPoint l1_handlers = 2; + repeated SierraEntryPoint constructors = 3; +} + +message Cairo1Class { + bytes abi = 1; + Cairo1EntryPoints entry_points = 2; + repeated Felt252 program = 3; + string contract_class_version = 4; + bytes compiled = 5; +} + +// is it better to separate the definition from the hashes? (will need to repeate the hashes +// for the definitions stream) +// or, make the definitions optional? maybe it is enough to know only that a class exists, not its definition +// which may be fetched lazily later. +message Class { + oneof class { + Cairo0Class cairo0 = 1; + Cairo1Class cairo1 = 2; + } + uint32 domain = 3; + Hash class_hash = 4; +} + +message ClassesRequest { + Iteration iteration = 1; +} + +// Responses are sent ordered by the order given in the request. +message ClassesResponse { + oneof class_message { + Class class = 1; + Fin fin = 2; // Fin is sent after the peer sent all the data or when it encountered a block that it doesn't have its classes. + } +} \ No newline at end of file diff --git a/p2p/starknet/p2p/proto/common.proto b/p2p/starknet/p2p/proto/common.proto index 88b5744519..f11d0aa20f 100644 --- a/p2p/starknet/p2p/proto/common.proto +++ b/p2p/starknet/p2p/proto/common.proto @@ -1,5 +1,7 @@ syntax = "proto3"; +option go_package = "github.com/NethermindEth/juno/p2p/starknet/spec"; + message Felt252 { bytes elements = 1; } @@ -27,7 +29,7 @@ message ConsensusSignature { message Merkle { uint32 n_leaves = 1; // needed to know the height, so as to how many nodes to expect in a proof. - // and also when receiving all leaves, how many to expect + // and also when receiving all leaves, how many to expect Hash root = 2; } @@ -58,17 +60,4 @@ message Iteration { // mark the end of a stream of messages // TBD: may not be required if we open a stream per request. -message Fin { - enum Error { - busy = 0; - too_much = 1; - unknown = 2; - pruned = 3; - } - optional Error error = 1; -} - - - - - +message Fin {} \ No newline at end of file diff --git a/p2p/starknet/p2p/proto/discovery.proto b/p2p/starknet/p2p/proto/discovery.proto deleted file mode 100644 index 50ef44887e..0000000000 --- a/p2p/starknet/p2p/proto/discovery.proto +++ /dev/null @@ -1,19 +0,0 @@ -syntax = "proto3"; - -import "p2p/proto/common.proto"; - -// do we need this? capabilities are protocols (but need arguments, e.g. history length) -/* -message NewNode -{ - PeerID id = 1; - - repeated string capabilities = 2; -} - -message KnownNodes -{ - PeerID id = 1; //id of publishing node - repeated PeerID nodes = 2; //nodes known to the publishing node -} -*/ diff --git a/p2p/starknet/p2p/proto/event.proto b/p2p/starknet/p2p/proto/event.proto index 00cb57dea0..ef3dedf8f2 100644 --- a/p2p/starknet/p2p/proto/event.proto +++ b/p2p/starknet/p2p/proto/event.proto @@ -1,6 +1,8 @@ syntax = "proto3"; import "p2p/proto/common.proto"; +option go_package = "github.com/NethermindEth/juno/p2p/starknet/spec"; + message Event { Hash transaction_hash = 1; Felt252 from_address = 2; @@ -12,16 +14,10 @@ message EventsRequest { Iteration iteration = 1; } -message Events { - repeated Event items = 1; -} - -// can be several in a single reply +// Responses are sent ordered by the order given in the request. message EventsResponse { - optional BlockID id = 1; // may not appear if Fin is sent to end the whole response - - oneof responses { - Events events = 2; - Fin fin = 3; + oneof event_message { + Event event = 1; + Fin fin = 2; // Fin is sent after the peer sent all the data or when it encountered a block that it doesn't have its events. } -} +} \ No newline at end of file diff --git a/p2p/starknet/p2p/proto/header.proto b/p2p/starknet/p2p/proto/header.proto new file mode 100644 index 0000000000..4efe2041d2 --- /dev/null +++ b/p2p/starknet/p2p/proto/header.proto @@ -0,0 +1,52 @@ +syntax = "proto3"; +import "p2p/proto/common.proto"; + +option go_package = "github.com/NethermindEth/juno/p2p/starknet/spec"; + +// Note: commitments may change to be for the previous blocks like comet/tendermint +// hash of block header sent to L1 +message SignedBlockHeader { + Hash block_hash = 1; // For the structure of the block hash, see https://docs.starknet.io/documentation/architecture_and_concepts/Network_Architecture/header/#block_hash + Hash parent_hash = 2; + uint64 number = 3; + uint64 time = 4; // Encoded in Unix time. + Address sequencer_address = 5; + Hash state_diff_commitment = 6; // The state diff commitment returned by the Starknet Feeder Gateway. + // For more info, see https://community.starknet.io/t/introducing-p2p-authentication-and-mismatch-resolution-in-v0-12-2/97993 + Patricia state = 7; // hash of contract and class patricia tries. Same as in L1. Later more trees will be included + // The following merkles can be built on the fly while sequencing/validating txs. + 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; + uint64 num_storage_diffs = 13; + uint64 num_nonce_updates = 14; + uint64 num_declared_classes = 15; // Includes both Cairo 0 and Cairo 1. + uint64 num_deployed_contracts = 16; // This includes the replaced classes too. + // for now, we assume a small consensus, so this fits in 1M. Else, these will be repeated and extracted from this message. + repeated ConsensusSignature signatures = 17; + // can be more explicit here about the signature structure as this is not part of account abstraction +} + +// sent to all peers (except the ones this was received from, if any). +// for a fraction of peers, also send the GetBlockHeaders response (as if they asked for it for this block) +message NewBlock { + oneof maybe_full { + BlockID id = 1; + BlockHeadersResponse header = 2; + } +} + + +message BlockHeadersRequest { + Iteration iteration = 1; +} + +// Responses are sent ordered by the order given in the request. +message BlockHeadersResponse { + oneof header_message { + SignedBlockHeader header = 1; + Fin fin = 2; // Fin is sent after the peer sent all the data or when it encountered a block that it doesn't have its header. + } +} \ No newline at end of file diff --git a/p2p/starknet/p2p/proto/mempool.proto b/p2p/starknet/p2p/proto/mempool.proto deleted file mode 100644 index fc8b4dd4cb..0000000000 --- a/p2p/starknet/p2p/proto/mempool.proto +++ /dev/null @@ -1,30 +0,0 @@ -syntax = "proto3"; - -import "p2p/proto/common.proto"; -import "p2p/proto/transaction.proto"; - -// Support also non-validating node that wants to know of the mempool (e.g. to estimate fee in case of first price) -// Result is PooledTransactions+ -message PooledTransactionsRequest -{ - message Known { - oneof known { - Hashes txs = 1; // for mempool of 2000 txs, this will be 64K. Can use Hash32 instead (8K)... - uint64 marker = 2; // since last returned marker. - } - } - optional Known known = 1; -} - -// Can be also a push, similar to NewBlock. So a full node that accepts a new transaction from a wallet -// can propagate it without being pulled -// nodes should track state diffs to know when txs have been included (the contract nonce increases) -message PolledTransactionsResponse { - optional uint64 marker = 1; // optional, if the peer supports that. - bool baseline = 2; // means treat all data as baseline, not diff (may be if 'known' was sent but the mempool was reset/reorged - - oneof responses { - Transactions pending = 3; // if 'known' is given, they will be only txs added after the known - Fin fin = 4; - } -} diff --git a/p2p/starknet/p2p/proto/receipt.proto b/p2p/starknet/p2p/proto/receipt.proto index 74e36d876d..76a898897c 100644 --- a/p2p/starknet/p2p/proto/receipt.proto +++ b/p2p/starknet/p2p/proto/receipt.proto @@ -1,6 +1,8 @@ syntax = "proto3"; import "p2p/proto/common.proto"; +option go_package = "github.com/NethermindEth/juno/p2p/starknet/spec"; + message MessageToL1 { Felt252 from_address = 1; repeated Felt252 payload = 2; @@ -11,14 +13,6 @@ message EthereumAddress { bytes elements = 1; } -message MessageToL2 { - EthereumAddress from_address = 1; - repeated Felt252 payload = 2; - Felt252 to_address = 3; - Felt252 entry_point_selector = 4; - Felt252 nonce = 5; -} - message Receipt { message ExecutionResources { message BuiltinCounter { @@ -43,7 +37,6 @@ message Receipt { repeated MessageToL1 messages_sent = 3; ExecutionResources execution_resources = 4; string revert_reason = 5; - optional MessageToL2 consumed_message = 6; } @@ -84,14 +77,13 @@ message ReceiptsRequest { } message Receipts { - repeated Receipt items = 2; + repeated Receipt items = 2; } +// Responses are sent ordered by the order given in the request. message ReceiptsResponse { - optional BlockID id = 1; // may not appear if Fin is sent to end the whole response - - oneof responses { - Receipts receipts = 2; - Fin fin = 3; + oneof receipt_message { + Receipt receipt = 1; + Fin fin = 2; // Fin is sent after the peer sent all the data or when it encountered a block that it doesn't have its receipts. } -} +} \ No newline at end of file diff --git a/p2p/starknet/p2p/proto/snapshot.proto b/p2p/starknet/p2p/proto/snapshot.proto deleted file mode 100644 index 3f866747f9..0000000000 --- a/p2p/starknet/p2p/proto/snapshot.proto +++ /dev/null @@ -1,109 +0,0 @@ -syntax = "proto3"; - -import "p2p/proto/common.proto"; -import "p2p/proto/state.proto"; - -message PatriciaNode { - message Edge { - uint32 length = 1; - Felt252 path = 2; // as bits of left/right - Felt252 value = 3; - } - message Binary { - Felt252 left = 1; - Felt252 right = 2; - } - - oneof node { - Edge edge = 1; - Binary binary = 2; - } -} - -// non leaf nodes required to build the trie given the range (leaves) -message PatriciaRangeProof { - repeated PatriciaNode nodes = 1; -} - -// leafs of the contract state tree -message ContractState { - Address address = 1; // the key - Hash class = 2; - Hash storage = 3; // patricia - uint64 nonce = 4; -} - -// request a range from the contract state tree that matches the given root (block) -// starts at 'start' and ends no more than 'end'. -// the result is (ContractRange+, PatriciaRangeProof)* -message ContractRangeRequest { - uint32 domain = 1; // volition - Hash state_root = 2; - Address start = 3; - Address end = 4; - uint32 chunks_per_proof = 5; // how many ContractRange items to send before sending a proof -} - -// stream of leaves in the contracts tree -message ContractRange { - repeated ContractState state = 1; -} - -message ContractRangeResponse { - optional Hash root = 1; // may not appear if Fin is sent to end the whole response - optional Hash contracts_root = 2;// may not appear if Fin is sent to end the whole response - optional Hash classes_root = 3;// may not appear if Fin is sent to end the whole response - oneof responses { - ContractRange range = 4; - Fin fin = 5; - } -} - -// duplicate of GetContractRange. Can introduce a 'type' instead. -// result is (Classes+, PatriciaRangeProof)* -message ClassRangeRequest { - Hash root = 1; - Hash start = 2; - Hash end = 3; - uint32 chunks_per_proof = 4; -} - -message ClassRangeResponse { - optional Hash root = 1; // may not appear if Fin is sent to end the whole response - optional Hash contracts_root = 2;// may not appear if Fin is sent to end the whole response - optional Hash classes_root = 3;// may not appear if Fin is sent to end the whole response - oneof responses { - Classes classes = 4; - Fin fin = 5; - } -} - -// A position in some contract's state tree is identified by the state tree's root and the key in it -message StorageLeafQuery { - Hash contract_storage_root = 1; - Felt252 key = 2; -} - -message StorageRangeQuery { - StorageLeafQuery start = 1; - StorageLeafQuery end = 2; -} - -// result is (ContractStorageRange+, PatriciaRangeProof)* -message ContractStorageRequest { - uint32 domain = 1; // volition - Hash state_root = 2; - repeated StorageRangeQuery query = 3; -} - -message ContractStorage { - repeated ContractStoredValue keyValue = 2; -} - -message ContractStorageResponse { - optional Hash state_root = 1; // may not appear if Fin is sent to end the whole response - oneof responses { - ContractStorage storage = 2; - Fin fin = 3; - } -} diff --git a/p2p/starknet/p2p/proto/state.proto b/p2p/starknet/p2p/proto/state.proto index 9415db619e..a7834e6e6c 100644 --- a/p2p/starknet/p2p/proto/state.proto +++ b/p2p/starknet/p2p/proto/state.proto @@ -1,6 +1,7 @@ syntax = "proto3"; import "p2p/proto/common.proto"; +option go_package = "github.com/NethermindEth/juno/p2p/starknet/spec"; // optimized for flat storage, not through a trie (not sharing key prefixes) message ContractStoredValue { @@ -8,71 +9,24 @@ message ContractStoredValue { Felt252 value = 2; } -message StateDiff -{ - // a bit more efficient than the state sync separation - message ContractDiff { - Address address = 1; - optional Felt252 nonce = 2; - optional Felt252 class_hash = 3; // can change for replace_class or new contract - 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 { - Felt252 selector = 1; - Felt252 offset = 2; -} - -message Cairo0Class { - bytes abi = 1; - repeated EntryPoint externals = 2; - repeated EntryPoint l1_handlers = 3; - repeated EntryPoint constructors = 4; - bytes program = 5; -} - -message SierraEntryPoint { - uint64 index = 1; - Felt252 selector = 2; +message ContractDiff { + Address address = 1; + optional Felt252 nonce = 2; // Present only if the nonce was updated + optional Hash class_hash = 3; // Present only if the contract was deployed or replaced in this block. + optional bool is_replaced = 4; // Present only if the contract was deployed or replaced, in order to determine whether the contract was deployed or replaced. + repeated ContractStoredValue values = 5; + uint32 domain = 6; // volition state domain } -message Cairo1EntryPoints { - repeated SierraEntryPoint externals = 1; - repeated SierraEntryPoint l1_handlers = 2; - repeated SierraEntryPoint constructors = 3; +message StateDiffsRequest { + Iteration iteration = 1; } -message Cairo1Class { - bytes abi = 1; - Cairo1EntryPoints entry_points = 2; - repeated Felt252 program = 3; - string contract_class_version = 4; - bytes compiled = 5; -} - -// is it better to separate the definition from the hashes? (will need to repeate the hashes -// for the definitions stream) -// or, make the definitions optional? maybe it is enough to know only that a class exists, not its definition -// which may be fetched lazily later. -message Class { - oneof class { - Cairo0Class cairo0 = 1; - Cairo1Class cairo1 = 2; +// Responses are sent ordered by the order given in the request. +message StateDiffsResponse { + // All of the messages related to a block need to be sent before a message from the next block is sent. + oneof state_diff_message { + ContractDiff contract_diff = 1; // Multiple contract diffs for the same contract may appear continuously if the diff is too large. + Fin fin = 2; // Fin is sent after the peer sent all the data or when it encountered a block that it doesn't have its state diff. } -} - -message Classes { - uint32 domain = 1; - repeated Class classes = 2; } \ No newline at end of file diff --git a/p2p/starknet/p2p/proto/transaction.proto b/p2p/starknet/p2p/proto/transaction.proto index 5877b12517..249c3b5a85 100644 --- a/p2p/starknet/p2p/proto/transaction.proto +++ b/p2p/starknet/p2p/proto/transaction.proto @@ -1,11 +1,18 @@ syntax = "proto3"; import "p2p/proto/common.proto"; +option go_package = "github.com/NethermindEth/juno/p2p/starknet/spec"; + message ResourceLimits { Felt252 max_amount = 1; Felt252 max_price_per_unit = 2; } +message ResourceBounds { + ResourceLimits l1_gas = 1; + ResourceLimits l2_gas = 2; +} + message AccountSignature { repeated Felt252 parts = 1; } @@ -36,25 +43,26 @@ message Transaction Felt252 compiled_class_hash = 6; } + // see https://external.integration.starknet.io/feeder_gateway/get_transaction?transactionHash=0x41d1f5206ef58a443e7d3d1ca073171ec25fa75313394318fc83a074a6631c3 message DeclareV3 { - Address sender = 1; - Felt252 max_fee = 2; - AccountSignature signature = 3; - Hash class_hash = 4; - Felt252 nonce = 5; - Felt252 compiled_class_hash = 6; - ResourceLimits l1_gas = 7; - ResourceLimits l2_gas = 8; - Felt252 tip = 9; - Address paymaster = 10; - string nonce_domain = 11; - string fee_domain = 12; + Address sender = 1; + AccountSignature signature = 2; + Hash class_hash = 3; + Felt252 nonce = 4; + Felt252 compiled_class_hash = 5; + ResourceBounds resource_bounds = 6; + Felt252 tip = 7; + Address paymaster_data = 8; + Address account_deployment_data = 9; + string nonce_domain = 10; // rename to nonce_data_availability_mode ? + string fee_domain = 11; // rename to fee_data_availability_mode ? } message Deploy { Hash class_hash = 1; Felt252 address_salt = 2; repeated Felt252 calldata = 3; + uint32 version = 4; } message DeployAccountV1 { @@ -66,19 +74,18 @@ message Transaction repeated Felt252 calldata = 6; } + // see https://external.integration.starknet.io/feeder_gateway/get_transaction?transactionHash=0x29fd7881f14380842414cdfdd8d6c0b1f2174f8916edcfeb1ede1eb26ac3ef0 message DeployAccountV3 { - Felt252 max_fee = 1; - AccountSignature signature = 2; - Hash class_hash = 3; - Felt252 nonce = 4; - Felt252 address_salt = 5; - repeated Felt252 calldata = 6; - ResourceLimits l1_gas = 7; - ResourceLimits l2_gas = 8; - Felt252 tip = 9; - Address paymaster = 10; - string nonce_domain = 11; - string fee_domain = 12; + AccountSignature signature = 1; + Hash class_hash = 2; + Felt252 nonce = 3; + Felt252 address_salt = 4; + repeated Felt252 calldata = 5; + ResourceBounds resource_bounds = 6; + Felt252 tip = 7; + Address paymaster_data = 8; + string nonce_domain = 9; // rename to nonce_data_availability_mode ? + string fee_domain = 10; // rename to fee_data_availability_mode ? } message InvokeV0 { @@ -97,21 +104,21 @@ message Transaction Felt252 nonce = 5; } + // see https://external.integration.starknet.io/feeder_gateway/get_transaction?transactionHash=0x41906f1c314cca5f43170ea75d3b1904196a10101190d2b12a41cc61cfd17c message InvokeV3 { - Address sender = 1; - Felt252 max_fee = 2; - AccountSignature signature = 3; - repeated Felt252 calldata = 4; - ResourceLimits l1_gas = 5; - ResourceLimits l2_gas = 6; - Felt252 tip = 7; - Address paymaster = 8; - string nonce_domain = 9; - string fee_domain = 10; - Felt252 nonce = 11; + Address sender = 1; + AccountSignature signature = 2; + repeated Felt252 calldata = 3; + ResourceBounds resource_bounds = 4; + Felt252 tip = 5; + Address paymaster_data = 6; + Address account_deployment_data = 7; + string nonce_domain = 8; // rename to nonce_data_availability_mode ? + string fee_domain = 9; // rename to fee_data_availability_mode ? + Felt252 nonce = 10; } - message L1HandlerV1 { + message L1HandlerV0 { Felt252 nonce = 1; Address address = 2; Felt252 entry_point_selector = 3; @@ -129,8 +136,9 @@ message Transaction InvokeV0 invoke_v0 = 8; InvokeV1 invoke_v1 = 9; InvokeV3 invoke_v3 = 10; - L1HandlerV1 l1_handler = 11; + L1HandlerV0 l1_handler = 11; } + Hash transaction_hash = 12; } // TBD: can support a flag to return tx hashes only, good for standalone mempool to remove them, @@ -139,16 +147,10 @@ message TransactionsRequest { Iteration iteration = 1; } -// can be several in a single reply -message Transactions { - repeated Transaction items = 1; -} - +// Responses are sent ordered by the order given in the request. message TransactionsResponse { - optional BlockID id = 1; // may not appear if Fin is sent to end the whole response - - oneof responses { - Transactions transactions = 2; - Fin fin = 3; + oneof transaction_message { + Transaction transaction = 1; + Fin fin = 2; // Fin is sent after the peer sent all the data or when it encountered a block that it doesn't have its transactions. } } \ No newline at end of file diff --git a/p2p/starknet/spec/block.pb.go b/p2p/starknet/spec/block.pb.go deleted file mode 100644 index 055ab743ea..0000000000 --- a/p2p/starknet/spec/block.pb.go +++ /dev/null @@ -1,1096 +0,0 @@ -// Code generated by protoc-gen-go. DO NOT EDIT. -// versions: -// protoc-gen-go v1.31.0 -// protoc v4.24.4 -// source: p2p/proto/block.proto - -package spec - -import ( - reflect "reflect" - sync "sync" - - protoreflect "google.golang.org/protobuf/reflect/protoreflect" - protoimpl "google.golang.org/protobuf/runtime/protoimpl" - timestamppb "google.golang.org/protobuf/types/known/timestamppb" -) - -const ( - // Verify that this generated code is sufficiently up-to-date. - _ = protoimpl.EnforceVersion(20 - protoimpl.MinVersion) - // Verify that runtime/protoimpl is sufficiently up-to-date. - _ = protoimpl.EnforceVersion(protoimpl.MaxVersion - 20) -) - -// for now, we assume a small consensus, so this fits in 1M. Else, these will be repeated -type Signatures struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - Block *BlockID `protobuf:"bytes,1,opt,name=block,proto3" json:"block,omitempty"` - Signatures []*ConsensusSignature `protobuf:"bytes,2,rep,name=signatures,proto3" json:"signatures,omitempty"` // -} - -func (x *Signatures) Reset() { - *x = Signatures{} - if protoimpl.UnsafeEnabled { - mi := &file_p2p_proto_block_proto_msgTypes[0] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *Signatures) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*Signatures) ProtoMessage() {} - -func (x *Signatures) ProtoReflect() protoreflect.Message { - mi := &file_p2p_proto_block_proto_msgTypes[0] - if protoimpl.UnsafeEnabled && x != nil { - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - if ms.LoadMessageInfo() == nil { - ms.StoreMessageInfo(mi) - } - return ms - } - return mi.MessageOf(x) -} - -// Deprecated: Use Signatures.ProtoReflect.Descriptor instead. -func (*Signatures) Descriptor() ([]byte, []int) { - return file_p2p_proto_block_proto_rawDescGZIP(), []int{0} -} - -func (x *Signatures) GetBlock() *BlockID { - if x != nil { - return x.Block - } - return nil -} - -func (x *Signatures) GetSignatures() []*ConsensusSignature { - if x != nil { - return x.Signatures - } - return nil -} - -// Note: commitments may change to be for the previous blocks like comet/tendermint -// hash of block header sent to L1 -type BlockHeader struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - ParentHash *Hash `protobuf:"bytes,1,opt,name=parent_hash,json=parentHash,proto3" json:"parent_hash,omitempty"` - Number uint64 `protobuf:"varint,2,opt,name=number,proto3" json:"number,omitempty"` - Time *timestamppb.Timestamp `protobuf:"bytes,3,opt,name=time,proto3" json:"time,omitempty"` // TODO: see if this needs to be Felt252 or can be converted - SequencerAddress *Address `protobuf:"bytes,4,opt,name=sequencer_address,json=sequencerAddress,proto3" json:"sequencer_address,omitempty"` - StateDiffs *Merkle `protobuf:"bytes,5,opt,name=state_diffs,json=stateDiffs,proto3" json:"state_diffs,omitempty"` // By order of (contract, key), taking last in case of duplicates. - // This means the proposer needs to sort after finishing the block (TBD: patricia? ) - // State is optional and appears every X blocks for the last block. This is to support - // snapshot sync and also so that light nodes can sync on state without state diffs. - State *Patricia `protobuf:"bytes,6,opt,name=state,proto3" json:"state,omitempty"` // hash of contract and class patricia tries. Same as in L1. Later more trees will be included - ProofFact *Hash `protobuf:"bytes,7,opt,name=proof_fact,json=proofFact,proto3" json:"proof_fact,omitempty"` // for Kth block behind. A hash of the output of the proof - // The following merkles can be built on the fly while sequencing/validating txs. - Transactions *Merkle `protobuf:"bytes,8,opt,name=transactions,proto3" json:"transactions,omitempty"` // By order of execution. TBD: required? the client can execute (powerful machine) and match state diff - Events *Merkle `protobuf:"bytes,9,opt,name=events,proto3" json:"events,omitempty"` // By order of issuance. TBD: in receipts? - Receipts *Merkle `protobuf:"bytes,10,opt,name=receipts,proto3" json:"receipts,omitempty"` // By order of issuance. - ProtocolVersion string `protobuf:"bytes,11,opt,name=protocol_version,json=protocolVersion,proto3" json:"protocol_version,omitempty"` // Starknet version - GasPrice *Felt252 `protobuf:"bytes,12,opt,name=gas_price,json=gasPrice,proto3" json:"gas_price,omitempty"` -} - -func (x *BlockHeader) Reset() { - *x = BlockHeader{} - if protoimpl.UnsafeEnabled { - mi := &file_p2p_proto_block_proto_msgTypes[1] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *BlockHeader) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*BlockHeader) ProtoMessage() {} - -func (x *BlockHeader) ProtoReflect() protoreflect.Message { - mi := &file_p2p_proto_block_proto_msgTypes[1] - if protoimpl.UnsafeEnabled && x != nil { - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - if ms.LoadMessageInfo() == nil { - ms.StoreMessageInfo(mi) - } - return ms - } - return mi.MessageOf(x) -} - -// Deprecated: Use BlockHeader.ProtoReflect.Descriptor instead. -func (*BlockHeader) Descriptor() ([]byte, []int) { - return file_p2p_proto_block_proto_rawDescGZIP(), []int{1} -} - -func (x *BlockHeader) GetParentHash() *Hash { - if x != nil { - return x.ParentHash - } - return nil -} - -func (x *BlockHeader) GetNumber() uint64 { - if x != nil { - return x.Number - } - return 0 -} - -func (x *BlockHeader) GetTime() *timestamppb.Timestamp { - if x != nil { - return x.Time - } - return nil -} - -func (x *BlockHeader) GetSequencerAddress() *Address { - if x != nil { - return x.SequencerAddress - } - return nil -} - -func (x *BlockHeader) GetStateDiffs() *Merkle { - if x != nil { - return x.StateDiffs - } - return nil -} - -func (x *BlockHeader) GetState() *Patricia { - if x != nil { - return x.State - } - return nil -} - -func (x *BlockHeader) GetProofFact() *Hash { - if x != nil { - return x.ProofFact - } - return nil -} - -func (x *BlockHeader) GetTransactions() *Merkle { - if x != nil { - return x.Transactions - } - return nil -} - -func (x *BlockHeader) GetEvents() *Merkle { - if x != nil { - return x.Events - } - return nil -} - -func (x *BlockHeader) GetReceipts() *Merkle { - if x != nil { - return x.Receipts - } - return nil -} - -func (x *BlockHeader) GetProtocolVersion() string { - if x != nil { - return x.ProtocolVersion - } - return "" -} - -func (x *BlockHeader) GetGasPrice() *Felt252 { - if x != nil { - return x.GasPrice - } - return nil -} - -type BlockProof struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - Proof []byte `protobuf:"bytes,1,opt,name=proof,proto3" json:"proof,omitempty"` // proof size is currently 142K -} - -func (x *BlockProof) Reset() { - *x = BlockProof{} - if protoimpl.UnsafeEnabled { - mi := &file_p2p_proto_block_proto_msgTypes[2] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *BlockProof) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*BlockProof) ProtoMessage() {} - -func (x *BlockProof) ProtoReflect() protoreflect.Message { - mi := &file_p2p_proto_block_proto_msgTypes[2] - if protoimpl.UnsafeEnabled && x != nil { - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - if ms.LoadMessageInfo() == nil { - ms.StoreMessageInfo(mi) - } - return ms - } - return mi.MessageOf(x) -} - -// Deprecated: Use BlockProof.ProtoReflect.Descriptor instead. -func (*BlockProof) Descriptor() ([]byte, []int) { - return file_p2p_proto_block_proto_rawDescGZIP(), []int{2} -} - -func (x *BlockProof) GetProof() []byte { - if x != nil { - return x.Proof - } - return nil -} - -// sent to all peers (except the ones this was received from, if any). -// for a fraction of peers, also send the GetBlockHeaders and GetBlockBodies response (as if they asked for it for this block) -type NewBlock struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - // Types that are assignable to MaybeFull: - // - // *NewBlock_Id - // *NewBlock_Header - // *NewBlock_Body - MaybeFull isNewBlock_MaybeFull `protobuf_oneof:"maybe_full"` -} - -func (x *NewBlock) Reset() { - *x = NewBlock{} - if protoimpl.UnsafeEnabled { - mi := &file_p2p_proto_block_proto_msgTypes[3] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *NewBlock) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*NewBlock) ProtoMessage() {} - -func (x *NewBlock) ProtoReflect() protoreflect.Message { - mi := &file_p2p_proto_block_proto_msgTypes[3] - if protoimpl.UnsafeEnabled && x != nil { - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - if ms.LoadMessageInfo() == nil { - ms.StoreMessageInfo(mi) - } - return ms - } - return mi.MessageOf(x) -} - -// Deprecated: Use NewBlock.ProtoReflect.Descriptor instead. -func (*NewBlock) Descriptor() ([]byte, []int) { - return file_p2p_proto_block_proto_rawDescGZIP(), []int{3} -} - -func (m *NewBlock) GetMaybeFull() isNewBlock_MaybeFull { - if m != nil { - return m.MaybeFull - } - return nil -} - -func (x *NewBlock) GetId() *BlockID { - if x, ok := x.GetMaybeFull().(*NewBlock_Id); ok { - return x.Id - } - return nil -} - -func (x *NewBlock) GetHeader() *BlockHeadersResponse { - if x, ok := x.GetMaybeFull().(*NewBlock_Header); ok { - return x.Header - } - return nil -} - -func (x *NewBlock) GetBody() *BlockBodiesResponse { - if x, ok := x.GetMaybeFull().(*NewBlock_Body); ok { - return x.Body - } - return nil -} - -type isNewBlock_MaybeFull interface { - isNewBlock_MaybeFull() -} - -type NewBlock_Id struct { - Id *BlockID `protobuf:"bytes,1,opt,name=id,proto3,oneof"` -} - -type NewBlock_Header struct { - Header *BlockHeadersResponse `protobuf:"bytes,2,opt,name=header,proto3,oneof"` -} - -type NewBlock_Body struct { - Body *BlockBodiesResponse `protobuf:"bytes,3,opt,name=body,proto3,oneof"` -} - -func (*NewBlock_Id) isNewBlock_MaybeFull() {} - -func (*NewBlock_Header) isNewBlock_MaybeFull() {} - -func (*NewBlock_Body) isNewBlock_MaybeFull() {} - -// Requests a peer's CurrentBlockHeader -type CurrentBlockHeaderRequest struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields -} - -func (x *CurrentBlockHeaderRequest) Reset() { - *x = CurrentBlockHeaderRequest{} - if protoimpl.UnsafeEnabled { - mi := &file_p2p_proto_block_proto_msgTypes[4] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *CurrentBlockHeaderRequest) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*CurrentBlockHeaderRequest) ProtoMessage() {} - -func (x *CurrentBlockHeaderRequest) ProtoReflect() protoreflect.Message { - mi := &file_p2p_proto_block_proto_msgTypes[4] - if protoimpl.UnsafeEnabled && x != nil { - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - if ms.LoadMessageInfo() == nil { - ms.StoreMessageInfo(mi) - } - return ms - } - return mi.MessageOf(x) -} - -// Deprecated: Use CurrentBlockHeaderRequest.ProtoReflect.Descriptor instead. -func (*CurrentBlockHeaderRequest) Descriptor() ([]byte, []int) { - return file_p2p_proto_block_proto_rawDescGZIP(), []int{4} -} - -// result is (BlockHeader, Signature?)* in order of creation (incr/dec) -type BlockHeadersRequest struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - Iteration *Iteration `protobuf:"bytes,1,opt,name=iteration,proto3" json:"iteration,omitempty"` -} - -func (x *BlockHeadersRequest) Reset() { - *x = BlockHeadersRequest{} - if protoimpl.UnsafeEnabled { - mi := &file_p2p_proto_block_proto_msgTypes[5] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *BlockHeadersRequest) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*BlockHeadersRequest) ProtoMessage() {} - -func (x *BlockHeadersRequest) ProtoReflect() protoreflect.Message { - mi := &file_p2p_proto_block_proto_msgTypes[5] - if protoimpl.UnsafeEnabled && x != nil { - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - if ms.LoadMessageInfo() == nil { - ms.StoreMessageInfo(mi) - } - return ms - } - return mi.MessageOf(x) -} - -// Deprecated: Use BlockHeadersRequest.ProtoReflect.Descriptor instead. -func (*BlockHeadersRequest) Descriptor() ([]byte, []int) { - return file_p2p_proto_block_proto_rawDescGZIP(), []int{5} -} - -func (x *BlockHeadersRequest) GetIteration() *Iteration { - if x != nil { - return x.Iteration - } - return nil -} - -type BlockHeadersResponsePart struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - // Types that are assignable to HeaderMessage: - // - // *BlockHeadersResponsePart_Header - // *BlockHeadersResponsePart_Signatures - // *BlockHeadersResponsePart_Fin - HeaderMessage isBlockHeadersResponsePart_HeaderMessage `protobuf_oneof:"header_message"` -} - -func (x *BlockHeadersResponsePart) Reset() { - *x = BlockHeadersResponsePart{} - if protoimpl.UnsafeEnabled { - mi := &file_p2p_proto_block_proto_msgTypes[6] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *BlockHeadersResponsePart) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*BlockHeadersResponsePart) ProtoMessage() {} - -func (x *BlockHeadersResponsePart) ProtoReflect() protoreflect.Message { - mi := &file_p2p_proto_block_proto_msgTypes[6] - if protoimpl.UnsafeEnabled && x != nil { - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - if ms.LoadMessageInfo() == nil { - ms.StoreMessageInfo(mi) - } - return ms - } - return mi.MessageOf(x) -} - -// Deprecated: Use BlockHeadersResponsePart.ProtoReflect.Descriptor instead. -func (*BlockHeadersResponsePart) Descriptor() ([]byte, []int) { - return file_p2p_proto_block_proto_rawDescGZIP(), []int{6} -} - -func (m *BlockHeadersResponsePart) GetHeaderMessage() isBlockHeadersResponsePart_HeaderMessage { - if m != nil { - return m.HeaderMessage - } - return nil -} - -func (x *BlockHeadersResponsePart) GetHeader() *BlockHeader { - if x, ok := x.GetHeaderMessage().(*BlockHeadersResponsePart_Header); ok { - return x.Header - } - return nil -} - -func (x *BlockHeadersResponsePart) GetSignatures() *Signatures { - if x, ok := x.GetHeaderMessage().(*BlockHeadersResponsePart_Signatures); ok { - return x.Signatures - } - return nil -} - -func (x *BlockHeadersResponsePart) GetFin() *Fin { - if x, ok := x.GetHeaderMessage().(*BlockHeadersResponsePart_Fin); ok { - return x.Fin - } - return nil -} - -type isBlockHeadersResponsePart_HeaderMessage interface { - isBlockHeadersResponsePart_HeaderMessage() -} - -type BlockHeadersResponsePart_Header struct { - Header *BlockHeader `protobuf:"bytes,1,opt,name=header,proto3,oneof"` -} - -type BlockHeadersResponsePart_Signatures struct { - Signatures *Signatures `protobuf:"bytes,2,opt,name=signatures,proto3,oneof"` -} - -type BlockHeadersResponsePart_Fin struct { - Fin *Fin `protobuf:"bytes,3,opt,name=fin,proto3,oneof"` // no support for interleaving for now -} - -func (*BlockHeadersResponsePart_Header) isBlockHeadersResponsePart_HeaderMessage() {} - -func (*BlockHeadersResponsePart_Signatures) isBlockHeadersResponsePart_HeaderMessage() {} - -func (*BlockHeadersResponsePart_Fin) isBlockHeadersResponsePart_HeaderMessage() {} - -type BlockHeadersResponse struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - Part []*BlockHeadersResponsePart `protobuf:"bytes,1,rep,name=part,proto3" json:"part,omitempty"` -} - -func (x *BlockHeadersResponse) Reset() { - *x = BlockHeadersResponse{} - if protoimpl.UnsafeEnabled { - mi := &file_p2p_proto_block_proto_msgTypes[7] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *BlockHeadersResponse) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*BlockHeadersResponse) ProtoMessage() {} - -func (x *BlockHeadersResponse) ProtoReflect() protoreflect.Message { - mi := &file_p2p_proto_block_proto_msgTypes[7] - if protoimpl.UnsafeEnabled && x != nil { - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - if ms.LoadMessageInfo() == nil { - ms.StoreMessageInfo(mi) - } - return ms - } - return mi.MessageOf(x) -} - -// Deprecated: Use BlockHeadersResponse.ProtoReflect.Descriptor instead. -func (*BlockHeadersResponse) Descriptor() ([]byte, []int) { - return file_p2p_proto_block_proto_rawDescGZIP(), []int{7} -} - -func (x *BlockHeadersResponse) GetPart() []*BlockHeadersResponsePart { - if x != nil { - return x.Part - } - return nil -} - -// result is (StateDiff*, Classes*, BlockProof?)* currently in creation order (incr/dec), but may change in the future -type BlockBodiesRequest struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - Iteration *Iteration `protobuf:"bytes,1,opt,name=iteration,proto3" json:"iteration,omitempty"` -} - -func (x *BlockBodiesRequest) Reset() { - *x = BlockBodiesRequest{} - if protoimpl.UnsafeEnabled { - mi := &file_p2p_proto_block_proto_msgTypes[8] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *BlockBodiesRequest) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*BlockBodiesRequest) ProtoMessage() {} - -func (x *BlockBodiesRequest) ProtoReflect() protoreflect.Message { - mi := &file_p2p_proto_block_proto_msgTypes[8] - if protoimpl.UnsafeEnabled && x != nil { - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - if ms.LoadMessageInfo() == nil { - ms.StoreMessageInfo(mi) - } - return ms - } - return mi.MessageOf(x) -} - -// Deprecated: Use BlockBodiesRequest.ProtoReflect.Descriptor instead. -func (*BlockBodiesRequest) Descriptor() ([]byte, []int) { - return file_p2p_proto_block_proto_rawDescGZIP(), []int{8} -} - -func (x *BlockBodiesRequest) GetIteration() *Iteration { - if x != nil { - return x.Iteration - } - return nil -} - -type BlockBodiesResponse struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - Id *BlockID `protobuf:"bytes,1,opt,name=id,proto3,oneof" json:"id,omitempty"` // may not appear if Fin is sent to end the whole response - // Types that are assignable to BodyMessage: - // - // *BlockBodiesResponse_Diff - // *BlockBodiesResponse_Classes - // *BlockBodiesResponse_Proof - // *BlockBodiesResponse_Fin - BodyMessage isBlockBodiesResponse_BodyMessage `protobuf_oneof:"body_message"` -} - -func (x *BlockBodiesResponse) Reset() { - *x = BlockBodiesResponse{} - if protoimpl.UnsafeEnabled { - mi := &file_p2p_proto_block_proto_msgTypes[9] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *BlockBodiesResponse) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*BlockBodiesResponse) ProtoMessage() {} - -func (x *BlockBodiesResponse) ProtoReflect() protoreflect.Message { - mi := &file_p2p_proto_block_proto_msgTypes[9] - if protoimpl.UnsafeEnabled && x != nil { - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - if ms.LoadMessageInfo() == nil { - ms.StoreMessageInfo(mi) - } - return ms - } - return mi.MessageOf(x) -} - -// Deprecated: Use BlockBodiesResponse.ProtoReflect.Descriptor instead. -func (*BlockBodiesResponse) Descriptor() ([]byte, []int) { - return file_p2p_proto_block_proto_rawDescGZIP(), []int{9} -} - -func (x *BlockBodiesResponse) GetId() *BlockID { - if x != nil { - return x.Id - } - return nil -} - -func (m *BlockBodiesResponse) GetBodyMessage() isBlockBodiesResponse_BodyMessage { - if m != nil { - return m.BodyMessage - } - return nil -} - -func (x *BlockBodiesResponse) GetDiff() *StateDiff { - if x, ok := x.GetBodyMessage().(*BlockBodiesResponse_Diff); ok { - return x.Diff - } - return nil -} - -func (x *BlockBodiesResponse) GetClasses() *Classes { - if x, ok := x.GetBodyMessage().(*BlockBodiesResponse_Classes); ok { - return x.Classes - } - return nil -} - -func (x *BlockBodiesResponse) GetProof() *BlockProof { - if x, ok := x.GetBodyMessage().(*BlockBodiesResponse_Proof); ok { - return x.Proof - } - return nil -} - -func (x *BlockBodiesResponse) GetFin() *Fin { - if x, ok := x.GetBodyMessage().(*BlockBodiesResponse_Fin); ok { - return x.Fin - } - return nil -} - -type isBlockBodiesResponse_BodyMessage interface { - isBlockBodiesResponse_BodyMessage() -} - -type BlockBodiesResponse_Diff struct { - Diff *StateDiff `protobuf:"bytes,2,opt,name=diff,proto3,oneof"` -} - -type BlockBodiesResponse_Classes struct { - Classes *Classes `protobuf:"bytes,3,opt,name=classes,proto3,oneof"` -} - -type BlockBodiesResponse_Proof struct { - Proof *BlockProof `protobuf:"bytes,4,opt,name=proof,proto3,oneof"` -} - -type BlockBodiesResponse_Fin struct { - Fin *Fin `protobuf:"bytes,5,opt,name=fin,proto3,oneof"` -} - -func (*BlockBodiesResponse_Diff) isBlockBodiesResponse_BodyMessage() {} - -func (*BlockBodiesResponse_Classes) isBlockBodiesResponse_BodyMessage() {} - -func (*BlockBodiesResponse_Proof) isBlockBodiesResponse_BodyMessage() {} - -func (*BlockBodiesResponse_Fin) isBlockBodiesResponse_BodyMessage() {} - -var File_p2p_proto_block_proto protoreflect.FileDescriptor - -var file_p2p_proto_block_proto_rawDesc = []byte{ - 0x0a, 0x15, 0x70, 0x32, 0x70, 0x2f, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2f, 0x62, 0x6c, 0x6f, 0x63, - 0x6b, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x1a, 0x16, 0x70, 0x32, 0x70, 0x2f, 0x70, 0x72, 0x6f, - 0x74, 0x6f, 0x2f, 0x63, 0x6f, 0x6d, 0x6d, 0x6f, 0x6e, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x1a, - 0x15, 0x70, 0x32, 0x70, 0x2f, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2f, 0x73, 0x74, 0x61, 0x74, 0x65, - 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x1a, 0x1f, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2f, 0x70, - 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2f, 0x74, 0x69, 0x6d, 0x65, 0x73, 0x74, 0x61, 0x6d, - 0x70, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x22, 0x61, 0x0a, 0x0a, 0x53, 0x69, 0x67, 0x6e, 0x61, - 0x74, 0x75, 0x72, 0x65, 0x73, 0x12, 0x1e, 0x0a, 0x05, 0x62, 0x6c, 0x6f, 0x63, 0x6b, 0x18, 0x01, - 0x20, 0x01, 0x28, 0x0b, 0x32, 0x08, 0x2e, 0x42, 0x6c, 0x6f, 0x63, 0x6b, 0x49, 0x44, 0x52, 0x05, - 0x62, 0x6c, 0x6f, 0x63, 0x6b, 0x12, 0x33, 0x0a, 0x0a, 0x73, 0x69, 0x67, 0x6e, 0x61, 0x74, 0x75, - 0x72, 0x65, 0x73, 0x18, 0x02, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x13, 0x2e, 0x43, 0x6f, 0x6e, 0x73, - 0x65, 0x6e, 0x73, 0x75, 0x73, 0x53, 0x69, 0x67, 0x6e, 0x61, 0x74, 0x75, 0x72, 0x65, 0x52, 0x0a, - 0x73, 0x69, 0x67, 0x6e, 0x61, 0x74, 0x75, 0x72, 0x65, 0x73, 0x22, 0xea, 0x03, 0x0a, 0x0b, 0x42, - 0x6c, 0x6f, 0x63, 0x6b, 0x48, 0x65, 0x61, 0x64, 0x65, 0x72, 0x12, 0x26, 0x0a, 0x0b, 0x70, 0x61, - 0x72, 0x65, 0x6e, 0x74, 0x5f, 0x68, 0x61, 0x73, 0x68, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, - 0x05, 0x2e, 0x48, 0x61, 0x73, 0x68, 0x52, 0x0a, 0x70, 0x61, 0x72, 0x65, 0x6e, 0x74, 0x48, 0x61, - 0x73, 0x68, 0x12, 0x16, 0x0a, 0x06, 0x6e, 0x75, 0x6d, 0x62, 0x65, 0x72, 0x18, 0x02, 0x20, 0x01, - 0x28, 0x04, 0x52, 0x06, 0x6e, 0x75, 0x6d, 0x62, 0x65, 0x72, 0x12, 0x2e, 0x0a, 0x04, 0x74, 0x69, - 0x6d, 0x65, 0x18, 0x03, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1a, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, - 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x54, 0x69, 0x6d, 0x65, 0x73, - 0x74, 0x61, 0x6d, 0x70, 0x52, 0x04, 0x74, 0x69, 0x6d, 0x65, 0x12, 0x35, 0x0a, 0x11, 0x73, 0x65, - 0x71, 0x75, 0x65, 0x6e, 0x63, 0x65, 0x72, 0x5f, 0x61, 0x64, 0x64, 0x72, 0x65, 0x73, 0x73, 0x18, - 0x04, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x08, 0x2e, 0x41, 0x64, 0x64, 0x72, 0x65, 0x73, 0x73, 0x52, - 0x10, 0x73, 0x65, 0x71, 0x75, 0x65, 0x6e, 0x63, 0x65, 0x72, 0x41, 0x64, 0x64, 0x72, 0x65, 0x73, - 0x73, 0x12, 0x28, 0x0a, 0x0b, 0x73, 0x74, 0x61, 0x74, 0x65, 0x5f, 0x64, 0x69, 0x66, 0x66, 0x73, - 0x18, 0x05, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x07, 0x2e, 0x4d, 0x65, 0x72, 0x6b, 0x6c, 0x65, 0x52, - 0x0a, 0x73, 0x74, 0x61, 0x74, 0x65, 0x44, 0x69, 0x66, 0x66, 0x73, 0x12, 0x1f, 0x0a, 0x05, 0x73, - 0x74, 0x61, 0x74, 0x65, 0x18, 0x06, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x09, 0x2e, 0x50, 0x61, 0x74, - 0x72, 0x69, 0x63, 0x69, 0x61, 0x52, 0x05, 0x73, 0x74, 0x61, 0x74, 0x65, 0x12, 0x24, 0x0a, 0x0a, - 0x70, 0x72, 0x6f, 0x6f, 0x66, 0x5f, 0x66, 0x61, 0x63, 0x74, 0x18, 0x07, 0x20, 0x01, 0x28, 0x0b, - 0x32, 0x05, 0x2e, 0x48, 0x61, 0x73, 0x68, 0x52, 0x09, 0x70, 0x72, 0x6f, 0x6f, 0x66, 0x46, 0x61, - 0x63, 0x74, 0x12, 0x2b, 0x0a, 0x0c, 0x74, 0x72, 0x61, 0x6e, 0x73, 0x61, 0x63, 0x74, 0x69, 0x6f, - 0x6e, 0x73, 0x18, 0x08, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x07, 0x2e, 0x4d, 0x65, 0x72, 0x6b, 0x6c, - 0x65, 0x52, 0x0c, 0x74, 0x72, 0x61, 0x6e, 0x73, 0x61, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x12, - 0x1f, 0x0a, 0x06, 0x65, 0x76, 0x65, 0x6e, 0x74, 0x73, 0x18, 0x09, 0x20, 0x01, 0x28, 0x0b, 0x32, - 0x07, 0x2e, 0x4d, 0x65, 0x72, 0x6b, 0x6c, 0x65, 0x52, 0x06, 0x65, 0x76, 0x65, 0x6e, 0x74, 0x73, - 0x12, 0x23, 0x0a, 0x08, 0x72, 0x65, 0x63, 0x65, 0x69, 0x70, 0x74, 0x73, 0x18, 0x0a, 0x20, 0x01, - 0x28, 0x0b, 0x32, 0x07, 0x2e, 0x4d, 0x65, 0x72, 0x6b, 0x6c, 0x65, 0x52, 0x08, 0x72, 0x65, 0x63, - 0x65, 0x69, 0x70, 0x74, 0x73, 0x12, 0x29, 0x0a, 0x10, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x63, 0x6f, - 0x6c, 0x5f, 0x76, 0x65, 0x72, 0x73, 0x69, 0x6f, 0x6e, 0x18, 0x0b, 0x20, 0x01, 0x28, 0x09, 0x52, - 0x0f, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x63, 0x6f, 0x6c, 0x56, 0x65, 0x72, 0x73, 0x69, 0x6f, 0x6e, - 0x12, 0x25, 0x0a, 0x09, 0x67, 0x61, 0x73, 0x5f, 0x70, 0x72, 0x69, 0x63, 0x65, 0x18, 0x0c, 0x20, - 0x01, 0x28, 0x0b, 0x32, 0x08, 0x2e, 0x46, 0x65, 0x6c, 0x74, 0x32, 0x35, 0x32, 0x52, 0x08, 0x67, - 0x61, 0x73, 0x50, 0x72, 0x69, 0x63, 0x65, 0x22, 0x22, 0x0a, 0x0a, 0x42, 0x6c, 0x6f, 0x63, 0x6b, - 0x50, 0x72, 0x6f, 0x6f, 0x66, 0x12, 0x14, 0x0a, 0x05, 0x70, 0x72, 0x6f, 0x6f, 0x66, 0x18, 0x01, - 0x20, 0x01, 0x28, 0x0c, 0x52, 0x05, 0x70, 0x72, 0x6f, 0x6f, 0x66, 0x22, 0x91, 0x01, 0x0a, 0x08, - 0x4e, 0x65, 0x77, 0x42, 0x6c, 0x6f, 0x63, 0x6b, 0x12, 0x1a, 0x0a, 0x02, 0x69, 0x64, 0x18, 0x01, - 0x20, 0x01, 0x28, 0x0b, 0x32, 0x08, 0x2e, 0x42, 0x6c, 0x6f, 0x63, 0x6b, 0x49, 0x44, 0x48, 0x00, - 0x52, 0x02, 0x69, 0x64, 0x12, 0x2f, 0x0a, 0x06, 0x68, 0x65, 0x61, 0x64, 0x65, 0x72, 0x18, 0x02, - 0x20, 0x01, 0x28, 0x0b, 0x32, 0x15, 0x2e, 0x42, 0x6c, 0x6f, 0x63, 0x6b, 0x48, 0x65, 0x61, 0x64, - 0x65, 0x72, 0x73, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x48, 0x00, 0x52, 0x06, 0x68, - 0x65, 0x61, 0x64, 0x65, 0x72, 0x12, 0x2a, 0x0a, 0x04, 0x62, 0x6f, 0x64, 0x79, 0x18, 0x03, 0x20, - 0x01, 0x28, 0x0b, 0x32, 0x14, 0x2e, 0x42, 0x6c, 0x6f, 0x63, 0x6b, 0x42, 0x6f, 0x64, 0x69, 0x65, - 0x73, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x48, 0x00, 0x52, 0x04, 0x62, 0x6f, 0x64, - 0x79, 0x42, 0x0c, 0x0a, 0x0a, 0x6d, 0x61, 0x79, 0x62, 0x65, 0x5f, 0x66, 0x75, 0x6c, 0x6c, 0x22, - 0x1b, 0x0a, 0x19, 0x43, 0x75, 0x72, 0x72, 0x65, 0x6e, 0x74, 0x42, 0x6c, 0x6f, 0x63, 0x6b, 0x48, - 0x65, 0x61, 0x64, 0x65, 0x72, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x22, 0x3f, 0x0a, 0x13, - 0x42, 0x6c, 0x6f, 0x63, 0x6b, 0x48, 0x65, 0x61, 0x64, 0x65, 0x72, 0x73, 0x52, 0x65, 0x71, 0x75, - 0x65, 0x73, 0x74, 0x12, 0x28, 0x0a, 0x09, 0x69, 0x74, 0x65, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, - 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x0a, 0x2e, 0x49, 0x74, 0x65, 0x72, 0x61, 0x74, 0x69, - 0x6f, 0x6e, 0x52, 0x09, 0x69, 0x74, 0x65, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x22, 0x9d, 0x01, - 0x0a, 0x18, 0x42, 0x6c, 0x6f, 0x63, 0x6b, 0x48, 0x65, 0x61, 0x64, 0x65, 0x72, 0x73, 0x52, 0x65, - 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x50, 0x61, 0x72, 0x74, 0x12, 0x26, 0x0a, 0x06, 0x68, 0x65, - 0x61, 0x64, 0x65, 0x72, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x0c, 0x2e, 0x42, 0x6c, 0x6f, - 0x63, 0x6b, 0x48, 0x65, 0x61, 0x64, 0x65, 0x72, 0x48, 0x00, 0x52, 0x06, 0x68, 0x65, 0x61, 0x64, - 0x65, 0x72, 0x12, 0x2d, 0x0a, 0x0a, 0x73, 0x69, 0x67, 0x6e, 0x61, 0x74, 0x75, 0x72, 0x65, 0x73, - 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x0b, 0x2e, 0x53, 0x69, 0x67, 0x6e, 0x61, 0x74, 0x75, - 0x72, 0x65, 0x73, 0x48, 0x00, 0x52, 0x0a, 0x73, 0x69, 0x67, 0x6e, 0x61, 0x74, 0x75, 0x72, 0x65, - 0x73, 0x12, 0x18, 0x0a, 0x03, 0x66, 0x69, 0x6e, 0x18, 0x03, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x04, - 0x2e, 0x46, 0x69, 0x6e, 0x48, 0x00, 0x52, 0x03, 0x66, 0x69, 0x6e, 0x42, 0x10, 0x0a, 0x0e, 0x68, - 0x65, 0x61, 0x64, 0x65, 0x72, 0x5f, 0x6d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x22, 0x45, 0x0a, - 0x14, 0x42, 0x6c, 0x6f, 0x63, 0x6b, 0x48, 0x65, 0x61, 0x64, 0x65, 0x72, 0x73, 0x52, 0x65, 0x73, - 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x2d, 0x0a, 0x04, 0x70, 0x61, 0x72, 0x74, 0x18, 0x01, 0x20, - 0x03, 0x28, 0x0b, 0x32, 0x19, 0x2e, 0x42, 0x6c, 0x6f, 0x63, 0x6b, 0x48, 0x65, 0x61, 0x64, 0x65, - 0x72, 0x73, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x50, 0x61, 0x72, 0x74, 0x52, 0x04, - 0x70, 0x61, 0x72, 0x74, 0x22, 0x3e, 0x0a, 0x12, 0x42, 0x6c, 0x6f, 0x63, 0x6b, 0x42, 0x6f, 0x64, - 0x69, 0x65, 0x73, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x28, 0x0a, 0x09, 0x69, 0x74, - 0x65, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x0a, 0x2e, - 0x49, 0x74, 0x65, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x52, 0x09, 0x69, 0x74, 0x65, 0x72, 0x61, - 0x74, 0x69, 0x6f, 0x6e, 0x22, 0xd2, 0x01, 0x0a, 0x13, 0x42, 0x6c, 0x6f, 0x63, 0x6b, 0x42, 0x6f, - 0x64, 0x69, 0x65, 0x73, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x1d, 0x0a, 0x02, - 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x08, 0x2e, 0x42, 0x6c, 0x6f, 0x63, 0x6b, - 0x49, 0x44, 0x48, 0x01, 0x52, 0x02, 0x69, 0x64, 0x88, 0x01, 0x01, 0x12, 0x20, 0x0a, 0x04, 0x64, - 0x69, 0x66, 0x66, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x0a, 0x2e, 0x53, 0x74, 0x61, 0x74, - 0x65, 0x44, 0x69, 0x66, 0x66, 0x48, 0x00, 0x52, 0x04, 0x64, 0x69, 0x66, 0x66, 0x12, 0x24, 0x0a, - 0x07, 0x63, 0x6c, 0x61, 0x73, 0x73, 0x65, 0x73, 0x18, 0x03, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x08, - 0x2e, 0x43, 0x6c, 0x61, 0x73, 0x73, 0x65, 0x73, 0x48, 0x00, 0x52, 0x07, 0x63, 0x6c, 0x61, 0x73, - 0x73, 0x65, 0x73, 0x12, 0x23, 0x0a, 0x05, 0x70, 0x72, 0x6f, 0x6f, 0x66, 0x18, 0x04, 0x20, 0x01, - 0x28, 0x0b, 0x32, 0x0b, 0x2e, 0x42, 0x6c, 0x6f, 0x63, 0x6b, 0x50, 0x72, 0x6f, 0x6f, 0x66, 0x48, - 0x00, 0x52, 0x05, 0x70, 0x72, 0x6f, 0x6f, 0x66, 0x12, 0x18, 0x0a, 0x03, 0x66, 0x69, 0x6e, 0x18, - 0x05, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x04, 0x2e, 0x46, 0x69, 0x6e, 0x48, 0x00, 0x52, 0x03, 0x66, - 0x69, 0x6e, 0x42, 0x0e, 0x0a, 0x0c, 0x62, 0x6f, 0x64, 0x79, 0x5f, 0x6d, 0x65, 0x73, 0x73, 0x61, - 0x67, 0x65, 0x42, 0x05, 0x0a, 0x03, 0x5f, 0x69, 0x64, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, - 0x33, -} - -var ( - file_p2p_proto_block_proto_rawDescOnce sync.Once - file_p2p_proto_block_proto_rawDescData = file_p2p_proto_block_proto_rawDesc -) - -func file_p2p_proto_block_proto_rawDescGZIP() []byte { - file_p2p_proto_block_proto_rawDescOnce.Do(func() { - file_p2p_proto_block_proto_rawDescData = protoimpl.X.CompressGZIP(file_p2p_proto_block_proto_rawDescData) - }) - return file_p2p_proto_block_proto_rawDescData -} - -var ( - file_p2p_proto_block_proto_msgTypes = make([]protoimpl.MessageInfo, 10) - file_p2p_proto_block_proto_goTypes = []interface{}{ - (*Signatures)(nil), // 0: Signatures - (*BlockHeader)(nil), // 1: BlockHeader - (*BlockProof)(nil), // 2: BlockProof - (*NewBlock)(nil), // 3: NewBlock - (*CurrentBlockHeaderRequest)(nil), // 4: CurrentBlockHeaderRequest - (*BlockHeadersRequest)(nil), // 5: BlockHeadersRequest - (*BlockHeadersResponsePart)(nil), // 6: BlockHeadersResponsePart - (*BlockHeadersResponse)(nil), // 7: BlockHeadersResponse - (*BlockBodiesRequest)(nil), // 8: BlockBodiesRequest - (*BlockBodiesResponse)(nil), // 9: BlockBodiesResponse - (*BlockID)(nil), // 10: BlockID - (*ConsensusSignature)(nil), // 11: ConsensusSignature - (*Hash)(nil), // 12: Hash - (*timestamppb.Timestamp)(nil), // 13: google.protobuf.Timestamp - (*Address)(nil), // 14: Address - (*Merkle)(nil), // 15: Merkle - (*Patricia)(nil), // 16: Patricia - (*Felt252)(nil), // 17: Felt252 - (*Iteration)(nil), // 18: Iteration - (*Fin)(nil), // 19: Fin - (*StateDiff)(nil), // 20: StateDiff - (*Classes)(nil), // 21: Classes - } -) - -var file_p2p_proto_block_proto_depIdxs = []int32{ - 10, // 0: Signatures.block:type_name -> BlockID - 11, // 1: Signatures.signatures:type_name -> ConsensusSignature - 12, // 2: BlockHeader.parent_hash:type_name -> Hash - 13, // 3: BlockHeader.time:type_name -> google.protobuf.Timestamp - 14, // 4: BlockHeader.sequencer_address:type_name -> Address - 15, // 5: BlockHeader.state_diffs:type_name -> Merkle - 16, // 6: BlockHeader.state:type_name -> Patricia - 12, // 7: BlockHeader.proof_fact:type_name -> Hash - 15, // 8: BlockHeader.transactions:type_name -> Merkle - 15, // 9: BlockHeader.events:type_name -> Merkle - 15, // 10: BlockHeader.receipts:type_name -> Merkle - 17, // 11: BlockHeader.gas_price:type_name -> Felt252 - 10, // 12: NewBlock.id:type_name -> BlockID - 7, // 13: NewBlock.header:type_name -> BlockHeadersResponse - 9, // 14: NewBlock.body:type_name -> BlockBodiesResponse - 18, // 15: BlockHeadersRequest.iteration:type_name -> Iteration - 1, // 16: BlockHeadersResponsePart.header:type_name -> BlockHeader - 0, // 17: BlockHeadersResponsePart.signatures:type_name -> Signatures - 19, // 18: BlockHeadersResponsePart.fin:type_name -> Fin - 6, // 19: BlockHeadersResponse.part:type_name -> BlockHeadersResponsePart - 18, // 20: BlockBodiesRequest.iteration:type_name -> Iteration - 10, // 21: BlockBodiesResponse.id:type_name -> BlockID - 20, // 22: BlockBodiesResponse.diff:type_name -> StateDiff - 21, // 23: BlockBodiesResponse.classes:type_name -> Classes - 2, // 24: BlockBodiesResponse.proof:type_name -> BlockProof - 19, // 25: BlockBodiesResponse.fin:type_name -> Fin - 26, // [26:26] is the sub-list for method output_type - 26, // [26:26] is the sub-list for method input_type - 26, // [26:26] is the sub-list for extension type_name - 26, // [26:26] is the sub-list for extension extendee - 0, // [0:26] is the sub-list for field type_name -} - -func init() { file_p2p_proto_block_proto_init() } -func file_p2p_proto_block_proto_init() { - if File_p2p_proto_block_proto != nil { - return - } - file_p2p_proto_common_proto_init() - file_p2p_proto_state_proto_init() - if !protoimpl.UnsafeEnabled { - file_p2p_proto_block_proto_msgTypes[0].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*Signatures); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_p2p_proto_block_proto_msgTypes[1].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*BlockHeader); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_p2p_proto_block_proto_msgTypes[2].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*BlockProof); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_p2p_proto_block_proto_msgTypes[3].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*NewBlock); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_p2p_proto_block_proto_msgTypes[4].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*CurrentBlockHeaderRequest); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_p2p_proto_block_proto_msgTypes[5].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*BlockHeadersRequest); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_p2p_proto_block_proto_msgTypes[6].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*BlockHeadersResponsePart); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_p2p_proto_block_proto_msgTypes[7].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*BlockHeadersResponse); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_p2p_proto_block_proto_msgTypes[8].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*BlockBodiesRequest); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_p2p_proto_block_proto_msgTypes[9].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*BlockBodiesResponse); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - } - file_p2p_proto_block_proto_msgTypes[3].OneofWrappers = []interface{}{ - (*NewBlock_Id)(nil), - (*NewBlock_Header)(nil), - (*NewBlock_Body)(nil), - } - file_p2p_proto_block_proto_msgTypes[6].OneofWrappers = []interface{}{ - (*BlockHeadersResponsePart_Header)(nil), - (*BlockHeadersResponsePart_Signatures)(nil), - (*BlockHeadersResponsePart_Fin)(nil), - } - file_p2p_proto_block_proto_msgTypes[9].OneofWrappers = []interface{}{ - (*BlockBodiesResponse_Diff)(nil), - (*BlockBodiesResponse_Classes)(nil), - (*BlockBodiesResponse_Proof)(nil), - (*BlockBodiesResponse_Fin)(nil), - } - type x struct{} - out := protoimpl.TypeBuilder{ - File: protoimpl.DescBuilder{ - GoPackagePath: reflect.TypeOf(x{}).PkgPath(), - RawDescriptor: file_p2p_proto_block_proto_rawDesc, - NumEnums: 0, - NumMessages: 10, - NumExtensions: 0, - NumServices: 0, - }, - GoTypes: file_p2p_proto_block_proto_goTypes, - DependencyIndexes: file_p2p_proto_block_proto_depIdxs, - MessageInfos: file_p2p_proto_block_proto_msgTypes, - }.Build() - File_p2p_proto_block_proto = out.File - file_p2p_proto_block_proto_rawDesc = nil - file_p2p_proto_block_proto_goTypes = nil - file_p2p_proto_block_proto_depIdxs = nil -} diff --git a/p2p/starknet/spec/class.pb.go b/p2p/starknet/spec/class.pb.go new file mode 100644 index 0000000000..e282f638c3 --- /dev/null +++ b/p2p/starknet/spec/class.pb.go @@ -0,0 +1,848 @@ +// Code generated by protoc-gen-go. DO NOT EDIT. +// versions: +// protoc-gen-go v1.26.0 +// protoc v4.25.1 +// source: p2p/proto/class.proto + +package spec + +import ( + reflect "reflect" + sync "sync" + + protoreflect "google.golang.org/protobuf/reflect/protoreflect" + protoimpl "google.golang.org/protobuf/runtime/protoimpl" +) + +const ( + // Verify that this generated code is sufficiently up-to-date. + _ = protoimpl.EnforceVersion(20 - protoimpl.MinVersion) + // Verify that runtime/protoimpl is sufficiently up-to-date. + _ = protoimpl.EnforceVersion(protoimpl.MaxVersion - 20) +) + +type EntryPoint struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Selector *Felt252 `protobuf:"bytes,1,opt,name=selector,proto3" json:"selector,omitempty"` + Offset *Felt252 `protobuf:"bytes,2,opt,name=offset,proto3" json:"offset,omitempty"` +} + +func (x *EntryPoint) Reset() { + *x = EntryPoint{} + if protoimpl.UnsafeEnabled { + mi := &file_p2p_proto_class_proto_msgTypes[0] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *EntryPoint) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*EntryPoint) ProtoMessage() {} + +func (x *EntryPoint) ProtoReflect() protoreflect.Message { + mi := &file_p2p_proto_class_proto_msgTypes[0] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use EntryPoint.ProtoReflect.Descriptor instead. +func (*EntryPoint) Descriptor() ([]byte, []int) { + return file_p2p_proto_class_proto_rawDescGZIP(), []int{0} +} + +func (x *EntryPoint) GetSelector() *Felt252 { + if x != nil { + return x.Selector + } + return nil +} + +func (x *EntryPoint) GetOffset() *Felt252 { + if x != nil { + return x.Offset + } + return nil +} + +type Cairo0Class struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Abi []byte `protobuf:"bytes,1,opt,name=abi,proto3" json:"abi,omitempty"` + Externals []*EntryPoint `protobuf:"bytes,2,rep,name=externals,proto3" json:"externals,omitempty"` + L1Handlers []*EntryPoint `protobuf:"bytes,3,rep,name=l1_handlers,json=l1Handlers,proto3" json:"l1_handlers,omitempty"` + Constructors []*EntryPoint `protobuf:"bytes,4,rep,name=constructors,proto3" json:"constructors,omitempty"` + Program []byte `protobuf:"bytes,5,opt,name=program,proto3" json:"program,omitempty"` +} + +func (x *Cairo0Class) Reset() { + *x = Cairo0Class{} + if protoimpl.UnsafeEnabled { + mi := &file_p2p_proto_class_proto_msgTypes[1] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *Cairo0Class) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*Cairo0Class) ProtoMessage() {} + +func (x *Cairo0Class) ProtoReflect() protoreflect.Message { + mi := &file_p2p_proto_class_proto_msgTypes[1] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use Cairo0Class.ProtoReflect.Descriptor instead. +func (*Cairo0Class) Descriptor() ([]byte, []int) { + return file_p2p_proto_class_proto_rawDescGZIP(), []int{1} +} + +func (x *Cairo0Class) GetAbi() []byte { + if x != nil { + return x.Abi + } + return nil +} + +func (x *Cairo0Class) GetExternals() []*EntryPoint { + if x != nil { + return x.Externals + } + return nil +} + +func (x *Cairo0Class) GetL1Handlers() []*EntryPoint { + if x != nil { + return x.L1Handlers + } + return nil +} + +func (x *Cairo0Class) GetConstructors() []*EntryPoint { + if x != nil { + return x.Constructors + } + return nil +} + +func (x *Cairo0Class) GetProgram() []byte { + if x != nil { + return x.Program + } + return nil +} + +type SierraEntryPoint struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Index uint64 `protobuf:"varint,1,opt,name=index,proto3" json:"index,omitempty"` + Selector *Felt252 `protobuf:"bytes,2,opt,name=selector,proto3" json:"selector,omitempty"` +} + +func (x *SierraEntryPoint) Reset() { + *x = SierraEntryPoint{} + if protoimpl.UnsafeEnabled { + mi := &file_p2p_proto_class_proto_msgTypes[2] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *SierraEntryPoint) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*SierraEntryPoint) ProtoMessage() {} + +func (x *SierraEntryPoint) ProtoReflect() protoreflect.Message { + mi := &file_p2p_proto_class_proto_msgTypes[2] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use SierraEntryPoint.ProtoReflect.Descriptor instead. +func (*SierraEntryPoint) Descriptor() ([]byte, []int) { + return file_p2p_proto_class_proto_rawDescGZIP(), []int{2} +} + +func (x *SierraEntryPoint) GetIndex() uint64 { + if x != nil { + return x.Index + } + return 0 +} + +func (x *SierraEntryPoint) GetSelector() *Felt252 { + if x != nil { + return x.Selector + } + return nil +} + +type Cairo1EntryPoints struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Externals []*SierraEntryPoint `protobuf:"bytes,1,rep,name=externals,proto3" json:"externals,omitempty"` + L1Handlers []*SierraEntryPoint `protobuf:"bytes,2,rep,name=l1_handlers,json=l1Handlers,proto3" json:"l1_handlers,omitempty"` + Constructors []*SierraEntryPoint `protobuf:"bytes,3,rep,name=constructors,proto3" json:"constructors,omitempty"` +} + +func (x *Cairo1EntryPoints) Reset() { + *x = Cairo1EntryPoints{} + if protoimpl.UnsafeEnabled { + mi := &file_p2p_proto_class_proto_msgTypes[3] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *Cairo1EntryPoints) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*Cairo1EntryPoints) ProtoMessage() {} + +func (x *Cairo1EntryPoints) ProtoReflect() protoreflect.Message { + mi := &file_p2p_proto_class_proto_msgTypes[3] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use Cairo1EntryPoints.ProtoReflect.Descriptor instead. +func (*Cairo1EntryPoints) Descriptor() ([]byte, []int) { + return file_p2p_proto_class_proto_rawDescGZIP(), []int{3} +} + +func (x *Cairo1EntryPoints) GetExternals() []*SierraEntryPoint { + if x != nil { + return x.Externals + } + return nil +} + +func (x *Cairo1EntryPoints) GetL1Handlers() []*SierraEntryPoint { + if x != nil { + return x.L1Handlers + } + return nil +} + +func (x *Cairo1EntryPoints) GetConstructors() []*SierraEntryPoint { + if x != nil { + return x.Constructors + } + return nil +} + +type Cairo1Class struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Abi []byte `protobuf:"bytes,1,opt,name=abi,proto3" json:"abi,omitempty"` + EntryPoints *Cairo1EntryPoints `protobuf:"bytes,2,opt,name=entry_points,json=entryPoints,proto3" json:"entry_points,omitempty"` + Program []*Felt252 `protobuf:"bytes,3,rep,name=program,proto3" json:"program,omitempty"` + ContractClassVersion string `protobuf:"bytes,4,opt,name=contract_class_version,json=contractClassVersion,proto3" json:"contract_class_version,omitempty"` + Compiled []byte `protobuf:"bytes,5,opt,name=compiled,proto3" json:"compiled,omitempty"` +} + +func (x *Cairo1Class) Reset() { + *x = Cairo1Class{} + if protoimpl.UnsafeEnabled { + mi := &file_p2p_proto_class_proto_msgTypes[4] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *Cairo1Class) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*Cairo1Class) ProtoMessage() {} + +func (x *Cairo1Class) ProtoReflect() protoreflect.Message { + mi := &file_p2p_proto_class_proto_msgTypes[4] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use Cairo1Class.ProtoReflect.Descriptor instead. +func (*Cairo1Class) Descriptor() ([]byte, []int) { + return file_p2p_proto_class_proto_rawDescGZIP(), []int{4} +} + +func (x *Cairo1Class) GetAbi() []byte { + if x != nil { + return x.Abi + } + return nil +} + +func (x *Cairo1Class) GetEntryPoints() *Cairo1EntryPoints { + if x != nil { + return x.EntryPoints + } + return nil +} + +func (x *Cairo1Class) GetProgram() []*Felt252 { + if x != nil { + return x.Program + } + return nil +} + +func (x *Cairo1Class) GetContractClassVersion() string { + if x != nil { + return x.ContractClassVersion + } + return "" +} + +func (x *Cairo1Class) GetCompiled() []byte { + if x != nil { + return x.Compiled + } + return nil +} + +// is it better to separate the definition from the hashes? (will need to repeate the hashes +// for the definitions stream) +// or, make the definitions optional? maybe it is enough to know only that a class exists, not its definition +// which may be fetched lazily later. +type Class struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + // Types that are assignable to Class: + // + // *Class_Cairo0 + // *Class_Cairo1 + Class isClass_Class `protobuf_oneof:"class"` + Domain uint32 `protobuf:"varint,3,opt,name=domain,proto3" json:"domain,omitempty"` + ClassHash *Hash `protobuf:"bytes,4,opt,name=class_hash,json=classHash,proto3" json:"class_hash,omitempty"` +} + +func (x *Class) Reset() { + *x = Class{} + if protoimpl.UnsafeEnabled { + mi := &file_p2p_proto_class_proto_msgTypes[5] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *Class) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*Class) ProtoMessage() {} + +func (x *Class) ProtoReflect() protoreflect.Message { + mi := &file_p2p_proto_class_proto_msgTypes[5] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use Class.ProtoReflect.Descriptor instead. +func (*Class) Descriptor() ([]byte, []int) { + return file_p2p_proto_class_proto_rawDescGZIP(), []int{5} +} + +func (m *Class) GetClass() isClass_Class { + if m != nil { + return m.Class + } + return nil +} + +func (x *Class) GetCairo0() *Cairo0Class { + if x, ok := x.GetClass().(*Class_Cairo0); ok { + return x.Cairo0 + } + return nil +} + +func (x *Class) GetCairo1() *Cairo1Class { + if x, ok := x.GetClass().(*Class_Cairo1); ok { + return x.Cairo1 + } + return nil +} + +func (x *Class) GetDomain() uint32 { + if x != nil { + return x.Domain + } + return 0 +} + +func (x *Class) GetClassHash() *Hash { + if x != nil { + return x.ClassHash + } + return nil +} + +type isClass_Class interface { + isClass_Class() +} + +type Class_Cairo0 struct { + Cairo0 *Cairo0Class `protobuf:"bytes,1,opt,name=cairo0,proto3,oneof"` +} + +type Class_Cairo1 struct { + Cairo1 *Cairo1Class `protobuf:"bytes,2,opt,name=cairo1,proto3,oneof"` +} + +func (*Class_Cairo0) isClass_Class() {} + +func (*Class_Cairo1) isClass_Class() {} + +type ClassesRequest struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Iteration *Iteration `protobuf:"bytes,1,opt,name=iteration,proto3" json:"iteration,omitempty"` +} + +func (x *ClassesRequest) Reset() { + *x = ClassesRequest{} + if protoimpl.UnsafeEnabled { + mi := &file_p2p_proto_class_proto_msgTypes[6] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *ClassesRequest) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*ClassesRequest) ProtoMessage() {} + +func (x *ClassesRequest) ProtoReflect() protoreflect.Message { + mi := &file_p2p_proto_class_proto_msgTypes[6] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use ClassesRequest.ProtoReflect.Descriptor instead. +func (*ClassesRequest) Descriptor() ([]byte, []int) { + return file_p2p_proto_class_proto_rawDescGZIP(), []int{6} +} + +func (x *ClassesRequest) GetIteration() *Iteration { + if x != nil { + return x.Iteration + } + return nil +} + +// Responses are sent ordered by the order given in the request. +type ClassesResponse struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + // Types that are assignable to ClassMessage: + // + // *ClassesResponse_Class + // *ClassesResponse_Fin + ClassMessage isClassesResponse_ClassMessage `protobuf_oneof:"class_message"` +} + +func (x *ClassesResponse) Reset() { + *x = ClassesResponse{} + if protoimpl.UnsafeEnabled { + mi := &file_p2p_proto_class_proto_msgTypes[7] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *ClassesResponse) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*ClassesResponse) ProtoMessage() {} + +func (x *ClassesResponse) ProtoReflect() protoreflect.Message { + mi := &file_p2p_proto_class_proto_msgTypes[7] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use ClassesResponse.ProtoReflect.Descriptor instead. +func (*ClassesResponse) Descriptor() ([]byte, []int) { + return file_p2p_proto_class_proto_rawDescGZIP(), []int{7} +} + +func (m *ClassesResponse) GetClassMessage() isClassesResponse_ClassMessage { + if m != nil { + return m.ClassMessage + } + return nil +} + +func (x *ClassesResponse) GetClass() *Class { + if x, ok := x.GetClassMessage().(*ClassesResponse_Class); ok { + return x.Class + } + return nil +} + +func (x *ClassesResponse) GetFin() *Fin { + if x, ok := x.GetClassMessage().(*ClassesResponse_Fin); ok { + return x.Fin + } + return nil +} + +type isClassesResponse_ClassMessage interface { + isClassesResponse_ClassMessage() +} + +type ClassesResponse_Class struct { + Class *Class `protobuf:"bytes,1,opt,name=class,proto3,oneof"` +} + +type ClassesResponse_Fin struct { + Fin *Fin `protobuf:"bytes,2,opt,name=fin,proto3,oneof"` // Fin is sent after the peer sent all the data or when it encountered a block that it doesn't have its classes. +} + +func (*ClassesResponse_Class) isClassesResponse_ClassMessage() {} + +func (*ClassesResponse_Fin) isClassesResponse_ClassMessage() {} + +var File_p2p_proto_class_proto protoreflect.FileDescriptor + +var file_p2p_proto_class_proto_rawDesc = []byte{ + 0x0a, 0x15, 0x70, 0x32, 0x70, 0x2f, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2f, 0x63, 0x6c, 0x61, 0x73, + 0x73, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x1a, 0x16, 0x70, 0x32, 0x70, 0x2f, 0x70, 0x72, 0x6f, + 0x74, 0x6f, 0x2f, 0x63, 0x6f, 0x6d, 0x6d, 0x6f, 0x6e, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x22, + 0x54, 0x0a, 0x0a, 0x45, 0x6e, 0x74, 0x72, 0x79, 0x50, 0x6f, 0x69, 0x6e, 0x74, 0x12, 0x24, 0x0a, + 0x08, 0x73, 0x65, 0x6c, 0x65, 0x63, 0x74, 0x6f, 0x72, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, + 0x08, 0x2e, 0x46, 0x65, 0x6c, 0x74, 0x32, 0x35, 0x32, 0x52, 0x08, 0x73, 0x65, 0x6c, 0x65, 0x63, + 0x74, 0x6f, 0x72, 0x12, 0x20, 0x0a, 0x06, 0x6f, 0x66, 0x66, 0x73, 0x65, 0x74, 0x18, 0x02, 0x20, + 0x01, 0x28, 0x0b, 0x32, 0x08, 0x2e, 0x46, 0x65, 0x6c, 0x74, 0x32, 0x35, 0x32, 0x52, 0x06, 0x6f, + 0x66, 0x66, 0x73, 0x65, 0x74, 0x22, 0xc3, 0x01, 0x0a, 0x0b, 0x43, 0x61, 0x69, 0x72, 0x6f, 0x30, + 0x43, 0x6c, 0x61, 0x73, 0x73, 0x12, 0x10, 0x0a, 0x03, 0x61, 0x62, 0x69, 0x18, 0x01, 0x20, 0x01, + 0x28, 0x0c, 0x52, 0x03, 0x61, 0x62, 0x69, 0x12, 0x29, 0x0a, 0x09, 0x65, 0x78, 0x74, 0x65, 0x72, + 0x6e, 0x61, 0x6c, 0x73, 0x18, 0x02, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x0b, 0x2e, 0x45, 0x6e, 0x74, + 0x72, 0x79, 0x50, 0x6f, 0x69, 0x6e, 0x74, 0x52, 0x09, 0x65, 0x78, 0x74, 0x65, 0x72, 0x6e, 0x61, + 0x6c, 0x73, 0x12, 0x2c, 0x0a, 0x0b, 0x6c, 0x31, 0x5f, 0x68, 0x61, 0x6e, 0x64, 0x6c, 0x65, 0x72, + 0x73, 0x18, 0x03, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x0b, 0x2e, 0x45, 0x6e, 0x74, 0x72, 0x79, 0x50, + 0x6f, 0x69, 0x6e, 0x74, 0x52, 0x0a, 0x6c, 0x31, 0x48, 0x61, 0x6e, 0x64, 0x6c, 0x65, 0x72, 0x73, + 0x12, 0x2f, 0x0a, 0x0c, 0x63, 0x6f, 0x6e, 0x73, 0x74, 0x72, 0x75, 0x63, 0x74, 0x6f, 0x72, 0x73, + 0x18, 0x04, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x0b, 0x2e, 0x45, 0x6e, 0x74, 0x72, 0x79, 0x50, 0x6f, + 0x69, 0x6e, 0x74, 0x52, 0x0c, 0x63, 0x6f, 0x6e, 0x73, 0x74, 0x72, 0x75, 0x63, 0x74, 0x6f, 0x72, + 0x73, 0x12, 0x18, 0x0a, 0x07, 0x70, 0x72, 0x6f, 0x67, 0x72, 0x61, 0x6d, 0x18, 0x05, 0x20, 0x01, + 0x28, 0x0c, 0x52, 0x07, 0x70, 0x72, 0x6f, 0x67, 0x72, 0x61, 0x6d, 0x22, 0x4e, 0x0a, 0x10, 0x53, + 0x69, 0x65, 0x72, 0x72, 0x61, 0x45, 0x6e, 0x74, 0x72, 0x79, 0x50, 0x6f, 0x69, 0x6e, 0x74, 0x12, + 0x14, 0x0a, 0x05, 0x69, 0x6e, 0x64, 0x65, 0x78, 0x18, 0x01, 0x20, 0x01, 0x28, 0x04, 0x52, 0x05, + 0x69, 0x6e, 0x64, 0x65, 0x78, 0x12, 0x24, 0x0a, 0x08, 0x73, 0x65, 0x6c, 0x65, 0x63, 0x74, 0x6f, + 0x72, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x08, 0x2e, 0x46, 0x65, 0x6c, 0x74, 0x32, 0x35, + 0x32, 0x52, 0x08, 0x73, 0x65, 0x6c, 0x65, 0x63, 0x74, 0x6f, 0x72, 0x22, 0xaf, 0x01, 0x0a, 0x11, + 0x43, 0x61, 0x69, 0x72, 0x6f, 0x31, 0x45, 0x6e, 0x74, 0x72, 0x79, 0x50, 0x6f, 0x69, 0x6e, 0x74, + 0x73, 0x12, 0x2f, 0x0a, 0x09, 0x65, 0x78, 0x74, 0x65, 0x72, 0x6e, 0x61, 0x6c, 0x73, 0x18, 0x01, + 0x20, 0x03, 0x28, 0x0b, 0x32, 0x11, 0x2e, 0x53, 0x69, 0x65, 0x72, 0x72, 0x61, 0x45, 0x6e, 0x74, + 0x72, 0x79, 0x50, 0x6f, 0x69, 0x6e, 0x74, 0x52, 0x09, 0x65, 0x78, 0x74, 0x65, 0x72, 0x6e, 0x61, + 0x6c, 0x73, 0x12, 0x32, 0x0a, 0x0b, 0x6c, 0x31, 0x5f, 0x68, 0x61, 0x6e, 0x64, 0x6c, 0x65, 0x72, + 0x73, 0x18, 0x02, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x11, 0x2e, 0x53, 0x69, 0x65, 0x72, 0x72, 0x61, + 0x45, 0x6e, 0x74, 0x72, 0x79, 0x50, 0x6f, 0x69, 0x6e, 0x74, 0x52, 0x0a, 0x6c, 0x31, 0x48, 0x61, + 0x6e, 0x64, 0x6c, 0x65, 0x72, 0x73, 0x12, 0x35, 0x0a, 0x0c, 0x63, 0x6f, 0x6e, 0x73, 0x74, 0x72, + 0x75, 0x63, 0x74, 0x6f, 0x72, 0x73, 0x18, 0x03, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x11, 0x2e, 0x53, + 0x69, 0x65, 0x72, 0x72, 0x61, 0x45, 0x6e, 0x74, 0x72, 0x79, 0x50, 0x6f, 0x69, 0x6e, 0x74, 0x52, + 0x0c, 0x63, 0x6f, 0x6e, 0x73, 0x74, 0x72, 0x75, 0x63, 0x74, 0x6f, 0x72, 0x73, 0x22, 0xcc, 0x01, + 0x0a, 0x0b, 0x43, 0x61, 0x69, 0x72, 0x6f, 0x31, 0x43, 0x6c, 0x61, 0x73, 0x73, 0x12, 0x10, 0x0a, + 0x03, 0x61, 0x62, 0x69, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0c, 0x52, 0x03, 0x61, 0x62, 0x69, 0x12, + 0x35, 0x0a, 0x0c, 0x65, 0x6e, 0x74, 0x72, 0x79, 0x5f, 0x70, 0x6f, 0x69, 0x6e, 0x74, 0x73, 0x18, + 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x12, 0x2e, 0x43, 0x61, 0x69, 0x72, 0x6f, 0x31, 0x45, 0x6e, + 0x74, 0x72, 0x79, 0x50, 0x6f, 0x69, 0x6e, 0x74, 0x73, 0x52, 0x0b, 0x65, 0x6e, 0x74, 0x72, 0x79, + 0x50, 0x6f, 0x69, 0x6e, 0x74, 0x73, 0x12, 0x22, 0x0a, 0x07, 0x70, 0x72, 0x6f, 0x67, 0x72, 0x61, + 0x6d, 0x18, 0x03, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x08, 0x2e, 0x46, 0x65, 0x6c, 0x74, 0x32, 0x35, + 0x32, 0x52, 0x07, 0x70, 0x72, 0x6f, 0x67, 0x72, 0x61, 0x6d, 0x12, 0x34, 0x0a, 0x16, 0x63, 0x6f, + 0x6e, 0x74, 0x72, 0x61, 0x63, 0x74, 0x5f, 0x63, 0x6c, 0x61, 0x73, 0x73, 0x5f, 0x76, 0x65, 0x72, + 0x73, 0x69, 0x6f, 0x6e, 0x18, 0x04, 0x20, 0x01, 0x28, 0x09, 0x52, 0x14, 0x63, 0x6f, 0x6e, 0x74, + 0x72, 0x61, 0x63, 0x74, 0x43, 0x6c, 0x61, 0x73, 0x73, 0x56, 0x65, 0x72, 0x73, 0x69, 0x6f, 0x6e, + 0x12, 0x1a, 0x0a, 0x08, 0x63, 0x6f, 0x6d, 0x70, 0x69, 0x6c, 0x65, 0x64, 0x18, 0x05, 0x20, 0x01, + 0x28, 0x0c, 0x52, 0x08, 0x63, 0x6f, 0x6d, 0x70, 0x69, 0x6c, 0x65, 0x64, 0x22, 0x9e, 0x01, 0x0a, + 0x05, 0x43, 0x6c, 0x61, 0x73, 0x73, 0x12, 0x26, 0x0a, 0x06, 0x63, 0x61, 0x69, 0x72, 0x6f, 0x30, + 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x0c, 0x2e, 0x43, 0x61, 0x69, 0x72, 0x6f, 0x30, 0x43, + 0x6c, 0x61, 0x73, 0x73, 0x48, 0x00, 0x52, 0x06, 0x63, 0x61, 0x69, 0x72, 0x6f, 0x30, 0x12, 0x26, + 0x0a, 0x06, 0x63, 0x61, 0x69, 0x72, 0x6f, 0x31, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x0c, + 0x2e, 0x43, 0x61, 0x69, 0x72, 0x6f, 0x31, 0x43, 0x6c, 0x61, 0x73, 0x73, 0x48, 0x00, 0x52, 0x06, + 0x63, 0x61, 0x69, 0x72, 0x6f, 0x31, 0x12, 0x16, 0x0a, 0x06, 0x64, 0x6f, 0x6d, 0x61, 0x69, 0x6e, + 0x18, 0x03, 0x20, 0x01, 0x28, 0x0d, 0x52, 0x06, 0x64, 0x6f, 0x6d, 0x61, 0x69, 0x6e, 0x12, 0x24, + 0x0a, 0x0a, 0x63, 0x6c, 0x61, 0x73, 0x73, 0x5f, 0x68, 0x61, 0x73, 0x68, 0x18, 0x04, 0x20, 0x01, + 0x28, 0x0b, 0x32, 0x05, 0x2e, 0x48, 0x61, 0x73, 0x68, 0x52, 0x09, 0x63, 0x6c, 0x61, 0x73, 0x73, + 0x48, 0x61, 0x73, 0x68, 0x42, 0x07, 0x0a, 0x05, 0x63, 0x6c, 0x61, 0x73, 0x73, 0x22, 0x3a, 0x0a, + 0x0e, 0x43, 0x6c, 0x61, 0x73, 0x73, 0x65, 0x73, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, + 0x28, 0x0a, 0x09, 0x69, 0x74, 0x65, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x18, 0x01, 0x20, 0x01, + 0x28, 0x0b, 0x32, 0x0a, 0x2e, 0x49, 0x74, 0x65, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x52, 0x09, + 0x69, 0x74, 0x65, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x22, 0x5c, 0x0a, 0x0f, 0x43, 0x6c, 0x61, + 0x73, 0x73, 0x65, 0x73, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x1e, 0x0a, 0x05, + 0x63, 0x6c, 0x61, 0x73, 0x73, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x06, 0x2e, 0x43, 0x6c, + 0x61, 0x73, 0x73, 0x48, 0x00, 0x52, 0x05, 0x63, 0x6c, 0x61, 0x73, 0x73, 0x12, 0x18, 0x0a, 0x03, + 0x66, 0x69, 0x6e, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x04, 0x2e, 0x46, 0x69, 0x6e, 0x48, + 0x00, 0x52, 0x03, 0x66, 0x69, 0x6e, 0x42, 0x0f, 0x0a, 0x0d, 0x63, 0x6c, 0x61, 0x73, 0x73, 0x5f, + 0x6d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x42, 0x31, 0x5a, 0x2f, 0x67, 0x69, 0x74, 0x68, 0x75, + 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x4e, 0x65, 0x74, 0x68, 0x65, 0x72, 0x6d, 0x69, 0x6e, 0x64, + 0x45, 0x74, 0x68, 0x2f, 0x6a, 0x75, 0x6e, 0x6f, 0x2f, 0x70, 0x32, 0x70, 0x2f, 0x73, 0x74, 0x61, + 0x72, 0x6b, 0x6e, 0x65, 0x74, 0x2f, 0x73, 0x70, 0x65, 0x63, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, + 0x6f, 0x33, +} + +var ( + file_p2p_proto_class_proto_rawDescOnce sync.Once + file_p2p_proto_class_proto_rawDescData = file_p2p_proto_class_proto_rawDesc +) + +func file_p2p_proto_class_proto_rawDescGZIP() []byte { + file_p2p_proto_class_proto_rawDescOnce.Do(func() { + file_p2p_proto_class_proto_rawDescData = protoimpl.X.CompressGZIP(file_p2p_proto_class_proto_rawDescData) + }) + return file_p2p_proto_class_proto_rawDescData +} + +var ( + file_p2p_proto_class_proto_msgTypes = make([]protoimpl.MessageInfo, 8) + file_p2p_proto_class_proto_goTypes = []interface{}{ + (*EntryPoint)(nil), // 0: EntryPoint + (*Cairo0Class)(nil), // 1: Cairo0Class + (*SierraEntryPoint)(nil), // 2: SierraEntryPoint + (*Cairo1EntryPoints)(nil), // 3: Cairo1EntryPoints + (*Cairo1Class)(nil), // 4: Cairo1Class + (*Class)(nil), // 5: Class + (*ClassesRequest)(nil), // 6: ClassesRequest + (*ClassesResponse)(nil), // 7: ClassesResponse + (*Felt252)(nil), // 8: Felt252 + (*Hash)(nil), // 9: Hash + (*Iteration)(nil), // 10: Iteration + (*Fin)(nil), // 11: Fin + } +) +var file_p2p_proto_class_proto_depIdxs = []int32{ + 8, // 0: EntryPoint.selector:type_name -> Felt252 + 8, // 1: EntryPoint.offset:type_name -> Felt252 + 0, // 2: Cairo0Class.externals:type_name -> EntryPoint + 0, // 3: Cairo0Class.l1_handlers:type_name -> EntryPoint + 0, // 4: Cairo0Class.constructors:type_name -> EntryPoint + 8, // 5: SierraEntryPoint.selector:type_name -> Felt252 + 2, // 6: Cairo1EntryPoints.externals:type_name -> SierraEntryPoint + 2, // 7: Cairo1EntryPoints.l1_handlers:type_name -> SierraEntryPoint + 2, // 8: Cairo1EntryPoints.constructors:type_name -> SierraEntryPoint + 3, // 9: Cairo1Class.entry_points:type_name -> Cairo1EntryPoints + 8, // 10: Cairo1Class.program:type_name -> Felt252 + 1, // 11: Class.cairo0:type_name -> Cairo0Class + 4, // 12: Class.cairo1:type_name -> Cairo1Class + 9, // 13: Class.class_hash:type_name -> Hash + 10, // 14: ClassesRequest.iteration:type_name -> Iteration + 5, // 15: ClassesResponse.class:type_name -> Class + 11, // 16: ClassesResponse.fin:type_name -> Fin + 17, // [17:17] is the sub-list for method output_type + 17, // [17:17] is the sub-list for method input_type + 17, // [17:17] is the sub-list for extension type_name + 17, // [17:17] is the sub-list for extension extendee + 0, // [0:17] is the sub-list for field type_name +} + +func init() { file_p2p_proto_class_proto_init() } +func file_p2p_proto_class_proto_init() { + if File_p2p_proto_class_proto != nil { + return + } + file_p2p_proto_common_proto_init() + if !protoimpl.UnsafeEnabled { + file_p2p_proto_class_proto_msgTypes[0].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*EntryPoint); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_p2p_proto_class_proto_msgTypes[1].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*Cairo0Class); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_p2p_proto_class_proto_msgTypes[2].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*SierraEntryPoint); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_p2p_proto_class_proto_msgTypes[3].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*Cairo1EntryPoints); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_p2p_proto_class_proto_msgTypes[4].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*Cairo1Class); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_p2p_proto_class_proto_msgTypes[5].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*Class); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_p2p_proto_class_proto_msgTypes[6].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*ClassesRequest); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_p2p_proto_class_proto_msgTypes[7].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*ClassesResponse); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + } + file_p2p_proto_class_proto_msgTypes[5].OneofWrappers = []interface{}{ + (*Class_Cairo0)(nil), + (*Class_Cairo1)(nil), + } + file_p2p_proto_class_proto_msgTypes[7].OneofWrappers = []interface{}{ + (*ClassesResponse_Class)(nil), + (*ClassesResponse_Fin)(nil), + } + type x struct{} + out := protoimpl.TypeBuilder{ + File: protoimpl.DescBuilder{ + GoPackagePath: reflect.TypeOf(x{}).PkgPath(), + RawDescriptor: file_p2p_proto_class_proto_rawDesc, + NumEnums: 0, + NumMessages: 8, + NumExtensions: 0, + NumServices: 0, + }, + GoTypes: file_p2p_proto_class_proto_goTypes, + DependencyIndexes: file_p2p_proto_class_proto_depIdxs, + MessageInfos: file_p2p_proto_class_proto_msgTypes, + }.Build() + File_p2p_proto_class_proto = out.File + file_p2p_proto_class_proto_rawDesc = nil + file_p2p_proto_class_proto_goTypes = nil + file_p2p_proto_class_proto_depIdxs = nil +} diff --git a/p2p/starknet/spec/common.pb.go b/p2p/starknet/spec/common.pb.go index b7270b5420..72f4c74437 100644 --- a/p2p/starknet/spec/common.pb.go +++ b/p2p/starknet/spec/common.pb.go @@ -1,7 +1,7 @@ // Code generated by protoc-gen-go. DO NOT EDIT. // versions: -// protoc-gen-go v1.31.0 -// protoc v4.24.4 +// protoc-gen-go v1.26.0 +// protoc v4.25.1 // source: p2p/proto/common.proto package spec @@ -67,58 +67,6 @@ func (Iteration_Direction) EnumDescriptor() ([]byte, []int) { return file_p2p_proto_common_proto_rawDescGZIP(), []int{9, 0} } -type Fin_Error int32 - -const ( - Fin_busy Fin_Error = 0 - Fin_too_much Fin_Error = 1 - Fin_unknown Fin_Error = 2 - Fin_pruned Fin_Error = 3 -) - -// Enum value maps for Fin_Error. -var ( - Fin_Error_name = map[int32]string{ - 0: "busy", - 1: "too_much", - 2: "unknown", - 3: "pruned", - } - Fin_Error_value = map[string]int32{ - "busy": 0, - "too_much": 1, - "unknown": 2, - "pruned": 3, - } -) - -func (x Fin_Error) Enum() *Fin_Error { - p := new(Fin_Error) - *p = x - return p -} - -func (x Fin_Error) String() string { - return protoimpl.X.EnumStringOf(x.Descriptor(), protoreflect.EnumNumber(x)) -} - -func (Fin_Error) Descriptor() protoreflect.EnumDescriptor { - return file_p2p_proto_common_proto_enumTypes[1].Descriptor() -} - -func (Fin_Error) Type() protoreflect.EnumType { - return &file_p2p_proto_common_proto_enumTypes[1] -} - -func (x Fin_Error) Number() protoreflect.EnumNumber { - return protoreflect.EnumNumber(x) -} - -// Deprecated: Use Fin_Error.Descriptor instead. -func (Fin_Error) EnumDescriptor() ([]byte, []int) { - return file_p2p_proto_common_proto_rawDescGZIP(), []int{10, 0} -} - type Felt252 struct { state protoimpl.MessageState sizeCache protoimpl.SizeCache @@ -686,8 +634,6 @@ type Fin struct { state protoimpl.MessageState sizeCache protoimpl.SizeCache unknownFields protoimpl.UnknownFields - - Error *Fin_Error `protobuf:"varint,1,opt,name=error,proto3,enum=Fin_Error,oneof" json:"error,omitempty"` } func (x *Fin) Reset() { @@ -722,13 +668,6 @@ func (*Fin) Descriptor() ([]byte, []int) { return file_p2p_proto_common_proto_rawDescGZIP(), []int{10} } -func (x *Fin) GetError() Fin_Error { - if x != nil && x.Error != nil { - return *x.Error - } - return Fin_busy -} - var File_p2p_proto_common_proto protoreflect.FileDescriptor var file_p2p_proto_common_proto_rawDesc = []byte{ @@ -775,14 +714,11 @@ var file_p2p_proto_common_proto_rawDesc = []byte{ 0x73, 0x74, 0x65, 0x70, 0x22, 0x26, 0x0a, 0x09, 0x44, 0x69, 0x72, 0x65, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x12, 0x0b, 0x0a, 0x07, 0x46, 0x6f, 0x72, 0x77, 0x61, 0x72, 0x64, 0x10, 0x00, 0x12, 0x0c, 0x0a, 0x08, 0x42, 0x61, 0x63, 0x6b, 0x77, 0x61, 0x72, 0x64, 0x10, 0x01, 0x42, 0x07, 0x0a, 0x05, - 0x73, 0x74, 0x61, 0x72, 0x74, 0x22, 0x70, 0x0a, 0x03, 0x46, 0x69, 0x6e, 0x12, 0x25, 0x0a, 0x05, - 0x65, 0x72, 0x72, 0x6f, 0x72, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0e, 0x32, 0x0a, 0x2e, 0x46, 0x69, - 0x6e, 0x2e, 0x45, 0x72, 0x72, 0x6f, 0x72, 0x48, 0x00, 0x52, 0x05, 0x65, 0x72, 0x72, 0x6f, 0x72, - 0x88, 0x01, 0x01, 0x22, 0x38, 0x0a, 0x05, 0x45, 0x72, 0x72, 0x6f, 0x72, 0x12, 0x08, 0x0a, 0x04, - 0x62, 0x75, 0x73, 0x79, 0x10, 0x00, 0x12, 0x0c, 0x0a, 0x08, 0x74, 0x6f, 0x6f, 0x5f, 0x6d, 0x75, - 0x63, 0x68, 0x10, 0x01, 0x12, 0x0b, 0x0a, 0x07, 0x75, 0x6e, 0x6b, 0x6e, 0x6f, 0x77, 0x6e, 0x10, - 0x02, 0x12, 0x0a, 0x0a, 0x06, 0x70, 0x72, 0x75, 0x6e, 0x65, 0x64, 0x10, 0x03, 0x42, 0x08, 0x0a, - 0x06, 0x5f, 0x65, 0x72, 0x72, 0x6f, 0x72, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, + 0x73, 0x74, 0x61, 0x72, 0x74, 0x22, 0x05, 0x0a, 0x03, 0x46, 0x69, 0x6e, 0x42, 0x31, 0x5a, 0x2f, + 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x4e, 0x65, 0x74, 0x68, 0x65, + 0x72, 0x6d, 0x69, 0x6e, 0x64, 0x45, 0x74, 0x68, 0x2f, 0x6a, 0x75, 0x6e, 0x6f, 0x2f, 0x70, 0x32, + 0x70, 0x2f, 0x73, 0x74, 0x61, 0x72, 0x6b, 0x6e, 0x65, 0x74, 0x2f, 0x73, 0x70, 0x65, 0x63, 0x62, + 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, } var ( @@ -798,40 +734,37 @@ func file_p2p_proto_common_proto_rawDescGZIP() []byte { } var ( - file_p2p_proto_common_proto_enumTypes = make([]protoimpl.EnumInfo, 2) + file_p2p_proto_common_proto_enumTypes = make([]protoimpl.EnumInfo, 1) file_p2p_proto_common_proto_msgTypes = make([]protoimpl.MessageInfo, 11) file_p2p_proto_common_proto_goTypes = []interface{}{ (Iteration_Direction)(0), // 0: Iteration.Direction - (Fin_Error)(0), // 1: Fin.Error - (*Felt252)(nil), // 2: Felt252 - (*Hash)(nil), // 3: Hash - (*Hashes)(nil), // 4: Hashes - (*Address)(nil), // 5: Address - (*PeerID)(nil), // 6: PeerID - (*ConsensusSignature)(nil), // 7: ConsensusSignature - (*Merkle)(nil), // 8: Merkle - (*Patricia)(nil), // 9: Patricia - (*BlockID)(nil), // 10: BlockID - (*Iteration)(nil), // 11: Iteration - (*Fin)(nil), // 12: Fin + (*Felt252)(nil), // 1: Felt252 + (*Hash)(nil), // 2: Hash + (*Hashes)(nil), // 3: Hashes + (*Address)(nil), // 4: Address + (*PeerID)(nil), // 5: PeerID + (*ConsensusSignature)(nil), // 6: ConsensusSignature + (*Merkle)(nil), // 7: Merkle + (*Patricia)(nil), // 8: Patricia + (*BlockID)(nil), // 9: BlockID + (*Iteration)(nil), // 10: Iteration + (*Fin)(nil), // 11: Fin } ) - var file_p2p_proto_common_proto_depIdxs = []int32{ - 3, // 0: Hashes.items:type_name -> Hash - 2, // 1: ConsensusSignature.r:type_name -> Felt252 - 2, // 2: ConsensusSignature.s:type_name -> Felt252 - 3, // 3: Merkle.root:type_name -> Hash - 3, // 4: Patricia.root:type_name -> Hash - 3, // 5: BlockID.header:type_name -> Hash - 3, // 6: Iteration.header:type_name -> Hash + 2, // 0: Hashes.items:type_name -> Hash + 1, // 1: ConsensusSignature.r:type_name -> Felt252 + 1, // 2: ConsensusSignature.s:type_name -> Felt252 + 2, // 3: Merkle.root:type_name -> Hash + 2, // 4: Patricia.root:type_name -> Hash + 2, // 5: BlockID.header:type_name -> Hash + 2, // 6: Iteration.header:type_name -> Hash 0, // 7: Iteration.direction:type_name -> Iteration.Direction - 1, // 8: Fin.error:type_name -> Fin.Error - 9, // [9:9] is the sub-list for method output_type - 9, // [9:9] is the sub-list for method input_type - 9, // [9:9] is the sub-list for extension type_name - 9, // [9:9] is the sub-list for extension extendee - 0, // [0:9] is the sub-list for field type_name + 8, // [8:8] is the sub-list for method output_type + 8, // [8:8] is the sub-list for method input_type + 8, // [8:8] is the sub-list for extension type_name + 8, // [8:8] is the sub-list for extension extendee + 0, // [0:8] is the sub-list for field type_name } func init() { file_p2p_proto_common_proto_init() } @@ -977,13 +910,12 @@ func file_p2p_proto_common_proto_init() { (*Iteration_BlockNumber)(nil), (*Iteration_Header)(nil), } - file_p2p_proto_common_proto_msgTypes[10].OneofWrappers = []interface{}{} type x struct{} out := protoimpl.TypeBuilder{ File: protoimpl.DescBuilder{ GoPackagePath: reflect.TypeOf(x{}).PkgPath(), RawDescriptor: file_p2p_proto_common_proto_rawDesc, - NumEnums: 2, + NumEnums: 1, NumMessages: 11, NumExtensions: 0, NumServices: 0, diff --git a/p2p/starknet/spec/event.pb.go b/p2p/starknet/spec/event.pb.go index c3d21f897f..14135b14e2 100644 --- a/p2p/starknet/spec/event.pb.go +++ b/p2p/starknet/spec/event.pb.go @@ -1,7 +1,7 @@ // Code generated by protoc-gen-go. DO NOT EDIT. // versions: -// protoc-gen-go v1.31.0 -// protoc v4.24.4 +// protoc-gen-go v1.26.0 +// protoc v4.25.1 // source: p2p/proto/event.proto package spec @@ -139,71 +139,23 @@ func (x *EventsRequest) GetIteration() *Iteration { return nil } -type Events struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - Items []*Event `protobuf:"bytes,1,rep,name=items,proto3" json:"items,omitempty"` -} - -func (x *Events) Reset() { - *x = Events{} - if protoimpl.UnsafeEnabled { - mi := &file_p2p_proto_event_proto_msgTypes[2] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *Events) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*Events) ProtoMessage() {} - -func (x *Events) ProtoReflect() protoreflect.Message { - mi := &file_p2p_proto_event_proto_msgTypes[2] - if protoimpl.UnsafeEnabled && x != nil { - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - if ms.LoadMessageInfo() == nil { - ms.StoreMessageInfo(mi) - } - return ms - } - return mi.MessageOf(x) -} - -// Deprecated: Use Events.ProtoReflect.Descriptor instead. -func (*Events) Descriptor() ([]byte, []int) { - return file_p2p_proto_event_proto_rawDescGZIP(), []int{2} -} - -func (x *Events) GetItems() []*Event { - if x != nil { - return x.Items - } - return nil -} - -// can be several in a single reply +// Responses are sent ordered by the order given in the request. type EventsResponse struct { state protoimpl.MessageState sizeCache protoimpl.SizeCache unknownFields protoimpl.UnknownFields - Id *BlockID `protobuf:"bytes,1,opt,name=id,proto3,oneof" json:"id,omitempty"` // may not appear if Fin is sent to end the whole response - // Types that are assignable to Responses: + // Types that are assignable to EventMessage: // - // *EventsResponse_Events + // *EventsResponse_Event // *EventsResponse_Fin - Responses isEventsResponse_Responses `protobuf_oneof:"responses"` + EventMessage isEventsResponse_EventMessage `protobuf_oneof:"event_message"` } func (x *EventsResponse) Reset() { *x = EventsResponse{} if protoimpl.UnsafeEnabled { - mi := &file_p2p_proto_event_proto_msgTypes[3] + mi := &file_p2p_proto_event_proto_msgTypes[2] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -216,7 +168,7 @@ func (x *EventsResponse) String() string { func (*EventsResponse) ProtoMessage() {} func (x *EventsResponse) ProtoReflect() protoreflect.Message { - mi := &file_p2p_proto_event_proto_msgTypes[3] + mi := &file_p2p_proto_event_proto_msgTypes[2] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -229,52 +181,45 @@ func (x *EventsResponse) ProtoReflect() protoreflect.Message { // Deprecated: Use EventsResponse.ProtoReflect.Descriptor instead. func (*EventsResponse) Descriptor() ([]byte, []int) { - return file_p2p_proto_event_proto_rawDescGZIP(), []int{3} -} - -func (x *EventsResponse) GetId() *BlockID { - if x != nil { - return x.Id - } - return nil + return file_p2p_proto_event_proto_rawDescGZIP(), []int{2} } -func (m *EventsResponse) GetResponses() isEventsResponse_Responses { +func (m *EventsResponse) GetEventMessage() isEventsResponse_EventMessage { if m != nil { - return m.Responses + return m.EventMessage } return nil } -func (x *EventsResponse) GetEvents() *Events { - if x, ok := x.GetResponses().(*EventsResponse_Events); ok { - return x.Events +func (x *EventsResponse) GetEvent() *Event { + if x, ok := x.GetEventMessage().(*EventsResponse_Event); ok { + return x.Event } return nil } func (x *EventsResponse) GetFin() *Fin { - if x, ok := x.GetResponses().(*EventsResponse_Fin); ok { + if x, ok := x.GetEventMessage().(*EventsResponse_Fin); ok { return x.Fin } return nil } -type isEventsResponse_Responses interface { - isEventsResponse_Responses() +type isEventsResponse_EventMessage interface { + isEventsResponse_EventMessage() } -type EventsResponse_Events struct { - Events *Events `protobuf:"bytes,2,opt,name=events,proto3,oneof"` +type EventsResponse_Event struct { + Event *Event `protobuf:"bytes,1,opt,name=event,proto3,oneof"` } type EventsResponse_Fin struct { - Fin *Fin `protobuf:"bytes,3,opt,name=fin,proto3,oneof"` + Fin *Fin `protobuf:"bytes,2,opt,name=fin,proto3,oneof"` // Fin is sent after the peer sent all the data or when it encountered a block that it doesn't have its events. } -func (*EventsResponse_Events) isEventsResponse_Responses() {} +func (*EventsResponse_Event) isEventsResponse_EventMessage() {} -func (*EventsResponse_Fin) isEventsResponse_Responses() {} +func (*EventsResponse_Fin) isEventsResponse_EventMessage() {} var File_p2p_proto_event_proto protoreflect.FileDescriptor @@ -296,18 +241,16 @@ var file_p2p_proto_event_proto_rawDesc = []byte{ 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x28, 0x0a, 0x09, 0x69, 0x74, 0x65, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x0a, 0x2e, 0x49, 0x74, 0x65, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x52, 0x09, 0x69, 0x74, 0x65, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x22, - 0x26, 0x0a, 0x06, 0x45, 0x76, 0x65, 0x6e, 0x74, 0x73, 0x12, 0x1c, 0x0a, 0x05, 0x69, 0x74, 0x65, - 0x6d, 0x73, 0x18, 0x01, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x06, 0x2e, 0x45, 0x76, 0x65, 0x6e, 0x74, - 0x52, 0x05, 0x69, 0x74, 0x65, 0x6d, 0x73, 0x22, 0x80, 0x01, 0x0a, 0x0e, 0x45, 0x76, 0x65, 0x6e, - 0x74, 0x73, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x1d, 0x0a, 0x02, 0x69, 0x64, - 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x08, 0x2e, 0x42, 0x6c, 0x6f, 0x63, 0x6b, 0x49, 0x44, - 0x48, 0x01, 0x52, 0x02, 0x69, 0x64, 0x88, 0x01, 0x01, 0x12, 0x21, 0x0a, 0x06, 0x65, 0x76, 0x65, - 0x6e, 0x74, 0x73, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x07, 0x2e, 0x45, 0x76, 0x65, 0x6e, - 0x74, 0x73, 0x48, 0x00, 0x52, 0x06, 0x65, 0x76, 0x65, 0x6e, 0x74, 0x73, 0x12, 0x18, 0x0a, 0x03, - 0x66, 0x69, 0x6e, 0x18, 0x03, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x04, 0x2e, 0x46, 0x69, 0x6e, 0x48, - 0x00, 0x52, 0x03, 0x66, 0x69, 0x6e, 0x42, 0x0b, 0x0a, 0x09, 0x72, 0x65, 0x73, 0x70, 0x6f, 0x6e, - 0x73, 0x65, 0x73, 0x42, 0x05, 0x0a, 0x03, 0x5f, 0x69, 0x64, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, - 0x6f, 0x33, + 0x5b, 0x0a, 0x0e, 0x45, 0x76, 0x65, 0x6e, 0x74, 0x73, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, + 0x65, 0x12, 0x1e, 0x0a, 0x05, 0x65, 0x76, 0x65, 0x6e, 0x74, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, + 0x32, 0x06, 0x2e, 0x45, 0x76, 0x65, 0x6e, 0x74, 0x48, 0x00, 0x52, 0x05, 0x65, 0x76, 0x65, 0x6e, + 0x74, 0x12, 0x18, 0x0a, 0x03, 0x66, 0x69, 0x6e, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x04, + 0x2e, 0x46, 0x69, 0x6e, 0x48, 0x00, 0x52, 0x03, 0x66, 0x69, 0x6e, 0x42, 0x0f, 0x0a, 0x0d, 0x65, + 0x76, 0x65, 0x6e, 0x74, 0x5f, 0x6d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x42, 0x31, 0x5a, 0x2f, + 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x4e, 0x65, 0x74, 0x68, 0x65, + 0x72, 0x6d, 0x69, 0x6e, 0x64, 0x45, 0x74, 0x68, 0x2f, 0x6a, 0x75, 0x6e, 0x6f, 0x2f, 0x70, 0x32, + 0x70, 0x2f, 0x73, 0x74, 0x61, 0x72, 0x6b, 0x6e, 0x65, 0x74, 0x2f, 0x73, 0x70, 0x65, 0x63, 0x62, + 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, } var ( @@ -323,35 +266,30 @@ func file_p2p_proto_event_proto_rawDescGZIP() []byte { } var ( - file_p2p_proto_event_proto_msgTypes = make([]protoimpl.MessageInfo, 4) + file_p2p_proto_event_proto_msgTypes = make([]protoimpl.MessageInfo, 3) file_p2p_proto_event_proto_goTypes = []interface{}{ (*Event)(nil), // 0: Event (*EventsRequest)(nil), // 1: EventsRequest - (*Events)(nil), // 2: Events - (*EventsResponse)(nil), // 3: EventsResponse - (*Hash)(nil), // 4: Hash - (*Felt252)(nil), // 5: Felt252 - (*Iteration)(nil), // 6: Iteration - (*BlockID)(nil), // 7: BlockID - (*Fin)(nil), // 8: Fin + (*EventsResponse)(nil), // 2: EventsResponse + (*Hash)(nil), // 3: Hash + (*Felt252)(nil), // 4: Felt252 + (*Iteration)(nil), // 5: Iteration + (*Fin)(nil), // 6: Fin } ) - var file_p2p_proto_event_proto_depIdxs = []int32{ - 4, // 0: Event.transaction_hash:type_name -> Hash - 5, // 1: Event.from_address:type_name -> Felt252 - 5, // 2: Event.keys:type_name -> Felt252 - 5, // 3: Event.data:type_name -> Felt252 - 6, // 4: EventsRequest.iteration:type_name -> Iteration - 0, // 5: Events.items:type_name -> Event - 7, // 6: EventsResponse.id:type_name -> BlockID - 2, // 7: EventsResponse.events:type_name -> Events - 8, // 8: EventsResponse.fin:type_name -> Fin - 9, // [9:9] is the sub-list for method output_type - 9, // [9:9] is the sub-list for method input_type - 9, // [9:9] is the sub-list for extension type_name - 9, // [9:9] is the sub-list for extension extendee - 0, // [0:9] is the sub-list for field type_name + 3, // 0: Event.transaction_hash:type_name -> Hash + 4, // 1: Event.from_address:type_name -> Felt252 + 4, // 2: Event.keys:type_name -> Felt252 + 4, // 3: Event.data:type_name -> Felt252 + 5, // 4: EventsRequest.iteration:type_name -> Iteration + 0, // 5: EventsResponse.event:type_name -> Event + 6, // 6: EventsResponse.fin:type_name -> Fin + 7, // [7:7] is the sub-list for method output_type + 7, // [7:7] is the sub-list for method input_type + 7, // [7:7] is the sub-list for extension type_name + 7, // [7:7] is the sub-list for extension extendee + 0, // [0:7] is the sub-list for field type_name } func init() { file_p2p_proto_event_proto_init() } @@ -386,18 +324,6 @@ func file_p2p_proto_event_proto_init() { } } file_p2p_proto_event_proto_msgTypes[2].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*Events); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_p2p_proto_event_proto_msgTypes[3].Exporter = func(v interface{}, i int) interface{} { switch v := v.(*EventsResponse); i { case 0: return &v.state @@ -410,8 +336,8 @@ func file_p2p_proto_event_proto_init() { } } } - file_p2p_proto_event_proto_msgTypes[3].OneofWrappers = []interface{}{ - (*EventsResponse_Events)(nil), + file_p2p_proto_event_proto_msgTypes[2].OneofWrappers = []interface{}{ + (*EventsResponse_Event)(nil), (*EventsResponse_Fin)(nil), } type x struct{} @@ -420,7 +346,7 @@ func file_p2p_proto_event_proto_init() { GoPackagePath: reflect.TypeOf(x{}).PkgPath(), RawDescriptor: file_p2p_proto_event_proto_rawDesc, NumEnums: 0, - NumMessages: 4, + NumMessages: 3, NumExtensions: 0, NumServices: 0, }, diff --git a/p2p/starknet/spec/header.pb.go b/p2p/starknet/spec/header.pb.go new file mode 100644 index 0000000000..ca7d1ec186 --- /dev/null +++ b/p2p/starknet/spec/header.pb.go @@ -0,0 +1,627 @@ +// Code generated by protoc-gen-go. DO NOT EDIT. +// versions: +// protoc-gen-go v1.26.0 +// protoc v4.25.1 +// source: p2p/proto/header.proto + +package spec + +import ( + reflect "reflect" + sync "sync" + + protoreflect "google.golang.org/protobuf/reflect/protoreflect" + protoimpl "google.golang.org/protobuf/runtime/protoimpl" +) + +const ( + // Verify that this generated code is sufficiently up-to-date. + _ = protoimpl.EnforceVersion(20 - protoimpl.MinVersion) + // Verify that runtime/protoimpl is sufficiently up-to-date. + _ = protoimpl.EnforceVersion(protoimpl.MaxVersion - 20) +) + +// Note: commitments may change to be for the previous blocks like comet/tendermint +// hash of block header sent to L1 +type SignedBlockHeader struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + BlockHash *Hash `protobuf:"bytes,1,opt,name=block_hash,json=blockHash,proto3" json:"block_hash,omitempty"` // For the structure of the block hash, see https://docs.starknet.io/documentation/architecture_and_concepts/Network_Architecture/header/#block_hash + ParentHash *Hash `protobuf:"bytes,2,opt,name=parent_hash,json=parentHash,proto3" json:"parent_hash,omitempty"` + Number uint64 `protobuf:"varint,3,opt,name=number,proto3" json:"number,omitempty"` + Time uint64 `protobuf:"varint,4,opt,name=time,proto3" json:"time,omitempty"` // Encoded in Unix time. + SequencerAddress *Address `protobuf:"bytes,5,opt,name=sequencer_address,json=sequencerAddress,proto3" json:"sequencer_address,omitempty"` + StateDiffCommitment *Hash `protobuf:"bytes,6,opt,name=state_diff_commitment,json=stateDiffCommitment,proto3" json:"state_diff_commitment,omitempty"` // The state diff commitment returned by the Starknet Feeder Gateway. + // For more info, see https://community.starknet.io/t/introducing-p2p-authentication-and-mismatch-resolution-in-v0-12-2/97993 + State *Patricia `protobuf:"bytes,7,opt,name=state,proto3" json:"state,omitempty"` // hash of contract and class patricia tries. Same as in L1. Later more trees will be included + // The following merkles can be built on the fly while sequencing/validating txs. + Transactions *Merkle `protobuf:"bytes,8,opt,name=transactions,proto3" json:"transactions,omitempty"` // By order of execution. TBD: required? the client can execute (powerful machine) and match state diff + Events *Merkle `protobuf:"bytes,9,opt,name=events,proto3" json:"events,omitempty"` // By order of issuance. TBD: in receipts? + Receipts *Merkle `protobuf:"bytes,10,opt,name=receipts,proto3" json:"receipts,omitempty"` // By order of issuance. + ProtocolVersion string `protobuf:"bytes,11,opt,name=protocol_version,json=protocolVersion,proto3" json:"protocol_version,omitempty"` // Starknet version + GasPrice *Felt252 `protobuf:"bytes,12,opt,name=gas_price,json=gasPrice,proto3" json:"gas_price,omitempty"` + NumStorageDiffs uint64 `protobuf:"varint,13,opt,name=num_storage_diffs,json=numStorageDiffs,proto3" json:"num_storage_diffs,omitempty"` + NumNonceUpdates uint64 `protobuf:"varint,14,opt,name=num_nonce_updates,json=numNonceUpdates,proto3" json:"num_nonce_updates,omitempty"` + NumDeclaredClasses uint64 `protobuf:"varint,15,opt,name=num_declared_classes,json=numDeclaredClasses,proto3" json:"num_declared_classes,omitempty"` // Includes both Cairo 0 and Cairo 1. + NumDeployedContracts uint64 `protobuf:"varint,16,opt,name=num_deployed_contracts,json=numDeployedContracts,proto3" json:"num_deployed_contracts,omitempty"` // This includes the replaced classes too. + // for now, we assume a small consensus, so this fits in 1M. Else, these will be repeated and extracted from this message. + Signatures []*ConsensusSignature `protobuf:"bytes,17,rep,name=signatures,proto3" json:"signatures,omitempty"` // can be more explicit here about the signature structure as this is not part of account abstraction +} + +func (x *SignedBlockHeader) Reset() { + *x = SignedBlockHeader{} + if protoimpl.UnsafeEnabled { + mi := &file_p2p_proto_header_proto_msgTypes[0] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *SignedBlockHeader) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*SignedBlockHeader) ProtoMessage() {} + +func (x *SignedBlockHeader) ProtoReflect() protoreflect.Message { + mi := &file_p2p_proto_header_proto_msgTypes[0] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use SignedBlockHeader.ProtoReflect.Descriptor instead. +func (*SignedBlockHeader) Descriptor() ([]byte, []int) { + return file_p2p_proto_header_proto_rawDescGZIP(), []int{0} +} + +func (x *SignedBlockHeader) GetBlockHash() *Hash { + if x != nil { + return x.BlockHash + } + return nil +} + +func (x *SignedBlockHeader) GetParentHash() *Hash { + if x != nil { + return x.ParentHash + } + return nil +} + +func (x *SignedBlockHeader) GetNumber() uint64 { + if x != nil { + return x.Number + } + return 0 +} + +func (x *SignedBlockHeader) GetTime() uint64 { + if x != nil { + return x.Time + } + return 0 +} + +func (x *SignedBlockHeader) GetSequencerAddress() *Address { + if x != nil { + return x.SequencerAddress + } + return nil +} + +func (x *SignedBlockHeader) GetStateDiffCommitment() *Hash { + if x != nil { + return x.StateDiffCommitment + } + return nil +} + +func (x *SignedBlockHeader) GetState() *Patricia { + if x != nil { + return x.State + } + return nil +} + +func (x *SignedBlockHeader) GetTransactions() *Merkle { + if x != nil { + return x.Transactions + } + return nil +} + +func (x *SignedBlockHeader) GetEvents() *Merkle { + if x != nil { + return x.Events + } + return nil +} + +func (x *SignedBlockHeader) GetReceipts() *Merkle { + if x != nil { + return x.Receipts + } + return nil +} + +func (x *SignedBlockHeader) GetProtocolVersion() string { + if x != nil { + return x.ProtocolVersion + } + return "" +} + +func (x *SignedBlockHeader) GetGasPrice() *Felt252 { + if x != nil { + return x.GasPrice + } + return nil +} + +func (x *SignedBlockHeader) GetNumStorageDiffs() uint64 { + if x != nil { + return x.NumStorageDiffs + } + return 0 +} + +func (x *SignedBlockHeader) GetNumNonceUpdates() uint64 { + if x != nil { + return x.NumNonceUpdates + } + return 0 +} + +func (x *SignedBlockHeader) GetNumDeclaredClasses() uint64 { + if x != nil { + return x.NumDeclaredClasses + } + return 0 +} + +func (x *SignedBlockHeader) GetNumDeployedContracts() uint64 { + if x != nil { + return x.NumDeployedContracts + } + return 0 +} + +func (x *SignedBlockHeader) GetSignatures() []*ConsensusSignature { + if x != nil { + return x.Signatures + } + return nil +} + +// sent to all peers (except the ones this was received from, if any). +// for a fraction of peers, also send the GetBlockHeaders response (as if they asked for it for this block) +type NewBlock struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + // Types that are assignable to MaybeFull: + // + // *NewBlock_Id + // *NewBlock_Header + MaybeFull isNewBlock_MaybeFull `protobuf_oneof:"maybe_full"` +} + +func (x *NewBlock) Reset() { + *x = NewBlock{} + if protoimpl.UnsafeEnabled { + mi := &file_p2p_proto_header_proto_msgTypes[1] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *NewBlock) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*NewBlock) ProtoMessage() {} + +func (x *NewBlock) ProtoReflect() protoreflect.Message { + mi := &file_p2p_proto_header_proto_msgTypes[1] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use NewBlock.ProtoReflect.Descriptor instead. +func (*NewBlock) Descriptor() ([]byte, []int) { + return file_p2p_proto_header_proto_rawDescGZIP(), []int{1} +} + +func (m *NewBlock) GetMaybeFull() isNewBlock_MaybeFull { + if m != nil { + return m.MaybeFull + } + return nil +} + +func (x *NewBlock) GetId() *BlockID { + if x, ok := x.GetMaybeFull().(*NewBlock_Id); ok { + return x.Id + } + return nil +} + +func (x *NewBlock) GetHeader() *BlockHeadersResponse { + if x, ok := x.GetMaybeFull().(*NewBlock_Header); ok { + return x.Header + } + return nil +} + +type isNewBlock_MaybeFull interface { + isNewBlock_MaybeFull() +} + +type NewBlock_Id struct { + Id *BlockID `protobuf:"bytes,1,opt,name=id,proto3,oneof"` +} + +type NewBlock_Header struct { + Header *BlockHeadersResponse `protobuf:"bytes,2,opt,name=header,proto3,oneof"` +} + +func (*NewBlock_Id) isNewBlock_MaybeFull() {} + +func (*NewBlock_Header) isNewBlock_MaybeFull() {} + +type BlockHeadersRequest struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Iteration *Iteration `protobuf:"bytes,1,opt,name=iteration,proto3" json:"iteration,omitempty"` +} + +func (x *BlockHeadersRequest) Reset() { + *x = BlockHeadersRequest{} + if protoimpl.UnsafeEnabled { + mi := &file_p2p_proto_header_proto_msgTypes[2] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *BlockHeadersRequest) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*BlockHeadersRequest) ProtoMessage() {} + +func (x *BlockHeadersRequest) ProtoReflect() protoreflect.Message { + mi := &file_p2p_proto_header_proto_msgTypes[2] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use BlockHeadersRequest.ProtoReflect.Descriptor instead. +func (*BlockHeadersRequest) Descriptor() ([]byte, []int) { + return file_p2p_proto_header_proto_rawDescGZIP(), []int{2} +} + +func (x *BlockHeadersRequest) GetIteration() *Iteration { + if x != nil { + return x.Iteration + } + return nil +} + +// Responses are sent ordered by the order given in the request. +type BlockHeadersResponse struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + // Types that are assignable to HeaderMessage: + // + // *BlockHeadersResponse_Header + // *BlockHeadersResponse_Fin + HeaderMessage isBlockHeadersResponse_HeaderMessage `protobuf_oneof:"header_message"` +} + +func (x *BlockHeadersResponse) Reset() { + *x = BlockHeadersResponse{} + if protoimpl.UnsafeEnabled { + mi := &file_p2p_proto_header_proto_msgTypes[3] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *BlockHeadersResponse) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*BlockHeadersResponse) ProtoMessage() {} + +func (x *BlockHeadersResponse) ProtoReflect() protoreflect.Message { + mi := &file_p2p_proto_header_proto_msgTypes[3] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use BlockHeadersResponse.ProtoReflect.Descriptor instead. +func (*BlockHeadersResponse) Descriptor() ([]byte, []int) { + return file_p2p_proto_header_proto_rawDescGZIP(), []int{3} +} + +func (m *BlockHeadersResponse) GetHeaderMessage() isBlockHeadersResponse_HeaderMessage { + if m != nil { + return m.HeaderMessage + } + return nil +} + +func (x *BlockHeadersResponse) GetHeader() *SignedBlockHeader { + if x, ok := x.GetHeaderMessage().(*BlockHeadersResponse_Header); ok { + return x.Header + } + return nil +} + +func (x *BlockHeadersResponse) GetFin() *Fin { + if x, ok := x.GetHeaderMessage().(*BlockHeadersResponse_Fin); ok { + return x.Fin + } + return nil +} + +type isBlockHeadersResponse_HeaderMessage interface { + isBlockHeadersResponse_HeaderMessage() +} + +type BlockHeadersResponse_Header struct { + Header *SignedBlockHeader `protobuf:"bytes,1,opt,name=header,proto3,oneof"` +} + +type BlockHeadersResponse_Fin struct { + Fin *Fin `protobuf:"bytes,2,opt,name=fin,proto3,oneof"` // Fin is sent after the peer sent all the data or when it encountered a block that it doesn't have its header. +} + +func (*BlockHeadersResponse_Header) isBlockHeadersResponse_HeaderMessage() {} + +func (*BlockHeadersResponse_Fin) isBlockHeadersResponse_HeaderMessage() {} + +var File_p2p_proto_header_proto protoreflect.FileDescriptor + +var file_p2p_proto_header_proto_rawDesc = []byte{ + 0x0a, 0x16, 0x70, 0x32, 0x70, 0x2f, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2f, 0x68, 0x65, 0x61, 0x64, + 0x65, 0x72, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x1a, 0x16, 0x70, 0x32, 0x70, 0x2f, 0x70, 0x72, + 0x6f, 0x74, 0x6f, 0x2f, 0x63, 0x6f, 0x6d, 0x6d, 0x6f, 0x6e, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, + 0x22, 0xda, 0x05, 0x0a, 0x11, 0x53, 0x69, 0x67, 0x6e, 0x65, 0x64, 0x42, 0x6c, 0x6f, 0x63, 0x6b, + 0x48, 0x65, 0x61, 0x64, 0x65, 0x72, 0x12, 0x24, 0x0a, 0x0a, 0x62, 0x6c, 0x6f, 0x63, 0x6b, 0x5f, + 0x68, 0x61, 0x73, 0x68, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x05, 0x2e, 0x48, 0x61, 0x73, + 0x68, 0x52, 0x09, 0x62, 0x6c, 0x6f, 0x63, 0x6b, 0x48, 0x61, 0x73, 0x68, 0x12, 0x26, 0x0a, 0x0b, + 0x70, 0x61, 0x72, 0x65, 0x6e, 0x74, 0x5f, 0x68, 0x61, 0x73, 0x68, 0x18, 0x02, 0x20, 0x01, 0x28, + 0x0b, 0x32, 0x05, 0x2e, 0x48, 0x61, 0x73, 0x68, 0x52, 0x0a, 0x70, 0x61, 0x72, 0x65, 0x6e, 0x74, + 0x48, 0x61, 0x73, 0x68, 0x12, 0x16, 0x0a, 0x06, 0x6e, 0x75, 0x6d, 0x62, 0x65, 0x72, 0x18, 0x03, + 0x20, 0x01, 0x28, 0x04, 0x52, 0x06, 0x6e, 0x75, 0x6d, 0x62, 0x65, 0x72, 0x12, 0x12, 0x0a, 0x04, + 0x74, 0x69, 0x6d, 0x65, 0x18, 0x04, 0x20, 0x01, 0x28, 0x04, 0x52, 0x04, 0x74, 0x69, 0x6d, 0x65, + 0x12, 0x35, 0x0a, 0x11, 0x73, 0x65, 0x71, 0x75, 0x65, 0x6e, 0x63, 0x65, 0x72, 0x5f, 0x61, 0x64, + 0x64, 0x72, 0x65, 0x73, 0x73, 0x18, 0x05, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x08, 0x2e, 0x41, 0x64, + 0x64, 0x72, 0x65, 0x73, 0x73, 0x52, 0x10, 0x73, 0x65, 0x71, 0x75, 0x65, 0x6e, 0x63, 0x65, 0x72, + 0x41, 0x64, 0x64, 0x72, 0x65, 0x73, 0x73, 0x12, 0x39, 0x0a, 0x15, 0x73, 0x74, 0x61, 0x74, 0x65, + 0x5f, 0x64, 0x69, 0x66, 0x66, 0x5f, 0x63, 0x6f, 0x6d, 0x6d, 0x69, 0x74, 0x6d, 0x65, 0x6e, 0x74, + 0x18, 0x06, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x05, 0x2e, 0x48, 0x61, 0x73, 0x68, 0x52, 0x13, 0x73, + 0x74, 0x61, 0x74, 0x65, 0x44, 0x69, 0x66, 0x66, 0x43, 0x6f, 0x6d, 0x6d, 0x69, 0x74, 0x6d, 0x65, + 0x6e, 0x74, 0x12, 0x1f, 0x0a, 0x05, 0x73, 0x74, 0x61, 0x74, 0x65, 0x18, 0x07, 0x20, 0x01, 0x28, + 0x0b, 0x32, 0x09, 0x2e, 0x50, 0x61, 0x74, 0x72, 0x69, 0x63, 0x69, 0x61, 0x52, 0x05, 0x73, 0x74, + 0x61, 0x74, 0x65, 0x12, 0x2b, 0x0a, 0x0c, 0x74, 0x72, 0x61, 0x6e, 0x73, 0x61, 0x63, 0x74, 0x69, + 0x6f, 0x6e, 0x73, 0x18, 0x08, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x07, 0x2e, 0x4d, 0x65, 0x72, 0x6b, + 0x6c, 0x65, 0x52, 0x0c, 0x74, 0x72, 0x61, 0x6e, 0x73, 0x61, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x73, + 0x12, 0x1f, 0x0a, 0x06, 0x65, 0x76, 0x65, 0x6e, 0x74, 0x73, 0x18, 0x09, 0x20, 0x01, 0x28, 0x0b, + 0x32, 0x07, 0x2e, 0x4d, 0x65, 0x72, 0x6b, 0x6c, 0x65, 0x52, 0x06, 0x65, 0x76, 0x65, 0x6e, 0x74, + 0x73, 0x12, 0x23, 0x0a, 0x08, 0x72, 0x65, 0x63, 0x65, 0x69, 0x70, 0x74, 0x73, 0x18, 0x0a, 0x20, + 0x01, 0x28, 0x0b, 0x32, 0x07, 0x2e, 0x4d, 0x65, 0x72, 0x6b, 0x6c, 0x65, 0x52, 0x08, 0x72, 0x65, + 0x63, 0x65, 0x69, 0x70, 0x74, 0x73, 0x12, 0x29, 0x0a, 0x10, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x63, + 0x6f, 0x6c, 0x5f, 0x76, 0x65, 0x72, 0x73, 0x69, 0x6f, 0x6e, 0x18, 0x0b, 0x20, 0x01, 0x28, 0x09, + 0x52, 0x0f, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x63, 0x6f, 0x6c, 0x56, 0x65, 0x72, 0x73, 0x69, 0x6f, + 0x6e, 0x12, 0x25, 0x0a, 0x09, 0x67, 0x61, 0x73, 0x5f, 0x70, 0x72, 0x69, 0x63, 0x65, 0x18, 0x0c, + 0x20, 0x01, 0x28, 0x0b, 0x32, 0x08, 0x2e, 0x46, 0x65, 0x6c, 0x74, 0x32, 0x35, 0x32, 0x52, 0x08, + 0x67, 0x61, 0x73, 0x50, 0x72, 0x69, 0x63, 0x65, 0x12, 0x2a, 0x0a, 0x11, 0x6e, 0x75, 0x6d, 0x5f, + 0x73, 0x74, 0x6f, 0x72, 0x61, 0x67, 0x65, 0x5f, 0x64, 0x69, 0x66, 0x66, 0x73, 0x18, 0x0d, 0x20, + 0x01, 0x28, 0x04, 0x52, 0x0f, 0x6e, 0x75, 0x6d, 0x53, 0x74, 0x6f, 0x72, 0x61, 0x67, 0x65, 0x44, + 0x69, 0x66, 0x66, 0x73, 0x12, 0x2a, 0x0a, 0x11, 0x6e, 0x75, 0x6d, 0x5f, 0x6e, 0x6f, 0x6e, 0x63, + 0x65, 0x5f, 0x75, 0x70, 0x64, 0x61, 0x74, 0x65, 0x73, 0x18, 0x0e, 0x20, 0x01, 0x28, 0x04, 0x52, + 0x0f, 0x6e, 0x75, 0x6d, 0x4e, 0x6f, 0x6e, 0x63, 0x65, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x73, + 0x12, 0x30, 0x0a, 0x14, 0x6e, 0x75, 0x6d, 0x5f, 0x64, 0x65, 0x63, 0x6c, 0x61, 0x72, 0x65, 0x64, + 0x5f, 0x63, 0x6c, 0x61, 0x73, 0x73, 0x65, 0x73, 0x18, 0x0f, 0x20, 0x01, 0x28, 0x04, 0x52, 0x12, + 0x6e, 0x75, 0x6d, 0x44, 0x65, 0x63, 0x6c, 0x61, 0x72, 0x65, 0x64, 0x43, 0x6c, 0x61, 0x73, 0x73, + 0x65, 0x73, 0x12, 0x34, 0x0a, 0x16, 0x6e, 0x75, 0x6d, 0x5f, 0x64, 0x65, 0x70, 0x6c, 0x6f, 0x79, + 0x65, 0x64, 0x5f, 0x63, 0x6f, 0x6e, 0x74, 0x72, 0x61, 0x63, 0x74, 0x73, 0x18, 0x10, 0x20, 0x01, + 0x28, 0x04, 0x52, 0x14, 0x6e, 0x75, 0x6d, 0x44, 0x65, 0x70, 0x6c, 0x6f, 0x79, 0x65, 0x64, 0x43, + 0x6f, 0x6e, 0x74, 0x72, 0x61, 0x63, 0x74, 0x73, 0x12, 0x33, 0x0a, 0x0a, 0x73, 0x69, 0x67, 0x6e, + 0x61, 0x74, 0x75, 0x72, 0x65, 0x73, 0x18, 0x11, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x13, 0x2e, 0x43, + 0x6f, 0x6e, 0x73, 0x65, 0x6e, 0x73, 0x75, 0x73, 0x53, 0x69, 0x67, 0x6e, 0x61, 0x74, 0x75, 0x72, + 0x65, 0x52, 0x0a, 0x73, 0x69, 0x67, 0x6e, 0x61, 0x74, 0x75, 0x72, 0x65, 0x73, 0x22, 0x65, 0x0a, + 0x08, 0x4e, 0x65, 0x77, 0x42, 0x6c, 0x6f, 0x63, 0x6b, 0x12, 0x1a, 0x0a, 0x02, 0x69, 0x64, 0x18, + 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x08, 0x2e, 0x42, 0x6c, 0x6f, 0x63, 0x6b, 0x49, 0x44, 0x48, + 0x00, 0x52, 0x02, 0x69, 0x64, 0x12, 0x2f, 0x0a, 0x06, 0x68, 0x65, 0x61, 0x64, 0x65, 0x72, 0x18, + 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x15, 0x2e, 0x42, 0x6c, 0x6f, 0x63, 0x6b, 0x48, 0x65, 0x61, + 0x64, 0x65, 0x72, 0x73, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x48, 0x00, 0x52, 0x06, + 0x68, 0x65, 0x61, 0x64, 0x65, 0x72, 0x42, 0x0c, 0x0a, 0x0a, 0x6d, 0x61, 0x79, 0x62, 0x65, 0x5f, + 0x66, 0x75, 0x6c, 0x6c, 0x22, 0x3f, 0x0a, 0x13, 0x42, 0x6c, 0x6f, 0x63, 0x6b, 0x48, 0x65, 0x61, + 0x64, 0x65, 0x72, 0x73, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x28, 0x0a, 0x09, 0x69, + 0x74, 0x65, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x0a, + 0x2e, 0x49, 0x74, 0x65, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x52, 0x09, 0x69, 0x74, 0x65, 0x72, + 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x22, 0x70, 0x0a, 0x14, 0x42, 0x6c, 0x6f, 0x63, 0x6b, 0x48, 0x65, + 0x61, 0x64, 0x65, 0x72, 0x73, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x2c, 0x0a, + 0x06, 0x68, 0x65, 0x61, 0x64, 0x65, 0x72, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x12, 0x2e, + 0x53, 0x69, 0x67, 0x6e, 0x65, 0x64, 0x42, 0x6c, 0x6f, 0x63, 0x6b, 0x48, 0x65, 0x61, 0x64, 0x65, + 0x72, 0x48, 0x00, 0x52, 0x06, 0x68, 0x65, 0x61, 0x64, 0x65, 0x72, 0x12, 0x18, 0x0a, 0x03, 0x66, + 0x69, 0x6e, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x04, 0x2e, 0x46, 0x69, 0x6e, 0x48, 0x00, + 0x52, 0x03, 0x66, 0x69, 0x6e, 0x42, 0x10, 0x0a, 0x0e, 0x68, 0x65, 0x61, 0x64, 0x65, 0x72, 0x5f, + 0x6d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x42, 0x31, 0x5a, 0x2f, 0x67, 0x69, 0x74, 0x68, 0x75, + 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x4e, 0x65, 0x74, 0x68, 0x65, 0x72, 0x6d, 0x69, 0x6e, 0x64, + 0x45, 0x74, 0x68, 0x2f, 0x6a, 0x75, 0x6e, 0x6f, 0x2f, 0x70, 0x32, 0x70, 0x2f, 0x73, 0x74, 0x61, + 0x72, 0x6b, 0x6e, 0x65, 0x74, 0x2f, 0x73, 0x70, 0x65, 0x63, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, + 0x6f, 0x33, +} + +var ( + file_p2p_proto_header_proto_rawDescOnce sync.Once + file_p2p_proto_header_proto_rawDescData = file_p2p_proto_header_proto_rawDesc +) + +func file_p2p_proto_header_proto_rawDescGZIP() []byte { + file_p2p_proto_header_proto_rawDescOnce.Do(func() { + file_p2p_proto_header_proto_rawDescData = protoimpl.X.CompressGZIP(file_p2p_proto_header_proto_rawDescData) + }) + return file_p2p_proto_header_proto_rawDescData +} + +var ( + file_p2p_proto_header_proto_msgTypes = make([]protoimpl.MessageInfo, 4) + file_p2p_proto_header_proto_goTypes = []interface{}{ + (*SignedBlockHeader)(nil), // 0: SignedBlockHeader + (*NewBlock)(nil), // 1: NewBlock + (*BlockHeadersRequest)(nil), // 2: BlockHeadersRequest + (*BlockHeadersResponse)(nil), // 3: BlockHeadersResponse + (*Hash)(nil), // 4: Hash + (*Address)(nil), // 5: Address + (*Patricia)(nil), // 6: Patricia + (*Merkle)(nil), // 7: Merkle + (*Felt252)(nil), // 8: Felt252 + (*ConsensusSignature)(nil), // 9: ConsensusSignature + (*BlockID)(nil), // 10: BlockID + (*Iteration)(nil), // 11: Iteration + (*Fin)(nil), // 12: Fin + } +) +var file_p2p_proto_header_proto_depIdxs = []int32{ + 4, // 0: SignedBlockHeader.block_hash:type_name -> Hash + 4, // 1: SignedBlockHeader.parent_hash:type_name -> Hash + 5, // 2: SignedBlockHeader.sequencer_address:type_name -> Address + 4, // 3: SignedBlockHeader.state_diff_commitment:type_name -> Hash + 6, // 4: SignedBlockHeader.state:type_name -> Patricia + 7, // 5: SignedBlockHeader.transactions:type_name -> Merkle + 7, // 6: SignedBlockHeader.events:type_name -> Merkle + 7, // 7: SignedBlockHeader.receipts:type_name -> Merkle + 8, // 8: SignedBlockHeader.gas_price:type_name -> Felt252 + 9, // 9: SignedBlockHeader.signatures:type_name -> ConsensusSignature + 10, // 10: NewBlock.id:type_name -> BlockID + 3, // 11: NewBlock.header:type_name -> BlockHeadersResponse + 11, // 12: BlockHeadersRequest.iteration:type_name -> Iteration + 0, // 13: BlockHeadersResponse.header:type_name -> SignedBlockHeader + 12, // 14: BlockHeadersResponse.fin:type_name -> Fin + 15, // [15:15] is the sub-list for method output_type + 15, // [15:15] is the sub-list for method input_type + 15, // [15:15] is the sub-list for extension type_name + 15, // [15:15] is the sub-list for extension extendee + 0, // [0:15] is the sub-list for field type_name +} + +func init() { file_p2p_proto_header_proto_init() } +func file_p2p_proto_header_proto_init() { + if File_p2p_proto_header_proto != nil { + return + } + file_p2p_proto_common_proto_init() + if !protoimpl.UnsafeEnabled { + file_p2p_proto_header_proto_msgTypes[0].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*SignedBlockHeader); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_p2p_proto_header_proto_msgTypes[1].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*NewBlock); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_p2p_proto_header_proto_msgTypes[2].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*BlockHeadersRequest); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_p2p_proto_header_proto_msgTypes[3].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*BlockHeadersResponse); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + } + file_p2p_proto_header_proto_msgTypes[1].OneofWrappers = []interface{}{ + (*NewBlock_Id)(nil), + (*NewBlock_Header)(nil), + } + file_p2p_proto_header_proto_msgTypes[3].OneofWrappers = []interface{}{ + (*BlockHeadersResponse_Header)(nil), + (*BlockHeadersResponse_Fin)(nil), + } + type x struct{} + out := protoimpl.TypeBuilder{ + File: protoimpl.DescBuilder{ + GoPackagePath: reflect.TypeOf(x{}).PkgPath(), + RawDescriptor: file_p2p_proto_header_proto_rawDesc, + NumEnums: 0, + NumMessages: 4, + NumExtensions: 0, + NumServices: 0, + }, + GoTypes: file_p2p_proto_header_proto_goTypes, + DependencyIndexes: file_p2p_proto_header_proto_depIdxs, + MessageInfos: file_p2p_proto_header_proto_msgTypes, + }.Build() + File_p2p_proto_header_proto = out.File + file_p2p_proto_header_proto_rawDesc = nil + file_p2p_proto_header_proto_goTypes = nil + file_p2p_proto_header_proto_depIdxs = nil +} diff --git a/p2p/starknet/spec/receipt.pb.go b/p2p/starknet/spec/receipt.pb.go index d760772b2b..45836b8d77 100644 --- a/p2p/starknet/spec/receipt.pb.go +++ b/p2p/starknet/spec/receipt.pb.go @@ -1,7 +1,7 @@ // Code generated by protoc-gen-go. DO NOT EDIT. // versions: -// protoc-gen-go v1.31.0 -// protoc v4.24.4 +// protoc-gen-go v1.26.0 +// protoc v4.25.1 // source: p2p/proto/receipt.proto package spec @@ -131,85 +131,6 @@ func (x *EthereumAddress) GetElements() []byte { return nil } -type MessageToL2 struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - FromAddress *EthereumAddress `protobuf:"bytes,1,opt,name=from_address,json=fromAddress,proto3" json:"from_address,omitempty"` - Payload []*Felt252 `protobuf:"bytes,2,rep,name=payload,proto3" json:"payload,omitempty"` - ToAddress *Felt252 `protobuf:"bytes,3,opt,name=to_address,json=toAddress,proto3" json:"to_address,omitempty"` - EntryPointSelector *Felt252 `protobuf:"bytes,4,opt,name=entry_point_selector,json=entryPointSelector,proto3" json:"entry_point_selector,omitempty"` - Nonce *Felt252 `protobuf:"bytes,5,opt,name=nonce,proto3" json:"nonce,omitempty"` -} - -func (x *MessageToL2) Reset() { - *x = MessageToL2{} - if protoimpl.UnsafeEnabled { - mi := &file_p2p_proto_receipt_proto_msgTypes[2] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *MessageToL2) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*MessageToL2) ProtoMessage() {} - -func (x *MessageToL2) ProtoReflect() protoreflect.Message { - mi := &file_p2p_proto_receipt_proto_msgTypes[2] - if protoimpl.UnsafeEnabled && x != nil { - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - if ms.LoadMessageInfo() == nil { - ms.StoreMessageInfo(mi) - } - return ms - } - return mi.MessageOf(x) -} - -// Deprecated: Use MessageToL2.ProtoReflect.Descriptor instead. -func (*MessageToL2) Descriptor() ([]byte, []int) { - return file_p2p_proto_receipt_proto_rawDescGZIP(), []int{2} -} - -func (x *MessageToL2) GetFromAddress() *EthereumAddress { - if x != nil { - return x.FromAddress - } - return nil -} - -func (x *MessageToL2) GetPayload() []*Felt252 { - if x != nil { - return x.Payload - } - return nil -} - -func (x *MessageToL2) GetToAddress() *Felt252 { - if x != nil { - return x.ToAddress - } - return nil -} - -func (x *MessageToL2) GetEntryPointSelector() *Felt252 { - if x != nil { - return x.EntryPointSelector - } - return nil -} - -func (x *MessageToL2) GetNonce() *Felt252 { - if x != nil { - return x.Nonce - } - return nil -} - type Receipt struct { state protoimpl.MessageState sizeCache protoimpl.SizeCache @@ -228,7 +149,7 @@ type Receipt struct { func (x *Receipt) Reset() { *x = Receipt{} if protoimpl.UnsafeEnabled { - mi := &file_p2p_proto_receipt_proto_msgTypes[3] + mi := &file_p2p_proto_receipt_proto_msgTypes[2] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -241,7 +162,7 @@ func (x *Receipt) String() string { func (*Receipt) ProtoMessage() {} func (x *Receipt) ProtoReflect() protoreflect.Message { - mi := &file_p2p_proto_receipt_proto_msgTypes[3] + mi := &file_p2p_proto_receipt_proto_msgTypes[2] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -254,7 +175,7 @@ func (x *Receipt) ProtoReflect() protoreflect.Message { // Deprecated: Use Receipt.ProtoReflect.Descriptor instead. func (*Receipt) Descriptor() ([]byte, []int) { - return file_p2p_proto_receipt_proto_rawDescGZIP(), []int{3} + return file_p2p_proto_receipt_proto_rawDescGZIP(), []int{2} } func (m *Receipt) GetType() isReceipt_Type { @@ -344,7 +265,7 @@ type ReceiptsRequest struct { func (x *ReceiptsRequest) Reset() { *x = ReceiptsRequest{} if protoimpl.UnsafeEnabled { - mi := &file_p2p_proto_receipt_proto_msgTypes[4] + mi := &file_p2p_proto_receipt_proto_msgTypes[3] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -357,7 +278,7 @@ func (x *ReceiptsRequest) String() string { func (*ReceiptsRequest) ProtoMessage() {} func (x *ReceiptsRequest) ProtoReflect() protoreflect.Message { - mi := &file_p2p_proto_receipt_proto_msgTypes[4] + mi := &file_p2p_proto_receipt_proto_msgTypes[3] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -370,7 +291,7 @@ func (x *ReceiptsRequest) ProtoReflect() protoreflect.Message { // Deprecated: Use ReceiptsRequest.ProtoReflect.Descriptor instead. func (*ReceiptsRequest) Descriptor() ([]byte, []int) { - return file_p2p_proto_receipt_proto_rawDescGZIP(), []int{4} + return file_p2p_proto_receipt_proto_rawDescGZIP(), []int{3} } func (x *ReceiptsRequest) GetIteration() *Iteration { @@ -391,7 +312,7 @@ type Receipts struct { func (x *Receipts) Reset() { *x = Receipts{} if protoimpl.UnsafeEnabled { - mi := &file_p2p_proto_receipt_proto_msgTypes[5] + mi := &file_p2p_proto_receipt_proto_msgTypes[4] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -404,7 +325,7 @@ func (x *Receipts) String() string { func (*Receipts) ProtoMessage() {} func (x *Receipts) ProtoReflect() protoreflect.Message { - mi := &file_p2p_proto_receipt_proto_msgTypes[5] + mi := &file_p2p_proto_receipt_proto_msgTypes[4] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -417,7 +338,7 @@ func (x *Receipts) ProtoReflect() protoreflect.Message { // Deprecated: Use Receipts.ProtoReflect.Descriptor instead. func (*Receipts) Descriptor() ([]byte, []int) { - return file_p2p_proto_receipt_proto_rawDescGZIP(), []int{5} + return file_p2p_proto_receipt_proto_rawDescGZIP(), []int{4} } func (x *Receipts) GetItems() []*Receipt { @@ -427,23 +348,23 @@ func (x *Receipts) GetItems() []*Receipt { return nil } +// Responses are sent ordered by the order given in the request. type ReceiptsResponse struct { state protoimpl.MessageState sizeCache protoimpl.SizeCache unknownFields protoimpl.UnknownFields - Id *BlockID `protobuf:"bytes,1,opt,name=id,proto3,oneof" json:"id,omitempty"` // may not appear if Fin is sent to end the whole response - // Types that are assignable to Responses: + // Types that are assignable to ReceiptMessage: // - // *ReceiptsResponse_Receipts + // *ReceiptsResponse_Receipt // *ReceiptsResponse_Fin - Responses isReceiptsResponse_Responses `protobuf_oneof:"responses"` + ReceiptMessage isReceiptsResponse_ReceiptMessage `protobuf_oneof:"receipt_message"` } func (x *ReceiptsResponse) Reset() { *x = ReceiptsResponse{} if protoimpl.UnsafeEnabled { - mi := &file_p2p_proto_receipt_proto_msgTypes[6] + mi := &file_p2p_proto_receipt_proto_msgTypes[5] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -456,7 +377,7 @@ func (x *ReceiptsResponse) String() string { func (*ReceiptsResponse) ProtoMessage() {} func (x *ReceiptsResponse) ProtoReflect() protoreflect.Message { - mi := &file_p2p_proto_receipt_proto_msgTypes[6] + mi := &file_p2p_proto_receipt_proto_msgTypes[5] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -469,52 +390,45 @@ func (x *ReceiptsResponse) ProtoReflect() protoreflect.Message { // Deprecated: Use ReceiptsResponse.ProtoReflect.Descriptor instead. func (*ReceiptsResponse) Descriptor() ([]byte, []int) { - return file_p2p_proto_receipt_proto_rawDescGZIP(), []int{6} -} - -func (x *ReceiptsResponse) GetId() *BlockID { - if x != nil { - return x.Id - } - return nil + return file_p2p_proto_receipt_proto_rawDescGZIP(), []int{5} } -func (m *ReceiptsResponse) GetResponses() isReceiptsResponse_Responses { +func (m *ReceiptsResponse) GetReceiptMessage() isReceiptsResponse_ReceiptMessage { if m != nil { - return m.Responses + return m.ReceiptMessage } return nil } -func (x *ReceiptsResponse) GetReceipts() *Receipts { - if x, ok := x.GetResponses().(*ReceiptsResponse_Receipts); ok { - return x.Receipts +func (x *ReceiptsResponse) GetReceipt() *Receipt { + if x, ok := x.GetReceiptMessage().(*ReceiptsResponse_Receipt); ok { + return x.Receipt } return nil } func (x *ReceiptsResponse) GetFin() *Fin { - if x, ok := x.GetResponses().(*ReceiptsResponse_Fin); ok { + if x, ok := x.GetReceiptMessage().(*ReceiptsResponse_Fin); ok { return x.Fin } return nil } -type isReceiptsResponse_Responses interface { - isReceiptsResponse_Responses() +type isReceiptsResponse_ReceiptMessage interface { + isReceiptsResponse_ReceiptMessage() } -type ReceiptsResponse_Receipts struct { - Receipts *Receipts `protobuf:"bytes,2,opt,name=receipts,proto3,oneof"` +type ReceiptsResponse_Receipt struct { + Receipt *Receipt `protobuf:"bytes,1,opt,name=receipt,proto3,oneof"` } type ReceiptsResponse_Fin struct { - Fin *Fin `protobuf:"bytes,3,opt,name=fin,proto3,oneof"` + Fin *Fin `protobuf:"bytes,2,opt,name=fin,proto3,oneof"` // Fin is sent after the peer sent all the data or when it encountered a block that it doesn't have its receipts. } -func (*ReceiptsResponse_Receipts) isReceiptsResponse_Responses() {} +func (*ReceiptsResponse_Receipt) isReceiptsResponse_ReceiptMessage() {} -func (*ReceiptsResponse_Fin) isReceiptsResponse_Responses() {} +func (*ReceiptsResponse_Fin) isReceiptsResponse_ReceiptMessage() {} type Receipt_ExecutionResources struct { state protoimpl.MessageState @@ -529,7 +443,7 @@ type Receipt_ExecutionResources struct { func (x *Receipt_ExecutionResources) Reset() { *x = Receipt_ExecutionResources{} if protoimpl.UnsafeEnabled { - mi := &file_p2p_proto_receipt_proto_msgTypes[7] + mi := &file_p2p_proto_receipt_proto_msgTypes[6] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -542,7 +456,7 @@ func (x *Receipt_ExecutionResources) String() string { func (*Receipt_ExecutionResources) ProtoMessage() {} func (x *Receipt_ExecutionResources) ProtoReflect() protoreflect.Message { - mi := &file_p2p_proto_receipt_proto_msgTypes[7] + mi := &file_p2p_proto_receipt_proto_msgTypes[6] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -555,7 +469,7 @@ func (x *Receipt_ExecutionResources) ProtoReflect() protoreflect.Message { // Deprecated: Use Receipt_ExecutionResources.ProtoReflect.Descriptor instead. func (*Receipt_ExecutionResources) Descriptor() ([]byte, []int) { - return file_p2p_proto_receipt_proto_rawDescGZIP(), []int{3, 0} + return file_p2p_proto_receipt_proto_rawDescGZIP(), []int{2, 0} } func (x *Receipt_ExecutionResources) GetBuiltins() *Receipt_ExecutionResources_BuiltinCounter { @@ -584,18 +498,17 @@ type Receipt_Common struct { sizeCache protoimpl.SizeCache unknownFields protoimpl.UnknownFields - TransactionHash *Hash `protobuf:"bytes,1,opt,name=transaction_hash,json=transactionHash,proto3" json:"transaction_hash,omitempty"` - ActualFee *Felt252 `protobuf:"bytes,2,opt,name=actual_fee,json=actualFee,proto3" json:"actual_fee,omitempty"` - MessagesSent []*MessageToL1 `protobuf:"bytes,3,rep,name=messages_sent,json=messagesSent,proto3" json:"messages_sent,omitempty"` + TransactionHash *Hash `protobuf:"bytes,1,opt,name=transaction_hash,json=transactionHash,proto3" json:"transaction_hash,omitempty"` + ActualFee *Felt252 `protobuf:"bytes,2,opt,name=actual_fee,json=actualFee,proto3" json:"actual_fee,omitempty"` + MessagesSent []*MessageToL1 `protobuf:"bytes,3,rep,name=messages_sent,json=messagesSent,proto3" json:"messages_sent,omitempty"` ExecutionResources *Receipt_ExecutionResources `protobuf:"bytes,4,opt,name=execution_resources,json=executionResources,proto3" json:"execution_resources,omitempty"` RevertReason string `protobuf:"bytes,5,opt,name=revert_reason,json=revertReason,proto3" json:"revert_reason,omitempty"` - ConsumedMessage *MessageToL2 `protobuf:"bytes,6,opt,name=consumed_message,json=consumedMessage,proto3,oneof" json:"consumed_message,omitempty"` } func (x *Receipt_Common) Reset() { *x = Receipt_Common{} if protoimpl.UnsafeEnabled { - mi := &file_p2p_proto_receipt_proto_msgTypes[8] + mi := &file_p2p_proto_receipt_proto_msgTypes[7] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -608,7 +521,7 @@ func (x *Receipt_Common) String() string { func (*Receipt_Common) ProtoMessage() {} func (x *Receipt_Common) ProtoReflect() protoreflect.Message { - mi := &file_p2p_proto_receipt_proto_msgTypes[8] + mi := &file_p2p_proto_receipt_proto_msgTypes[7] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -621,7 +534,7 @@ func (x *Receipt_Common) ProtoReflect() protoreflect.Message { // Deprecated: Use Receipt_Common.ProtoReflect.Descriptor instead. func (*Receipt_Common) Descriptor() ([]byte, []int) { - return file_p2p_proto_receipt_proto_rawDescGZIP(), []int{3, 1} + return file_p2p_proto_receipt_proto_rawDescGZIP(), []int{2, 1} } func (x *Receipt_Common) GetTransactionHash() *Hash { @@ -659,13 +572,6 @@ func (x *Receipt_Common) GetRevertReason() string { return "" } -func (x *Receipt_Common) GetConsumedMessage() *MessageToL2 { - if x != nil { - return x.ConsumedMessage - } - return nil -} - type Receipt_Invoke struct { state protoimpl.MessageState sizeCache protoimpl.SizeCache @@ -677,7 +583,7 @@ type Receipt_Invoke struct { func (x *Receipt_Invoke) Reset() { *x = Receipt_Invoke{} if protoimpl.UnsafeEnabled { - mi := &file_p2p_proto_receipt_proto_msgTypes[9] + mi := &file_p2p_proto_receipt_proto_msgTypes[8] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -690,7 +596,7 @@ func (x *Receipt_Invoke) String() string { func (*Receipt_Invoke) ProtoMessage() {} func (x *Receipt_Invoke) ProtoReflect() protoreflect.Message { - mi := &file_p2p_proto_receipt_proto_msgTypes[9] + mi := &file_p2p_proto_receipt_proto_msgTypes[8] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -703,7 +609,7 @@ func (x *Receipt_Invoke) ProtoReflect() protoreflect.Message { // Deprecated: Use Receipt_Invoke.ProtoReflect.Descriptor instead. func (*Receipt_Invoke) Descriptor() ([]byte, []int) { - return file_p2p_proto_receipt_proto_rawDescGZIP(), []int{3, 2} + return file_p2p_proto_receipt_proto_rawDescGZIP(), []int{2, 2} } func (x *Receipt_Invoke) GetCommon() *Receipt_Common { @@ -725,7 +631,7 @@ type Receipt_L1Handler struct { func (x *Receipt_L1Handler) Reset() { *x = Receipt_L1Handler{} if protoimpl.UnsafeEnabled { - mi := &file_p2p_proto_receipt_proto_msgTypes[10] + mi := &file_p2p_proto_receipt_proto_msgTypes[9] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -738,7 +644,7 @@ func (x *Receipt_L1Handler) String() string { func (*Receipt_L1Handler) ProtoMessage() {} func (x *Receipt_L1Handler) ProtoReflect() protoreflect.Message { - mi := &file_p2p_proto_receipt_proto_msgTypes[10] + mi := &file_p2p_proto_receipt_proto_msgTypes[9] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -751,7 +657,7 @@ func (x *Receipt_L1Handler) ProtoReflect() protoreflect.Message { // Deprecated: Use Receipt_L1Handler.ProtoReflect.Descriptor instead. func (*Receipt_L1Handler) Descriptor() ([]byte, []int) { - return file_p2p_proto_receipt_proto_rawDescGZIP(), []int{3, 3} + return file_p2p_proto_receipt_proto_rawDescGZIP(), []int{2, 3} } func (x *Receipt_L1Handler) GetCommon() *Receipt_Common { @@ -779,7 +685,7 @@ type Receipt_Declare struct { func (x *Receipt_Declare) Reset() { *x = Receipt_Declare{} if protoimpl.UnsafeEnabled { - mi := &file_p2p_proto_receipt_proto_msgTypes[11] + mi := &file_p2p_proto_receipt_proto_msgTypes[10] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -792,7 +698,7 @@ func (x *Receipt_Declare) String() string { func (*Receipt_Declare) ProtoMessage() {} func (x *Receipt_Declare) ProtoReflect() protoreflect.Message { - mi := &file_p2p_proto_receipt_proto_msgTypes[11] + mi := &file_p2p_proto_receipt_proto_msgTypes[10] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -805,7 +711,7 @@ func (x *Receipt_Declare) ProtoReflect() protoreflect.Message { // Deprecated: Use Receipt_Declare.ProtoReflect.Descriptor instead. func (*Receipt_Declare) Descriptor() ([]byte, []int) { - return file_p2p_proto_receipt_proto_rawDescGZIP(), []int{3, 4} + return file_p2p_proto_receipt_proto_rawDescGZIP(), []int{2, 4} } func (x *Receipt_Declare) GetCommon() *Receipt_Common { @@ -827,7 +733,7 @@ type Receipt_Deploy struct { func (x *Receipt_Deploy) Reset() { *x = Receipt_Deploy{} if protoimpl.UnsafeEnabled { - mi := &file_p2p_proto_receipt_proto_msgTypes[12] + mi := &file_p2p_proto_receipt_proto_msgTypes[11] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -840,7 +746,7 @@ func (x *Receipt_Deploy) String() string { func (*Receipt_Deploy) ProtoMessage() {} func (x *Receipt_Deploy) ProtoReflect() protoreflect.Message { - mi := &file_p2p_proto_receipt_proto_msgTypes[12] + mi := &file_p2p_proto_receipt_proto_msgTypes[11] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -853,7 +759,7 @@ func (x *Receipt_Deploy) ProtoReflect() protoreflect.Message { // Deprecated: Use Receipt_Deploy.ProtoReflect.Descriptor instead. func (*Receipt_Deploy) Descriptor() ([]byte, []int) { - return file_p2p_proto_receipt_proto_rawDescGZIP(), []int{3, 5} + return file_p2p_proto_receipt_proto_rawDescGZIP(), []int{2, 5} } func (x *Receipt_Deploy) GetCommon() *Receipt_Common { @@ -882,7 +788,7 @@ type Receipt_DeployAccount struct { func (x *Receipt_DeployAccount) Reset() { *x = Receipt_DeployAccount{} if protoimpl.UnsafeEnabled { - mi := &file_p2p_proto_receipt_proto_msgTypes[13] + mi := &file_p2p_proto_receipt_proto_msgTypes[12] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -895,7 +801,7 @@ func (x *Receipt_DeployAccount) String() string { func (*Receipt_DeployAccount) ProtoMessage() {} func (x *Receipt_DeployAccount) ProtoReflect() protoreflect.Message { - mi := &file_p2p_proto_receipt_proto_msgTypes[13] + mi := &file_p2p_proto_receipt_proto_msgTypes[12] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -908,7 +814,7 @@ func (x *Receipt_DeployAccount) ProtoReflect() protoreflect.Message { // Deprecated: Use Receipt_DeployAccount.ProtoReflect.Descriptor instead. func (*Receipt_DeployAccount) Descriptor() ([]byte, []int) { - return file_p2p_proto_receipt_proto_rawDescGZIP(), []int{3, 6} + return file_p2p_proto_receipt_proto_rawDescGZIP(), []int{2, 6} } func (x *Receipt_DeployAccount) GetCommon() *Receipt_Common { @@ -943,7 +849,7 @@ type Receipt_ExecutionResources_BuiltinCounter struct { func (x *Receipt_ExecutionResources_BuiltinCounter) Reset() { *x = Receipt_ExecutionResources_BuiltinCounter{} if protoimpl.UnsafeEnabled { - mi := &file_p2p_proto_receipt_proto_msgTypes[14] + mi := &file_p2p_proto_receipt_proto_msgTypes[13] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -956,7 +862,7 @@ func (x *Receipt_ExecutionResources_BuiltinCounter) String() string { func (*Receipt_ExecutionResources_BuiltinCounter) ProtoMessage() {} func (x *Receipt_ExecutionResources_BuiltinCounter) ProtoReflect() protoreflect.Message { - mi := &file_p2p_proto_receipt_proto_msgTypes[14] + mi := &file_p2p_proto_receipt_proto_msgTypes[13] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -969,7 +875,7 @@ func (x *Receipt_ExecutionResources_BuiltinCounter) ProtoReflect() protoreflect. // Deprecated: Use Receipt_ExecutionResources_BuiltinCounter.ProtoReflect.Descriptor instead. func (*Receipt_ExecutionResources_BuiltinCounter) Descriptor() ([]byte, []int) { - return file_p2p_proto_receipt_proto_rawDescGZIP(), []int{3, 0, 0} + return file_p2p_proto_receipt_proto_rawDescGZIP(), []int{2, 0, 0} } func (x *Receipt_ExecutionResources_BuiltinCounter) GetBitwise() uint32 { @@ -1046,126 +952,107 @@ var file_p2p_proto_receipt_proto_rawDesc = []byte{ 0x65, 0x73, 0x73, 0x22, 0x2d, 0x0a, 0x0f, 0x45, 0x74, 0x68, 0x65, 0x72, 0x65, 0x75, 0x6d, 0x41, 0x64, 0x64, 0x72, 0x65, 0x73, 0x73, 0x12, 0x1a, 0x0a, 0x08, 0x65, 0x6c, 0x65, 0x6d, 0x65, 0x6e, 0x74, 0x73, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0c, 0x52, 0x08, 0x65, 0x6c, 0x65, 0x6d, 0x65, 0x6e, - 0x74, 0x73, 0x22, 0xeb, 0x01, 0x0a, 0x0b, 0x4d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x54, 0x6f, - 0x4c, 0x32, 0x12, 0x33, 0x0a, 0x0c, 0x66, 0x72, 0x6f, 0x6d, 0x5f, 0x61, 0x64, 0x64, 0x72, 0x65, - 0x73, 0x73, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x10, 0x2e, 0x45, 0x74, 0x68, 0x65, 0x72, - 0x65, 0x75, 0x6d, 0x41, 0x64, 0x64, 0x72, 0x65, 0x73, 0x73, 0x52, 0x0b, 0x66, 0x72, 0x6f, 0x6d, - 0x41, 0x64, 0x64, 0x72, 0x65, 0x73, 0x73, 0x12, 0x22, 0x0a, 0x07, 0x70, 0x61, 0x79, 0x6c, 0x6f, - 0x61, 0x64, 0x18, 0x02, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x08, 0x2e, 0x46, 0x65, 0x6c, 0x74, 0x32, - 0x35, 0x32, 0x52, 0x07, 0x70, 0x61, 0x79, 0x6c, 0x6f, 0x61, 0x64, 0x12, 0x27, 0x0a, 0x0a, 0x74, - 0x6f, 0x5f, 0x61, 0x64, 0x64, 0x72, 0x65, 0x73, 0x73, 0x18, 0x03, 0x20, 0x01, 0x28, 0x0b, 0x32, - 0x08, 0x2e, 0x46, 0x65, 0x6c, 0x74, 0x32, 0x35, 0x32, 0x52, 0x09, 0x74, 0x6f, 0x41, 0x64, 0x64, - 0x72, 0x65, 0x73, 0x73, 0x12, 0x3a, 0x0a, 0x14, 0x65, 0x6e, 0x74, 0x72, 0x79, 0x5f, 0x70, 0x6f, - 0x69, 0x6e, 0x74, 0x5f, 0x73, 0x65, 0x6c, 0x65, 0x63, 0x74, 0x6f, 0x72, 0x18, 0x04, 0x20, 0x01, - 0x28, 0x0b, 0x32, 0x08, 0x2e, 0x46, 0x65, 0x6c, 0x74, 0x32, 0x35, 0x32, 0x52, 0x12, 0x65, 0x6e, - 0x74, 0x72, 0x79, 0x50, 0x6f, 0x69, 0x6e, 0x74, 0x53, 0x65, 0x6c, 0x65, 0x63, 0x74, 0x6f, 0x72, - 0x12, 0x1e, 0x0a, 0x05, 0x6e, 0x6f, 0x6e, 0x63, 0x65, 0x18, 0x05, 0x20, 0x01, 0x28, 0x0b, 0x32, - 0x08, 0x2e, 0x46, 0x65, 0x6c, 0x74, 0x32, 0x35, 0x32, 0x52, 0x05, 0x6e, 0x6f, 0x6e, 0x63, 0x65, - 0x22, 0x8e, 0x0b, 0x0a, 0x07, 0x52, 0x65, 0x63, 0x65, 0x69, 0x70, 0x74, 0x12, 0x29, 0x0a, 0x06, - 0x69, 0x6e, 0x76, 0x6f, 0x6b, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x0f, 0x2e, 0x52, - 0x65, 0x63, 0x65, 0x69, 0x70, 0x74, 0x2e, 0x49, 0x6e, 0x76, 0x6f, 0x6b, 0x65, 0x48, 0x00, 0x52, - 0x06, 0x69, 0x6e, 0x76, 0x6f, 0x6b, 0x65, 0x12, 0x33, 0x0a, 0x0a, 0x6c, 0x31, 0x5f, 0x68, 0x61, - 0x6e, 0x64, 0x6c, 0x65, 0x72, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x12, 0x2e, 0x52, 0x65, - 0x63, 0x65, 0x69, 0x70, 0x74, 0x2e, 0x4c, 0x31, 0x48, 0x61, 0x6e, 0x64, 0x6c, 0x65, 0x72, 0x48, - 0x00, 0x52, 0x09, 0x6c, 0x31, 0x48, 0x61, 0x6e, 0x64, 0x6c, 0x65, 0x72, 0x12, 0x2c, 0x0a, 0x07, - 0x64, 0x65, 0x63, 0x6c, 0x61, 0x72, 0x65, 0x18, 0x03, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x10, 0x2e, - 0x52, 0x65, 0x63, 0x65, 0x69, 0x70, 0x74, 0x2e, 0x44, 0x65, 0x63, 0x6c, 0x61, 0x72, 0x65, 0x48, - 0x00, 0x52, 0x07, 0x64, 0x65, 0x63, 0x6c, 0x61, 0x72, 0x65, 0x12, 0x3e, 0x0a, 0x11, 0x64, 0x65, - 0x70, 0x72, 0x65, 0x63, 0x61, 0x74, 0x65, 0x64, 0x5f, 0x64, 0x65, 0x70, 0x6c, 0x6f, 0x79, 0x18, - 0x04, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x0f, 0x2e, 0x52, 0x65, 0x63, 0x65, 0x69, 0x70, 0x74, 0x2e, - 0x44, 0x65, 0x70, 0x6c, 0x6f, 0x79, 0x48, 0x00, 0x52, 0x10, 0x64, 0x65, 0x70, 0x72, 0x65, 0x63, - 0x61, 0x74, 0x65, 0x64, 0x44, 0x65, 0x70, 0x6c, 0x6f, 0x79, 0x12, 0x3f, 0x0a, 0x0e, 0x64, 0x65, - 0x70, 0x6c, 0x6f, 0x79, 0x5f, 0x61, 0x63, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x18, 0x05, 0x20, 0x01, - 0x28, 0x0b, 0x32, 0x16, 0x2e, 0x52, 0x65, 0x63, 0x65, 0x69, 0x70, 0x74, 0x2e, 0x44, 0x65, 0x70, - 0x6c, 0x6f, 0x79, 0x41, 0x63, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x48, 0x00, 0x52, 0x0d, 0x64, 0x65, - 0x70, 0x6c, 0x6f, 0x79, 0x41, 0x63, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x1a, 0xf6, 0x02, 0x0a, 0x12, - 0x45, 0x78, 0x65, 0x63, 0x75, 0x74, 0x69, 0x6f, 0x6e, 0x52, 0x65, 0x73, 0x6f, 0x75, 0x72, 0x63, - 0x65, 0x73, 0x12, 0x46, 0x0a, 0x08, 0x62, 0x75, 0x69, 0x6c, 0x74, 0x69, 0x6e, 0x73, 0x18, 0x01, - 0x20, 0x01, 0x28, 0x0b, 0x32, 0x2a, 0x2e, 0x52, 0x65, 0x63, 0x65, 0x69, 0x70, 0x74, 0x2e, 0x45, - 0x78, 0x65, 0x63, 0x75, 0x74, 0x69, 0x6f, 0x6e, 0x52, 0x65, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, - 0x73, 0x2e, 0x42, 0x75, 0x69, 0x6c, 0x74, 0x69, 0x6e, 0x43, 0x6f, 0x75, 0x6e, 0x74, 0x65, 0x72, - 0x52, 0x08, 0x62, 0x75, 0x69, 0x6c, 0x74, 0x69, 0x6e, 0x73, 0x12, 0x14, 0x0a, 0x05, 0x73, 0x74, - 0x65, 0x70, 0x73, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0d, 0x52, 0x05, 0x73, 0x74, 0x65, 0x70, 0x73, - 0x12, 0x21, 0x0a, 0x0c, 0x6d, 0x65, 0x6d, 0x6f, 0x72, 0x79, 0x5f, 0x68, 0x6f, 0x6c, 0x65, 0x73, - 0x18, 0x03, 0x20, 0x01, 0x28, 0x0d, 0x52, 0x0b, 0x6d, 0x65, 0x6d, 0x6f, 0x72, 0x79, 0x48, 0x6f, - 0x6c, 0x65, 0x73, 0x1a, 0xde, 0x01, 0x0a, 0x0e, 0x42, 0x75, 0x69, 0x6c, 0x74, 0x69, 0x6e, 0x43, - 0x6f, 0x75, 0x6e, 0x74, 0x65, 0x72, 0x12, 0x18, 0x0a, 0x07, 0x62, 0x69, 0x74, 0x77, 0x69, 0x73, - 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0d, 0x52, 0x07, 0x62, 0x69, 0x74, 0x77, 0x69, 0x73, 0x65, - 0x12, 0x14, 0x0a, 0x05, 0x65, 0x63, 0x64, 0x73, 0x61, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0d, 0x52, - 0x05, 0x65, 0x63, 0x64, 0x73, 0x61, 0x12, 0x13, 0x0a, 0x05, 0x65, 0x63, 0x5f, 0x6f, 0x70, 0x18, - 0x03, 0x20, 0x01, 0x28, 0x0d, 0x52, 0x04, 0x65, 0x63, 0x4f, 0x70, 0x12, 0x1a, 0x0a, 0x08, 0x70, - 0x65, 0x64, 0x65, 0x72, 0x73, 0x65, 0x6e, 0x18, 0x04, 0x20, 0x01, 0x28, 0x0d, 0x52, 0x08, 0x70, - 0x65, 0x64, 0x65, 0x72, 0x73, 0x65, 0x6e, 0x12, 0x1f, 0x0a, 0x0b, 0x72, 0x61, 0x6e, 0x67, 0x65, - 0x5f, 0x63, 0x68, 0x65, 0x63, 0x6b, 0x18, 0x05, 0x20, 0x01, 0x28, 0x0d, 0x52, 0x0a, 0x72, 0x61, - 0x6e, 0x67, 0x65, 0x43, 0x68, 0x65, 0x63, 0x6b, 0x12, 0x1a, 0x0a, 0x08, 0x70, 0x6f, 0x73, 0x65, - 0x69, 0x64, 0x6f, 0x6e, 0x18, 0x06, 0x20, 0x01, 0x28, 0x0d, 0x52, 0x08, 0x70, 0x6f, 0x73, 0x65, - 0x69, 0x64, 0x6f, 0x6e, 0x12, 0x16, 0x0a, 0x06, 0x6b, 0x65, 0x63, 0x63, 0x61, 0x6b, 0x18, 0x07, - 0x20, 0x01, 0x28, 0x0d, 0x52, 0x06, 0x6b, 0x65, 0x63, 0x63, 0x61, 0x6b, 0x12, 0x16, 0x0a, 0x06, - 0x6f, 0x75, 0x74, 0x70, 0x75, 0x74, 0x18, 0x08, 0x20, 0x01, 0x28, 0x0d, 0x52, 0x06, 0x6f, 0x75, - 0x74, 0x70, 0x75, 0x74, 0x1a, 0xdc, 0x02, 0x0a, 0x06, 0x43, 0x6f, 0x6d, 0x6d, 0x6f, 0x6e, 0x12, - 0x30, 0x0a, 0x10, 0x74, 0x72, 0x61, 0x6e, 0x73, 0x61, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x5f, 0x68, - 0x61, 0x73, 0x68, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x05, 0x2e, 0x48, 0x61, 0x73, 0x68, - 0x52, 0x0f, 0x74, 0x72, 0x61, 0x6e, 0x73, 0x61, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x48, 0x61, 0x73, - 0x68, 0x12, 0x27, 0x0a, 0x0a, 0x61, 0x63, 0x74, 0x75, 0x61, 0x6c, 0x5f, 0x66, 0x65, 0x65, 0x18, - 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x08, 0x2e, 0x46, 0x65, 0x6c, 0x74, 0x32, 0x35, 0x32, 0x52, - 0x09, 0x61, 0x63, 0x74, 0x75, 0x61, 0x6c, 0x46, 0x65, 0x65, 0x12, 0x31, 0x0a, 0x0d, 0x6d, 0x65, - 0x73, 0x73, 0x61, 0x67, 0x65, 0x73, 0x5f, 0x73, 0x65, 0x6e, 0x74, 0x18, 0x03, 0x20, 0x03, 0x28, - 0x0b, 0x32, 0x0c, 0x2e, 0x4d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x54, 0x6f, 0x4c, 0x31, 0x52, - 0x0c, 0x6d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x73, 0x53, 0x65, 0x6e, 0x74, 0x12, 0x4c, 0x0a, - 0x13, 0x65, 0x78, 0x65, 0x63, 0x75, 0x74, 0x69, 0x6f, 0x6e, 0x5f, 0x72, 0x65, 0x73, 0x6f, 0x75, - 0x72, 0x63, 0x65, 0x73, 0x18, 0x04, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1b, 0x2e, 0x52, 0x65, 0x63, - 0x65, 0x69, 0x70, 0x74, 0x2e, 0x45, 0x78, 0x65, 0x63, 0x75, 0x74, 0x69, 0x6f, 0x6e, 0x52, 0x65, - 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x73, 0x52, 0x12, 0x65, 0x78, 0x65, 0x63, 0x75, 0x74, 0x69, - 0x6f, 0x6e, 0x52, 0x65, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x73, 0x12, 0x23, 0x0a, 0x0d, 0x72, - 0x65, 0x76, 0x65, 0x72, 0x74, 0x5f, 0x72, 0x65, 0x61, 0x73, 0x6f, 0x6e, 0x18, 0x05, 0x20, 0x01, - 0x28, 0x09, 0x52, 0x0c, 0x72, 0x65, 0x76, 0x65, 0x72, 0x74, 0x52, 0x65, 0x61, 0x73, 0x6f, 0x6e, - 0x12, 0x3c, 0x0a, 0x10, 0x63, 0x6f, 0x6e, 0x73, 0x75, 0x6d, 0x65, 0x64, 0x5f, 0x6d, 0x65, 0x73, - 0x73, 0x61, 0x67, 0x65, 0x18, 0x06, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x0c, 0x2e, 0x4d, 0x65, 0x73, - 0x73, 0x61, 0x67, 0x65, 0x54, 0x6f, 0x4c, 0x32, 0x48, 0x00, 0x52, 0x0f, 0x63, 0x6f, 0x6e, 0x73, - 0x75, 0x6d, 0x65, 0x64, 0x4d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x88, 0x01, 0x01, 0x42, 0x13, - 0x0a, 0x11, 0x5f, 0x63, 0x6f, 0x6e, 0x73, 0x75, 0x6d, 0x65, 0x64, 0x5f, 0x6d, 0x65, 0x73, 0x73, - 0x61, 0x67, 0x65, 0x1a, 0x31, 0x0a, 0x06, 0x49, 0x6e, 0x76, 0x6f, 0x6b, 0x65, 0x12, 0x27, 0x0a, - 0x06, 0x63, 0x6f, 0x6d, 0x6d, 0x6f, 0x6e, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x0f, 0x2e, - 0x52, 0x65, 0x63, 0x65, 0x69, 0x70, 0x74, 0x2e, 0x43, 0x6f, 0x6d, 0x6d, 0x6f, 0x6e, 0x52, 0x06, - 0x63, 0x6f, 0x6d, 0x6d, 0x6f, 0x6e, 0x1a, 0x56, 0x0a, 0x09, 0x4c, 0x31, 0x48, 0x61, 0x6e, 0x64, - 0x6c, 0x65, 0x72, 0x12, 0x27, 0x0a, 0x06, 0x63, 0x6f, 0x6d, 0x6d, 0x6f, 0x6e, 0x18, 0x01, 0x20, - 0x01, 0x28, 0x0b, 0x32, 0x0f, 0x2e, 0x52, 0x65, 0x63, 0x65, 0x69, 0x70, 0x74, 0x2e, 0x43, 0x6f, - 0x6d, 0x6d, 0x6f, 0x6e, 0x52, 0x06, 0x63, 0x6f, 0x6d, 0x6d, 0x6f, 0x6e, 0x12, 0x20, 0x0a, 0x08, - 0x6d, 0x73, 0x67, 0x5f, 0x68, 0x61, 0x73, 0x68, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x05, - 0x2e, 0x48, 0x61, 0x73, 0x68, 0x52, 0x07, 0x6d, 0x73, 0x67, 0x48, 0x61, 0x73, 0x68, 0x1a, 0x32, - 0x0a, 0x07, 0x44, 0x65, 0x63, 0x6c, 0x61, 0x72, 0x65, 0x12, 0x27, 0x0a, 0x06, 0x63, 0x6f, 0x6d, - 0x6d, 0x6f, 0x6e, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x0f, 0x2e, 0x52, 0x65, 0x63, 0x65, - 0x69, 0x70, 0x74, 0x2e, 0x43, 0x6f, 0x6d, 0x6d, 0x6f, 0x6e, 0x52, 0x06, 0x63, 0x6f, 0x6d, 0x6d, - 0x6f, 0x6e, 0x1a, 0x66, 0x0a, 0x06, 0x44, 0x65, 0x70, 0x6c, 0x6f, 0x79, 0x12, 0x27, 0x0a, 0x06, + 0x74, 0x73, 0x22, 0xbb, 0x0a, 0x0a, 0x07, 0x52, 0x65, 0x63, 0x65, 0x69, 0x70, 0x74, 0x12, 0x29, + 0x0a, 0x06, 0x69, 0x6e, 0x76, 0x6f, 0x6b, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x0f, + 0x2e, 0x52, 0x65, 0x63, 0x65, 0x69, 0x70, 0x74, 0x2e, 0x49, 0x6e, 0x76, 0x6f, 0x6b, 0x65, 0x48, + 0x00, 0x52, 0x06, 0x69, 0x6e, 0x76, 0x6f, 0x6b, 0x65, 0x12, 0x33, 0x0a, 0x0a, 0x6c, 0x31, 0x5f, + 0x68, 0x61, 0x6e, 0x64, 0x6c, 0x65, 0x72, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x12, 0x2e, + 0x52, 0x65, 0x63, 0x65, 0x69, 0x70, 0x74, 0x2e, 0x4c, 0x31, 0x48, 0x61, 0x6e, 0x64, 0x6c, 0x65, + 0x72, 0x48, 0x00, 0x52, 0x09, 0x6c, 0x31, 0x48, 0x61, 0x6e, 0x64, 0x6c, 0x65, 0x72, 0x12, 0x2c, + 0x0a, 0x07, 0x64, 0x65, 0x63, 0x6c, 0x61, 0x72, 0x65, 0x18, 0x03, 0x20, 0x01, 0x28, 0x0b, 0x32, + 0x10, 0x2e, 0x52, 0x65, 0x63, 0x65, 0x69, 0x70, 0x74, 0x2e, 0x44, 0x65, 0x63, 0x6c, 0x61, 0x72, + 0x65, 0x48, 0x00, 0x52, 0x07, 0x64, 0x65, 0x63, 0x6c, 0x61, 0x72, 0x65, 0x12, 0x3e, 0x0a, 0x11, + 0x64, 0x65, 0x70, 0x72, 0x65, 0x63, 0x61, 0x74, 0x65, 0x64, 0x5f, 0x64, 0x65, 0x70, 0x6c, 0x6f, + 0x79, 0x18, 0x04, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x0f, 0x2e, 0x52, 0x65, 0x63, 0x65, 0x69, 0x70, + 0x74, 0x2e, 0x44, 0x65, 0x70, 0x6c, 0x6f, 0x79, 0x48, 0x00, 0x52, 0x10, 0x64, 0x65, 0x70, 0x72, + 0x65, 0x63, 0x61, 0x74, 0x65, 0x64, 0x44, 0x65, 0x70, 0x6c, 0x6f, 0x79, 0x12, 0x3f, 0x0a, 0x0e, + 0x64, 0x65, 0x70, 0x6c, 0x6f, 0x79, 0x5f, 0x61, 0x63, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x18, 0x05, + 0x20, 0x01, 0x28, 0x0b, 0x32, 0x16, 0x2e, 0x52, 0x65, 0x63, 0x65, 0x69, 0x70, 0x74, 0x2e, 0x44, + 0x65, 0x70, 0x6c, 0x6f, 0x79, 0x41, 0x63, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x48, 0x00, 0x52, 0x0d, + 0x64, 0x65, 0x70, 0x6c, 0x6f, 0x79, 0x41, 0x63, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x1a, 0xf6, 0x02, + 0x0a, 0x12, 0x45, 0x78, 0x65, 0x63, 0x75, 0x74, 0x69, 0x6f, 0x6e, 0x52, 0x65, 0x73, 0x6f, 0x75, + 0x72, 0x63, 0x65, 0x73, 0x12, 0x46, 0x0a, 0x08, 0x62, 0x75, 0x69, 0x6c, 0x74, 0x69, 0x6e, 0x73, + 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x2a, 0x2e, 0x52, 0x65, 0x63, 0x65, 0x69, 0x70, 0x74, + 0x2e, 0x45, 0x78, 0x65, 0x63, 0x75, 0x74, 0x69, 0x6f, 0x6e, 0x52, 0x65, 0x73, 0x6f, 0x75, 0x72, + 0x63, 0x65, 0x73, 0x2e, 0x42, 0x75, 0x69, 0x6c, 0x74, 0x69, 0x6e, 0x43, 0x6f, 0x75, 0x6e, 0x74, + 0x65, 0x72, 0x52, 0x08, 0x62, 0x75, 0x69, 0x6c, 0x74, 0x69, 0x6e, 0x73, 0x12, 0x14, 0x0a, 0x05, + 0x73, 0x74, 0x65, 0x70, 0x73, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0d, 0x52, 0x05, 0x73, 0x74, 0x65, + 0x70, 0x73, 0x12, 0x21, 0x0a, 0x0c, 0x6d, 0x65, 0x6d, 0x6f, 0x72, 0x79, 0x5f, 0x68, 0x6f, 0x6c, + 0x65, 0x73, 0x18, 0x03, 0x20, 0x01, 0x28, 0x0d, 0x52, 0x0b, 0x6d, 0x65, 0x6d, 0x6f, 0x72, 0x79, + 0x48, 0x6f, 0x6c, 0x65, 0x73, 0x1a, 0xde, 0x01, 0x0a, 0x0e, 0x42, 0x75, 0x69, 0x6c, 0x74, 0x69, + 0x6e, 0x43, 0x6f, 0x75, 0x6e, 0x74, 0x65, 0x72, 0x12, 0x18, 0x0a, 0x07, 0x62, 0x69, 0x74, 0x77, + 0x69, 0x73, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0d, 0x52, 0x07, 0x62, 0x69, 0x74, 0x77, 0x69, + 0x73, 0x65, 0x12, 0x14, 0x0a, 0x05, 0x65, 0x63, 0x64, 0x73, 0x61, 0x18, 0x02, 0x20, 0x01, 0x28, + 0x0d, 0x52, 0x05, 0x65, 0x63, 0x64, 0x73, 0x61, 0x12, 0x13, 0x0a, 0x05, 0x65, 0x63, 0x5f, 0x6f, + 0x70, 0x18, 0x03, 0x20, 0x01, 0x28, 0x0d, 0x52, 0x04, 0x65, 0x63, 0x4f, 0x70, 0x12, 0x1a, 0x0a, + 0x08, 0x70, 0x65, 0x64, 0x65, 0x72, 0x73, 0x65, 0x6e, 0x18, 0x04, 0x20, 0x01, 0x28, 0x0d, 0x52, + 0x08, 0x70, 0x65, 0x64, 0x65, 0x72, 0x73, 0x65, 0x6e, 0x12, 0x1f, 0x0a, 0x0b, 0x72, 0x61, 0x6e, + 0x67, 0x65, 0x5f, 0x63, 0x68, 0x65, 0x63, 0x6b, 0x18, 0x05, 0x20, 0x01, 0x28, 0x0d, 0x52, 0x0a, + 0x72, 0x61, 0x6e, 0x67, 0x65, 0x43, 0x68, 0x65, 0x63, 0x6b, 0x12, 0x1a, 0x0a, 0x08, 0x70, 0x6f, + 0x73, 0x65, 0x69, 0x64, 0x6f, 0x6e, 0x18, 0x06, 0x20, 0x01, 0x28, 0x0d, 0x52, 0x08, 0x70, 0x6f, + 0x73, 0x65, 0x69, 0x64, 0x6f, 0x6e, 0x12, 0x16, 0x0a, 0x06, 0x6b, 0x65, 0x63, 0x63, 0x61, 0x6b, + 0x18, 0x07, 0x20, 0x01, 0x28, 0x0d, 0x52, 0x06, 0x6b, 0x65, 0x63, 0x63, 0x61, 0x6b, 0x12, 0x16, + 0x0a, 0x06, 0x6f, 0x75, 0x74, 0x70, 0x75, 0x74, 0x18, 0x08, 0x20, 0x01, 0x28, 0x0d, 0x52, 0x06, + 0x6f, 0x75, 0x74, 0x70, 0x75, 0x74, 0x1a, 0x89, 0x02, 0x0a, 0x06, 0x43, 0x6f, 0x6d, 0x6d, 0x6f, + 0x6e, 0x12, 0x30, 0x0a, 0x10, 0x74, 0x72, 0x61, 0x6e, 0x73, 0x61, 0x63, 0x74, 0x69, 0x6f, 0x6e, + 0x5f, 0x68, 0x61, 0x73, 0x68, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x05, 0x2e, 0x48, 0x61, + 0x73, 0x68, 0x52, 0x0f, 0x74, 0x72, 0x61, 0x6e, 0x73, 0x61, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x48, + 0x61, 0x73, 0x68, 0x12, 0x27, 0x0a, 0x0a, 0x61, 0x63, 0x74, 0x75, 0x61, 0x6c, 0x5f, 0x66, 0x65, + 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x08, 0x2e, 0x46, 0x65, 0x6c, 0x74, 0x32, 0x35, + 0x32, 0x52, 0x09, 0x61, 0x63, 0x74, 0x75, 0x61, 0x6c, 0x46, 0x65, 0x65, 0x12, 0x31, 0x0a, 0x0d, + 0x6d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x73, 0x5f, 0x73, 0x65, 0x6e, 0x74, 0x18, 0x03, 0x20, + 0x03, 0x28, 0x0b, 0x32, 0x0c, 0x2e, 0x4d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x54, 0x6f, 0x4c, + 0x31, 0x52, 0x0c, 0x6d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x73, 0x53, 0x65, 0x6e, 0x74, 0x12, + 0x4c, 0x0a, 0x13, 0x65, 0x78, 0x65, 0x63, 0x75, 0x74, 0x69, 0x6f, 0x6e, 0x5f, 0x72, 0x65, 0x73, + 0x6f, 0x75, 0x72, 0x63, 0x65, 0x73, 0x18, 0x04, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1b, 0x2e, 0x52, + 0x65, 0x63, 0x65, 0x69, 0x70, 0x74, 0x2e, 0x45, 0x78, 0x65, 0x63, 0x75, 0x74, 0x69, 0x6f, 0x6e, + 0x52, 0x65, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x73, 0x52, 0x12, 0x65, 0x78, 0x65, 0x63, 0x75, + 0x74, 0x69, 0x6f, 0x6e, 0x52, 0x65, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x73, 0x12, 0x23, 0x0a, + 0x0d, 0x72, 0x65, 0x76, 0x65, 0x72, 0x74, 0x5f, 0x72, 0x65, 0x61, 0x73, 0x6f, 0x6e, 0x18, 0x05, + 0x20, 0x01, 0x28, 0x09, 0x52, 0x0c, 0x72, 0x65, 0x76, 0x65, 0x72, 0x74, 0x52, 0x65, 0x61, 0x73, + 0x6f, 0x6e, 0x1a, 0x31, 0x0a, 0x06, 0x49, 0x6e, 0x76, 0x6f, 0x6b, 0x65, 0x12, 0x27, 0x0a, 0x06, 0x63, 0x6f, 0x6d, 0x6d, 0x6f, 0x6e, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x0f, 0x2e, 0x52, 0x65, 0x63, 0x65, 0x69, 0x70, 0x74, 0x2e, 0x43, 0x6f, 0x6d, 0x6d, 0x6f, 0x6e, 0x52, 0x06, 0x63, - 0x6f, 0x6d, 0x6d, 0x6f, 0x6e, 0x12, 0x33, 0x0a, 0x10, 0x63, 0x6f, 0x6e, 0x74, 0x72, 0x61, 0x63, - 0x74, 0x5f, 0x61, 0x64, 0x64, 0x72, 0x65, 0x73, 0x73, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, - 0x08, 0x2e, 0x46, 0x65, 0x6c, 0x74, 0x32, 0x35, 0x32, 0x52, 0x0f, 0x63, 0x6f, 0x6e, 0x74, 0x72, - 0x61, 0x63, 0x74, 0x41, 0x64, 0x64, 0x72, 0x65, 0x73, 0x73, 0x1a, 0x6d, 0x0a, 0x0d, 0x44, 0x65, - 0x70, 0x6c, 0x6f, 0x79, 0x41, 0x63, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x12, 0x27, 0x0a, 0x06, 0x63, + 0x6f, 0x6d, 0x6d, 0x6f, 0x6e, 0x1a, 0x56, 0x0a, 0x09, 0x4c, 0x31, 0x48, 0x61, 0x6e, 0x64, 0x6c, + 0x65, 0x72, 0x12, 0x27, 0x0a, 0x06, 0x63, 0x6f, 0x6d, 0x6d, 0x6f, 0x6e, 0x18, 0x01, 0x20, 0x01, + 0x28, 0x0b, 0x32, 0x0f, 0x2e, 0x52, 0x65, 0x63, 0x65, 0x69, 0x70, 0x74, 0x2e, 0x43, 0x6f, 0x6d, + 0x6d, 0x6f, 0x6e, 0x52, 0x06, 0x63, 0x6f, 0x6d, 0x6d, 0x6f, 0x6e, 0x12, 0x20, 0x0a, 0x08, 0x6d, + 0x73, 0x67, 0x5f, 0x68, 0x61, 0x73, 0x68, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x05, 0x2e, + 0x48, 0x61, 0x73, 0x68, 0x52, 0x07, 0x6d, 0x73, 0x67, 0x48, 0x61, 0x73, 0x68, 0x1a, 0x32, 0x0a, + 0x07, 0x44, 0x65, 0x63, 0x6c, 0x61, 0x72, 0x65, 0x12, 0x27, 0x0a, 0x06, 0x63, 0x6f, 0x6d, 0x6d, + 0x6f, 0x6e, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x0f, 0x2e, 0x52, 0x65, 0x63, 0x65, 0x69, + 0x70, 0x74, 0x2e, 0x43, 0x6f, 0x6d, 0x6d, 0x6f, 0x6e, 0x52, 0x06, 0x63, 0x6f, 0x6d, 0x6d, 0x6f, + 0x6e, 0x1a, 0x66, 0x0a, 0x06, 0x44, 0x65, 0x70, 0x6c, 0x6f, 0x79, 0x12, 0x27, 0x0a, 0x06, 0x63, 0x6f, 0x6d, 0x6d, 0x6f, 0x6e, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x0f, 0x2e, 0x52, 0x65, 0x63, 0x65, 0x69, 0x70, 0x74, 0x2e, 0x43, 0x6f, 0x6d, 0x6d, 0x6f, 0x6e, 0x52, 0x06, 0x63, 0x6f, 0x6d, 0x6d, 0x6f, 0x6e, 0x12, 0x33, 0x0a, 0x10, 0x63, 0x6f, 0x6e, 0x74, 0x72, 0x61, 0x63, 0x74, 0x5f, 0x61, 0x64, 0x64, 0x72, 0x65, 0x73, 0x73, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x08, 0x2e, 0x46, 0x65, 0x6c, 0x74, 0x32, 0x35, 0x32, 0x52, 0x0f, 0x63, 0x6f, 0x6e, 0x74, 0x72, 0x61, - 0x63, 0x74, 0x41, 0x64, 0x64, 0x72, 0x65, 0x73, 0x73, 0x42, 0x06, 0x0a, 0x04, 0x74, 0x79, 0x70, - 0x65, 0x22, 0x3b, 0x0a, 0x0f, 0x52, 0x65, 0x63, 0x65, 0x69, 0x70, 0x74, 0x73, 0x52, 0x65, 0x71, - 0x75, 0x65, 0x73, 0x74, 0x12, 0x28, 0x0a, 0x09, 0x69, 0x74, 0x65, 0x72, 0x61, 0x74, 0x69, 0x6f, - 0x6e, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x0a, 0x2e, 0x49, 0x74, 0x65, 0x72, 0x61, 0x74, - 0x69, 0x6f, 0x6e, 0x52, 0x09, 0x69, 0x74, 0x65, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x22, 0x2a, - 0x0a, 0x08, 0x52, 0x65, 0x63, 0x65, 0x69, 0x70, 0x74, 0x73, 0x12, 0x1e, 0x0a, 0x05, 0x69, 0x74, - 0x65, 0x6d, 0x73, 0x18, 0x02, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x08, 0x2e, 0x52, 0x65, 0x63, 0x65, - 0x69, 0x70, 0x74, 0x52, 0x05, 0x69, 0x74, 0x65, 0x6d, 0x73, 0x22, 0x88, 0x01, 0x0a, 0x10, 0x52, - 0x65, 0x63, 0x65, 0x69, 0x70, 0x74, 0x73, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, - 0x1d, 0x0a, 0x02, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x08, 0x2e, 0x42, 0x6c, - 0x6f, 0x63, 0x6b, 0x49, 0x44, 0x48, 0x01, 0x52, 0x02, 0x69, 0x64, 0x88, 0x01, 0x01, 0x12, 0x27, - 0x0a, 0x08, 0x72, 0x65, 0x63, 0x65, 0x69, 0x70, 0x74, 0x73, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, - 0x32, 0x09, 0x2e, 0x52, 0x65, 0x63, 0x65, 0x69, 0x70, 0x74, 0x73, 0x48, 0x00, 0x52, 0x08, 0x72, - 0x65, 0x63, 0x65, 0x69, 0x70, 0x74, 0x73, 0x12, 0x18, 0x0a, 0x03, 0x66, 0x69, 0x6e, 0x18, 0x03, - 0x20, 0x01, 0x28, 0x0b, 0x32, 0x04, 0x2e, 0x46, 0x69, 0x6e, 0x48, 0x00, 0x52, 0x03, 0x66, 0x69, - 0x6e, 0x42, 0x0b, 0x0a, 0x09, 0x72, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x73, 0x42, 0x05, - 0x0a, 0x03, 0x5f, 0x69, 0x64, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, + 0x63, 0x74, 0x41, 0x64, 0x64, 0x72, 0x65, 0x73, 0x73, 0x1a, 0x6d, 0x0a, 0x0d, 0x44, 0x65, 0x70, + 0x6c, 0x6f, 0x79, 0x41, 0x63, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x12, 0x27, 0x0a, 0x06, 0x63, 0x6f, + 0x6d, 0x6d, 0x6f, 0x6e, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x0f, 0x2e, 0x52, 0x65, 0x63, + 0x65, 0x69, 0x70, 0x74, 0x2e, 0x43, 0x6f, 0x6d, 0x6d, 0x6f, 0x6e, 0x52, 0x06, 0x63, 0x6f, 0x6d, + 0x6d, 0x6f, 0x6e, 0x12, 0x33, 0x0a, 0x10, 0x63, 0x6f, 0x6e, 0x74, 0x72, 0x61, 0x63, 0x74, 0x5f, + 0x61, 0x64, 0x64, 0x72, 0x65, 0x73, 0x73, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x08, 0x2e, + 0x46, 0x65, 0x6c, 0x74, 0x32, 0x35, 0x32, 0x52, 0x0f, 0x63, 0x6f, 0x6e, 0x74, 0x72, 0x61, 0x63, + 0x74, 0x41, 0x64, 0x64, 0x72, 0x65, 0x73, 0x73, 0x42, 0x06, 0x0a, 0x04, 0x74, 0x79, 0x70, 0x65, + 0x22, 0x3b, 0x0a, 0x0f, 0x52, 0x65, 0x63, 0x65, 0x69, 0x70, 0x74, 0x73, 0x52, 0x65, 0x71, 0x75, + 0x65, 0x73, 0x74, 0x12, 0x28, 0x0a, 0x09, 0x69, 0x74, 0x65, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, + 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x0a, 0x2e, 0x49, 0x74, 0x65, 0x72, 0x61, 0x74, 0x69, + 0x6f, 0x6e, 0x52, 0x09, 0x69, 0x74, 0x65, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x22, 0x2a, 0x0a, + 0x08, 0x52, 0x65, 0x63, 0x65, 0x69, 0x70, 0x74, 0x73, 0x12, 0x1e, 0x0a, 0x05, 0x69, 0x74, 0x65, + 0x6d, 0x73, 0x18, 0x02, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x08, 0x2e, 0x52, 0x65, 0x63, 0x65, 0x69, + 0x70, 0x74, 0x52, 0x05, 0x69, 0x74, 0x65, 0x6d, 0x73, 0x22, 0x65, 0x0a, 0x10, 0x52, 0x65, 0x63, + 0x65, 0x69, 0x70, 0x74, 0x73, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x24, 0x0a, + 0x07, 0x72, 0x65, 0x63, 0x65, 0x69, 0x70, 0x74, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x08, + 0x2e, 0x52, 0x65, 0x63, 0x65, 0x69, 0x70, 0x74, 0x48, 0x00, 0x52, 0x07, 0x72, 0x65, 0x63, 0x65, + 0x69, 0x70, 0x74, 0x12, 0x18, 0x0a, 0x03, 0x66, 0x69, 0x6e, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, + 0x32, 0x04, 0x2e, 0x46, 0x69, 0x6e, 0x48, 0x00, 0x52, 0x03, 0x66, 0x69, 0x6e, 0x42, 0x11, 0x0a, + 0x0f, 0x72, 0x65, 0x63, 0x65, 0x69, 0x70, 0x74, 0x5f, 0x6d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, + 0x42, 0x31, 0x5a, 0x2f, 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x4e, + 0x65, 0x74, 0x68, 0x65, 0x72, 0x6d, 0x69, 0x6e, 0x64, 0x45, 0x74, 0x68, 0x2f, 0x6a, 0x75, 0x6e, + 0x6f, 0x2f, 0x70, 0x32, 0x70, 0x2f, 0x73, 0x74, 0x61, 0x72, 0x6b, 0x6e, 0x65, 0x74, 0x2f, 0x73, + 0x70, 0x65, 0x63, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, } var ( @@ -1181,69 +1068,59 @@ func file_p2p_proto_receipt_proto_rawDescGZIP() []byte { } var ( - file_p2p_proto_receipt_proto_msgTypes = make([]protoimpl.MessageInfo, 15) + file_p2p_proto_receipt_proto_msgTypes = make([]protoimpl.MessageInfo, 14) file_p2p_proto_receipt_proto_goTypes = []interface{}{ (*MessageToL1)(nil), // 0: MessageToL1 (*EthereumAddress)(nil), // 1: EthereumAddress - (*MessageToL2)(nil), // 2: MessageToL2 - (*Receipt)(nil), // 3: Receipt - (*ReceiptsRequest)(nil), // 4: ReceiptsRequest - (*Receipts)(nil), // 5: Receipts - (*ReceiptsResponse)(nil), // 6: ReceiptsResponse - (*Receipt_ExecutionResources)(nil), // 7: Receipt.ExecutionResources - (*Receipt_Common)(nil), // 8: Receipt.Common - (*Receipt_Invoke)(nil), // 9: Receipt.Invoke - (*Receipt_L1Handler)(nil), // 10: Receipt.L1Handler - (*Receipt_Declare)(nil), // 11: Receipt.Declare - (*Receipt_Deploy)(nil), // 12: Receipt.Deploy - (*Receipt_DeployAccount)(nil), // 13: Receipt.DeployAccount - (*Receipt_ExecutionResources_BuiltinCounter)(nil), // 14: Receipt.ExecutionResources.BuiltinCounter - (*Felt252)(nil), // 15: Felt252 - (*Iteration)(nil), // 16: Iteration - (*BlockID)(nil), // 17: BlockID - (*Fin)(nil), // 18: Fin - (*Hash)(nil), // 19: Hash + (*Receipt)(nil), // 2: Receipt + (*ReceiptsRequest)(nil), // 3: ReceiptsRequest + (*Receipts)(nil), // 4: Receipts + (*ReceiptsResponse)(nil), // 5: ReceiptsResponse + (*Receipt_ExecutionResources)(nil), // 6: Receipt.ExecutionResources + (*Receipt_Common)(nil), // 7: Receipt.Common + (*Receipt_Invoke)(nil), // 8: Receipt.Invoke + (*Receipt_L1Handler)(nil), // 9: Receipt.L1Handler + (*Receipt_Declare)(nil), // 10: Receipt.Declare + (*Receipt_Deploy)(nil), // 11: Receipt.Deploy + (*Receipt_DeployAccount)(nil), // 12: Receipt.DeployAccount + (*Receipt_ExecutionResources_BuiltinCounter)(nil), // 13: Receipt.ExecutionResources.BuiltinCounter + (*Felt252)(nil), // 14: Felt252 + (*Iteration)(nil), // 15: Iteration + (*Fin)(nil), // 16: Fin + (*Hash)(nil), // 17: Hash } ) - var file_p2p_proto_receipt_proto_depIdxs = []int32{ - 15, // 0: MessageToL1.from_address:type_name -> Felt252 - 15, // 1: MessageToL1.payload:type_name -> Felt252 + 14, // 0: MessageToL1.from_address:type_name -> Felt252 + 14, // 1: MessageToL1.payload:type_name -> Felt252 1, // 2: MessageToL1.to_address:type_name -> EthereumAddress - 1, // 3: MessageToL2.from_address:type_name -> EthereumAddress - 15, // 4: MessageToL2.payload:type_name -> Felt252 - 15, // 5: MessageToL2.to_address:type_name -> Felt252 - 15, // 6: MessageToL2.entry_point_selector:type_name -> Felt252 - 15, // 7: MessageToL2.nonce:type_name -> Felt252 - 9, // 8: Receipt.invoke:type_name -> Receipt.Invoke - 10, // 9: Receipt.l1_handler:type_name -> Receipt.L1Handler - 11, // 10: Receipt.declare:type_name -> Receipt.Declare - 12, // 11: Receipt.deprecated_deploy:type_name -> Receipt.Deploy - 13, // 12: Receipt.deploy_account:type_name -> Receipt.DeployAccount - 16, // 13: ReceiptsRequest.iteration:type_name -> Iteration - 3, // 14: Receipts.items:type_name -> Receipt - 17, // 15: ReceiptsResponse.id:type_name -> BlockID - 5, // 16: ReceiptsResponse.receipts:type_name -> Receipts - 18, // 17: ReceiptsResponse.fin:type_name -> Fin - 14, // 18: Receipt.ExecutionResources.builtins:type_name -> Receipt.ExecutionResources.BuiltinCounter - 19, // 19: Receipt.Common.transaction_hash:type_name -> Hash - 15, // 20: Receipt.Common.actual_fee:type_name -> Felt252 - 0, // 21: Receipt.Common.messages_sent:type_name -> MessageToL1 - 7, // 22: Receipt.Common.execution_resources:type_name -> Receipt.ExecutionResources - 2, // 23: Receipt.Common.consumed_message:type_name -> MessageToL2 - 8, // 24: Receipt.Invoke.common:type_name -> Receipt.Common - 8, // 25: Receipt.L1Handler.common:type_name -> Receipt.Common - 19, // 26: Receipt.L1Handler.msg_hash:type_name -> Hash - 8, // 27: Receipt.Declare.common:type_name -> Receipt.Common - 8, // 28: Receipt.Deploy.common:type_name -> Receipt.Common - 15, // 29: Receipt.Deploy.contract_address:type_name -> Felt252 - 8, // 30: Receipt.DeployAccount.common:type_name -> Receipt.Common - 15, // 31: Receipt.DeployAccount.contract_address:type_name -> Felt252 - 32, // [32:32] is the sub-list for method output_type - 32, // [32:32] is the sub-list for method input_type - 32, // [32:32] is the sub-list for extension type_name - 32, // [32:32] is the sub-list for extension extendee - 0, // [0:32] is the sub-list for field type_name + 8, // 3: Receipt.invoke:type_name -> Receipt.Invoke + 9, // 4: Receipt.l1_handler:type_name -> Receipt.L1Handler + 10, // 5: Receipt.declare:type_name -> Receipt.Declare + 11, // 6: Receipt.deprecated_deploy:type_name -> Receipt.Deploy + 12, // 7: Receipt.deploy_account:type_name -> Receipt.DeployAccount + 15, // 8: ReceiptsRequest.iteration:type_name -> Iteration + 2, // 9: Receipts.items:type_name -> Receipt + 2, // 10: ReceiptsResponse.receipt:type_name -> Receipt + 16, // 11: ReceiptsResponse.fin:type_name -> Fin + 13, // 12: Receipt.ExecutionResources.builtins:type_name -> Receipt.ExecutionResources.BuiltinCounter + 17, // 13: Receipt.Common.transaction_hash:type_name -> Hash + 14, // 14: Receipt.Common.actual_fee:type_name -> Felt252 + 0, // 15: Receipt.Common.messages_sent:type_name -> MessageToL1 + 6, // 16: Receipt.Common.execution_resources:type_name -> Receipt.ExecutionResources + 7, // 17: Receipt.Invoke.common:type_name -> Receipt.Common + 7, // 18: Receipt.L1Handler.common:type_name -> Receipt.Common + 17, // 19: Receipt.L1Handler.msg_hash:type_name -> Hash + 7, // 20: Receipt.Declare.common:type_name -> Receipt.Common + 7, // 21: Receipt.Deploy.common:type_name -> Receipt.Common + 14, // 22: Receipt.Deploy.contract_address:type_name -> Felt252 + 7, // 23: Receipt.DeployAccount.common:type_name -> Receipt.Common + 14, // 24: Receipt.DeployAccount.contract_address:type_name -> Felt252 + 25, // [25:25] is the sub-list for method output_type + 25, // [25:25] is the sub-list for method input_type + 25, // [25:25] is the sub-list for extension type_name + 25, // [25:25] is the sub-list for extension extendee + 0, // [0:25] is the sub-list for field type_name } func init() { file_p2p_proto_receipt_proto_init() } @@ -1278,18 +1155,6 @@ func file_p2p_proto_receipt_proto_init() { } } file_p2p_proto_receipt_proto_msgTypes[2].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*MessageToL2); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_p2p_proto_receipt_proto_msgTypes[3].Exporter = func(v interface{}, i int) interface{} { switch v := v.(*Receipt); i { case 0: return &v.state @@ -1301,7 +1166,7 @@ func file_p2p_proto_receipt_proto_init() { return nil } } - file_p2p_proto_receipt_proto_msgTypes[4].Exporter = func(v interface{}, i int) interface{} { + file_p2p_proto_receipt_proto_msgTypes[3].Exporter = func(v interface{}, i int) interface{} { switch v := v.(*ReceiptsRequest); i { case 0: return &v.state @@ -1313,7 +1178,7 @@ func file_p2p_proto_receipt_proto_init() { return nil } } - file_p2p_proto_receipt_proto_msgTypes[5].Exporter = func(v interface{}, i int) interface{} { + file_p2p_proto_receipt_proto_msgTypes[4].Exporter = func(v interface{}, i int) interface{} { switch v := v.(*Receipts); i { case 0: return &v.state @@ -1325,7 +1190,7 @@ func file_p2p_proto_receipt_proto_init() { return nil } } - file_p2p_proto_receipt_proto_msgTypes[6].Exporter = func(v interface{}, i int) interface{} { + file_p2p_proto_receipt_proto_msgTypes[5].Exporter = func(v interface{}, i int) interface{} { switch v := v.(*ReceiptsResponse); i { case 0: return &v.state @@ -1337,7 +1202,7 @@ func file_p2p_proto_receipt_proto_init() { return nil } } - file_p2p_proto_receipt_proto_msgTypes[7].Exporter = func(v interface{}, i int) interface{} { + file_p2p_proto_receipt_proto_msgTypes[6].Exporter = func(v interface{}, i int) interface{} { switch v := v.(*Receipt_ExecutionResources); i { case 0: return &v.state @@ -1349,7 +1214,7 @@ func file_p2p_proto_receipt_proto_init() { return nil } } - file_p2p_proto_receipt_proto_msgTypes[8].Exporter = func(v interface{}, i int) interface{} { + file_p2p_proto_receipt_proto_msgTypes[7].Exporter = func(v interface{}, i int) interface{} { switch v := v.(*Receipt_Common); i { case 0: return &v.state @@ -1361,7 +1226,7 @@ func file_p2p_proto_receipt_proto_init() { return nil } } - file_p2p_proto_receipt_proto_msgTypes[9].Exporter = func(v interface{}, i int) interface{} { + file_p2p_proto_receipt_proto_msgTypes[8].Exporter = func(v interface{}, i int) interface{} { switch v := v.(*Receipt_Invoke); i { case 0: return &v.state @@ -1373,7 +1238,7 @@ func file_p2p_proto_receipt_proto_init() { return nil } } - file_p2p_proto_receipt_proto_msgTypes[10].Exporter = func(v interface{}, i int) interface{} { + file_p2p_proto_receipt_proto_msgTypes[9].Exporter = func(v interface{}, i int) interface{} { switch v := v.(*Receipt_L1Handler); i { case 0: return &v.state @@ -1385,7 +1250,7 @@ func file_p2p_proto_receipt_proto_init() { return nil } } - file_p2p_proto_receipt_proto_msgTypes[11].Exporter = func(v interface{}, i int) interface{} { + file_p2p_proto_receipt_proto_msgTypes[10].Exporter = func(v interface{}, i int) interface{} { switch v := v.(*Receipt_Declare); i { case 0: return &v.state @@ -1397,7 +1262,7 @@ func file_p2p_proto_receipt_proto_init() { return nil } } - file_p2p_proto_receipt_proto_msgTypes[12].Exporter = func(v interface{}, i int) interface{} { + file_p2p_proto_receipt_proto_msgTypes[11].Exporter = func(v interface{}, i int) interface{} { switch v := v.(*Receipt_Deploy); i { case 0: return &v.state @@ -1409,7 +1274,7 @@ func file_p2p_proto_receipt_proto_init() { return nil } } - file_p2p_proto_receipt_proto_msgTypes[13].Exporter = func(v interface{}, i int) interface{} { + file_p2p_proto_receipt_proto_msgTypes[12].Exporter = func(v interface{}, i int) interface{} { switch v := v.(*Receipt_DeployAccount); i { case 0: return &v.state @@ -1421,7 +1286,7 @@ func file_p2p_proto_receipt_proto_init() { return nil } } - file_p2p_proto_receipt_proto_msgTypes[14].Exporter = func(v interface{}, i int) interface{} { + file_p2p_proto_receipt_proto_msgTypes[13].Exporter = func(v interface{}, i int) interface{} { switch v := v.(*Receipt_ExecutionResources_BuiltinCounter); i { case 0: return &v.state @@ -1434,25 +1299,24 @@ func file_p2p_proto_receipt_proto_init() { } } } - file_p2p_proto_receipt_proto_msgTypes[3].OneofWrappers = []interface{}{ + file_p2p_proto_receipt_proto_msgTypes[2].OneofWrappers = []interface{}{ (*Receipt_Invoke_)(nil), (*Receipt_L1Handler_)(nil), (*Receipt_Declare_)(nil), (*Receipt_DeprecatedDeploy)(nil), (*Receipt_DeployAccount_)(nil), } - file_p2p_proto_receipt_proto_msgTypes[6].OneofWrappers = []interface{}{ - (*ReceiptsResponse_Receipts)(nil), + file_p2p_proto_receipt_proto_msgTypes[5].OneofWrappers = []interface{}{ + (*ReceiptsResponse_Receipt)(nil), (*ReceiptsResponse_Fin)(nil), } - file_p2p_proto_receipt_proto_msgTypes[8].OneofWrappers = []interface{}{} type x struct{} out := protoimpl.TypeBuilder{ File: protoimpl.DescBuilder{ GoPackagePath: reflect.TypeOf(x{}).PkgPath(), RawDescriptor: file_p2p_proto_receipt_proto_rawDesc, NumEnums: 0, - NumMessages: 15, + NumMessages: 14, NumExtensions: 0, NumServices: 0, }, diff --git a/p2p/starknet/spec/snapshot.pb.go b/p2p/starknet/spec/snapshot.pb.go deleted file mode 100644 index c33f7ce135..0000000000 --- a/p2p/starknet/spec/snapshot.pb.go +++ /dev/null @@ -1,1509 +0,0 @@ -// Code generated by protoc-gen-go. DO NOT EDIT. -// versions: -// protoc-gen-go v1.31.0 -// protoc v4.24.4 -// source: p2p/proto/snapshot.proto - -package spec - -import ( - reflect "reflect" - sync "sync" - - protoreflect "google.golang.org/protobuf/reflect/protoreflect" - protoimpl "google.golang.org/protobuf/runtime/protoimpl" -) - -const ( - // Verify that this generated code is sufficiently up-to-date. - _ = protoimpl.EnforceVersion(20 - protoimpl.MinVersion) - // Verify that runtime/protoimpl is sufficiently up-to-date. - _ = protoimpl.EnforceVersion(protoimpl.MaxVersion - 20) -) - -type PatriciaNode struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - // Types that are assignable to Node: - // - // *PatriciaNode_Edge_ - // *PatriciaNode_Binary_ - Node isPatriciaNode_Node `protobuf_oneof:"node"` -} - -func (x *PatriciaNode) Reset() { - *x = PatriciaNode{} - if protoimpl.UnsafeEnabled { - mi := &file_p2p_proto_snapshot_proto_msgTypes[0] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *PatriciaNode) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*PatriciaNode) ProtoMessage() {} - -func (x *PatriciaNode) ProtoReflect() protoreflect.Message { - mi := &file_p2p_proto_snapshot_proto_msgTypes[0] - if protoimpl.UnsafeEnabled && x != nil { - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - if ms.LoadMessageInfo() == nil { - ms.StoreMessageInfo(mi) - } - return ms - } - return mi.MessageOf(x) -} - -// Deprecated: Use PatriciaNode.ProtoReflect.Descriptor instead. -func (*PatriciaNode) Descriptor() ([]byte, []int) { - return file_p2p_proto_snapshot_proto_rawDescGZIP(), []int{0} -} - -func (m *PatriciaNode) GetNode() isPatriciaNode_Node { - if m != nil { - return m.Node - } - return nil -} - -func (x *PatriciaNode) GetEdge() *PatriciaNode_Edge { - if x, ok := x.GetNode().(*PatriciaNode_Edge_); ok { - return x.Edge - } - return nil -} - -func (x *PatriciaNode) GetBinary() *PatriciaNode_Binary { - if x, ok := x.GetNode().(*PatriciaNode_Binary_); ok { - return x.Binary - } - return nil -} - -type isPatriciaNode_Node interface { - isPatriciaNode_Node() -} - -type PatriciaNode_Edge_ struct { - Edge *PatriciaNode_Edge `protobuf:"bytes,1,opt,name=edge,proto3,oneof"` -} - -type PatriciaNode_Binary_ struct { - Binary *PatriciaNode_Binary `protobuf:"bytes,2,opt,name=binary,proto3,oneof"` -} - -func (*PatriciaNode_Edge_) isPatriciaNode_Node() {} - -func (*PatriciaNode_Binary_) isPatriciaNode_Node() {} - -// non leaf nodes required to build the trie given the range (leaves) -type PatriciaRangeProof struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - Nodes []*PatriciaNode `protobuf:"bytes,1,rep,name=nodes,proto3" json:"nodes,omitempty"` -} - -func (x *PatriciaRangeProof) Reset() { - *x = PatriciaRangeProof{} - if protoimpl.UnsafeEnabled { - mi := &file_p2p_proto_snapshot_proto_msgTypes[1] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *PatriciaRangeProof) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*PatriciaRangeProof) ProtoMessage() {} - -func (x *PatriciaRangeProof) ProtoReflect() protoreflect.Message { - mi := &file_p2p_proto_snapshot_proto_msgTypes[1] - if protoimpl.UnsafeEnabled && x != nil { - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - if ms.LoadMessageInfo() == nil { - ms.StoreMessageInfo(mi) - } - return ms - } - return mi.MessageOf(x) -} - -// Deprecated: Use PatriciaRangeProof.ProtoReflect.Descriptor instead. -func (*PatriciaRangeProof) Descriptor() ([]byte, []int) { - return file_p2p_proto_snapshot_proto_rawDescGZIP(), []int{1} -} - -func (x *PatriciaRangeProof) GetNodes() []*PatriciaNode { - if x != nil { - return x.Nodes - } - return nil -} - -// leafs of the contract state tree -type ContractState struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - Address *Address `protobuf:"bytes,1,opt,name=address,proto3" json:"address,omitempty"` // the key - Class *Hash `protobuf:"bytes,2,opt,name=class,proto3" json:"class,omitempty"` - Storage *Hash `protobuf:"bytes,3,opt,name=storage,proto3" json:"storage,omitempty"` // patricia - Nonce uint64 `protobuf:"varint,4,opt,name=nonce,proto3" json:"nonce,omitempty"` -} - -func (x *ContractState) Reset() { - *x = ContractState{} - if protoimpl.UnsafeEnabled { - mi := &file_p2p_proto_snapshot_proto_msgTypes[2] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *ContractState) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*ContractState) ProtoMessage() {} - -func (x *ContractState) ProtoReflect() protoreflect.Message { - mi := &file_p2p_proto_snapshot_proto_msgTypes[2] - if protoimpl.UnsafeEnabled && x != nil { - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - if ms.LoadMessageInfo() == nil { - ms.StoreMessageInfo(mi) - } - return ms - } - return mi.MessageOf(x) -} - -// Deprecated: Use ContractState.ProtoReflect.Descriptor instead. -func (*ContractState) Descriptor() ([]byte, []int) { - return file_p2p_proto_snapshot_proto_rawDescGZIP(), []int{2} -} - -func (x *ContractState) GetAddress() *Address { - if x != nil { - return x.Address - } - return nil -} - -func (x *ContractState) GetClass() *Hash { - if x != nil { - return x.Class - } - return nil -} - -func (x *ContractState) GetStorage() *Hash { - if x != nil { - return x.Storage - } - return nil -} - -func (x *ContractState) GetNonce() uint64 { - if x != nil { - return x.Nonce - } - return 0 -} - -// request a range from the contract state tree that matches the given root (block) -// starts at 'start' and ends no more than 'end'. -// the result is (ContractRange+, PatriciaRangeProof)* -type ContractRangeRequest struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - Domain uint32 `protobuf:"varint,1,opt,name=domain,proto3" json:"domain,omitempty"` // volition - StateRoot *Hash `protobuf:"bytes,2,opt,name=state_root,json=stateRoot,proto3" json:"state_root,omitempty"` - Start *Address `protobuf:"bytes,3,opt,name=start,proto3" json:"start,omitempty"` - End *Address `protobuf:"bytes,4,opt,name=end,proto3" json:"end,omitempty"` - ChunksPerProof uint32 `protobuf:"varint,5,opt,name=chunks_per_proof,json=chunksPerProof,proto3" json:"chunks_per_proof,omitempty"` // how many ContractRange items to send before sending a proof -} - -func (x *ContractRangeRequest) Reset() { - *x = ContractRangeRequest{} - if protoimpl.UnsafeEnabled { - mi := &file_p2p_proto_snapshot_proto_msgTypes[3] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *ContractRangeRequest) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*ContractRangeRequest) ProtoMessage() {} - -func (x *ContractRangeRequest) ProtoReflect() protoreflect.Message { - mi := &file_p2p_proto_snapshot_proto_msgTypes[3] - if protoimpl.UnsafeEnabled && x != nil { - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - if ms.LoadMessageInfo() == nil { - ms.StoreMessageInfo(mi) - } - return ms - } - return mi.MessageOf(x) -} - -// Deprecated: Use ContractRangeRequest.ProtoReflect.Descriptor instead. -func (*ContractRangeRequest) Descriptor() ([]byte, []int) { - return file_p2p_proto_snapshot_proto_rawDescGZIP(), []int{3} -} - -func (x *ContractRangeRequest) GetDomain() uint32 { - if x != nil { - return x.Domain - } - return 0 -} - -func (x *ContractRangeRequest) GetStateRoot() *Hash { - if x != nil { - return x.StateRoot - } - return nil -} - -func (x *ContractRangeRequest) GetStart() *Address { - if x != nil { - return x.Start - } - return nil -} - -func (x *ContractRangeRequest) GetEnd() *Address { - if x != nil { - return x.End - } - return nil -} - -func (x *ContractRangeRequest) GetChunksPerProof() uint32 { - if x != nil { - return x.ChunksPerProof - } - return 0 -} - -// stream of leaves in the contracts tree -type ContractRange struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - State []*ContractState `protobuf:"bytes,1,rep,name=state,proto3" json:"state,omitempty"` -} - -func (x *ContractRange) Reset() { - *x = ContractRange{} - if protoimpl.UnsafeEnabled { - mi := &file_p2p_proto_snapshot_proto_msgTypes[4] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *ContractRange) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*ContractRange) ProtoMessage() {} - -func (x *ContractRange) ProtoReflect() protoreflect.Message { - mi := &file_p2p_proto_snapshot_proto_msgTypes[4] - if protoimpl.UnsafeEnabled && x != nil { - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - if ms.LoadMessageInfo() == nil { - ms.StoreMessageInfo(mi) - } - return ms - } - return mi.MessageOf(x) -} - -// Deprecated: Use ContractRange.ProtoReflect.Descriptor instead. -func (*ContractRange) Descriptor() ([]byte, []int) { - return file_p2p_proto_snapshot_proto_rawDescGZIP(), []int{4} -} - -func (x *ContractRange) GetState() []*ContractState { - if x != nil { - return x.State - } - return nil -} - -type ContractRangeResponse struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - Root *Hash `protobuf:"bytes,1,opt,name=root,proto3,oneof" json:"root,omitempty"` // may not appear if Fin is sent to end the whole response - ContractsRoot *Hash `protobuf:"bytes,2,opt,name=contracts_root,json=contractsRoot,proto3,oneof" json:"contracts_root,omitempty"` // may not appear if Fin is sent to end the whole response - ClassesRoot *Hash `protobuf:"bytes,3,opt,name=classes_root,json=classesRoot,proto3,oneof" json:"classes_root,omitempty"` // may not appear if Fin is sent to end the whole response - // Types that are assignable to Responses: - // - // *ContractRangeResponse_Range - // *ContractRangeResponse_Fin - Responses isContractRangeResponse_Responses `protobuf_oneof:"responses"` -} - -func (x *ContractRangeResponse) Reset() { - *x = ContractRangeResponse{} - if protoimpl.UnsafeEnabled { - mi := &file_p2p_proto_snapshot_proto_msgTypes[5] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *ContractRangeResponse) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*ContractRangeResponse) ProtoMessage() {} - -func (x *ContractRangeResponse) ProtoReflect() protoreflect.Message { - mi := &file_p2p_proto_snapshot_proto_msgTypes[5] - if protoimpl.UnsafeEnabled && x != nil { - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - if ms.LoadMessageInfo() == nil { - ms.StoreMessageInfo(mi) - } - return ms - } - return mi.MessageOf(x) -} - -// Deprecated: Use ContractRangeResponse.ProtoReflect.Descriptor instead. -func (*ContractRangeResponse) Descriptor() ([]byte, []int) { - return file_p2p_proto_snapshot_proto_rawDescGZIP(), []int{5} -} - -func (x *ContractRangeResponse) GetRoot() *Hash { - if x != nil { - return x.Root - } - return nil -} - -func (x *ContractRangeResponse) GetContractsRoot() *Hash { - if x != nil { - return x.ContractsRoot - } - return nil -} - -func (x *ContractRangeResponse) GetClassesRoot() *Hash { - if x != nil { - return x.ClassesRoot - } - return nil -} - -func (m *ContractRangeResponse) GetResponses() isContractRangeResponse_Responses { - if m != nil { - return m.Responses - } - return nil -} - -func (x *ContractRangeResponse) GetRange() *ContractRange { - if x, ok := x.GetResponses().(*ContractRangeResponse_Range); ok { - return x.Range - } - return nil -} - -func (x *ContractRangeResponse) GetFin() *Fin { - if x, ok := x.GetResponses().(*ContractRangeResponse_Fin); ok { - return x.Fin - } - return nil -} - -type isContractRangeResponse_Responses interface { - isContractRangeResponse_Responses() -} - -type ContractRangeResponse_Range struct { - Range *ContractRange `protobuf:"bytes,4,opt,name=range,proto3,oneof"` -} - -type ContractRangeResponse_Fin struct { - Fin *Fin `protobuf:"bytes,5,opt,name=fin,proto3,oneof"` -} - -func (*ContractRangeResponse_Range) isContractRangeResponse_Responses() {} - -func (*ContractRangeResponse_Fin) isContractRangeResponse_Responses() {} - -// duplicate of GetContractRange. Can introduce a 'type' instead. -// result is (Classes+, PatriciaRangeProof)* -type ClassRangeRequest struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - Root *Hash `protobuf:"bytes,1,opt,name=root,proto3" json:"root,omitempty"` - Start *Hash `protobuf:"bytes,2,opt,name=start,proto3" json:"start,omitempty"` - End *Hash `protobuf:"bytes,3,opt,name=end,proto3" json:"end,omitempty"` - ChunksPerProof uint32 `protobuf:"varint,4,opt,name=chunks_per_proof,json=chunksPerProof,proto3" json:"chunks_per_proof,omitempty"` -} - -func (x *ClassRangeRequest) Reset() { - *x = ClassRangeRequest{} - if protoimpl.UnsafeEnabled { - mi := &file_p2p_proto_snapshot_proto_msgTypes[6] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *ClassRangeRequest) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*ClassRangeRequest) ProtoMessage() {} - -func (x *ClassRangeRequest) ProtoReflect() protoreflect.Message { - mi := &file_p2p_proto_snapshot_proto_msgTypes[6] - if protoimpl.UnsafeEnabled && x != nil { - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - if ms.LoadMessageInfo() == nil { - ms.StoreMessageInfo(mi) - } - return ms - } - return mi.MessageOf(x) -} - -// Deprecated: Use ClassRangeRequest.ProtoReflect.Descriptor instead. -func (*ClassRangeRequest) Descriptor() ([]byte, []int) { - return file_p2p_proto_snapshot_proto_rawDescGZIP(), []int{6} -} - -func (x *ClassRangeRequest) GetRoot() *Hash { - if x != nil { - return x.Root - } - return nil -} - -func (x *ClassRangeRequest) GetStart() *Hash { - if x != nil { - return x.Start - } - return nil -} - -func (x *ClassRangeRequest) GetEnd() *Hash { - if x != nil { - return x.End - } - return nil -} - -func (x *ClassRangeRequest) GetChunksPerProof() uint32 { - if x != nil { - return x.ChunksPerProof - } - return 0 -} - -type ClassRangeResponse struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - Root *Hash `protobuf:"bytes,1,opt,name=root,proto3,oneof" json:"root,omitempty"` // may not appear if Fin is sent to end the whole response - ContractsRoot *Hash `protobuf:"bytes,2,opt,name=contracts_root,json=contractsRoot,proto3,oneof" json:"contracts_root,omitempty"` // may not appear if Fin is sent to end the whole response - ClassesRoot *Hash `protobuf:"bytes,3,opt,name=classes_root,json=classesRoot,proto3,oneof" json:"classes_root,omitempty"` // may not appear if Fin is sent to end the whole response - // Types that are assignable to Responses: - // - // *ClassRangeResponse_Classes - // *ClassRangeResponse_Fin - Responses isClassRangeResponse_Responses `protobuf_oneof:"responses"` -} - -func (x *ClassRangeResponse) Reset() { - *x = ClassRangeResponse{} - if protoimpl.UnsafeEnabled { - mi := &file_p2p_proto_snapshot_proto_msgTypes[7] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *ClassRangeResponse) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*ClassRangeResponse) ProtoMessage() {} - -func (x *ClassRangeResponse) ProtoReflect() protoreflect.Message { - mi := &file_p2p_proto_snapshot_proto_msgTypes[7] - if protoimpl.UnsafeEnabled && x != nil { - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - if ms.LoadMessageInfo() == nil { - ms.StoreMessageInfo(mi) - } - return ms - } - return mi.MessageOf(x) -} - -// Deprecated: Use ClassRangeResponse.ProtoReflect.Descriptor instead. -func (*ClassRangeResponse) Descriptor() ([]byte, []int) { - return file_p2p_proto_snapshot_proto_rawDescGZIP(), []int{7} -} - -func (x *ClassRangeResponse) GetRoot() *Hash { - if x != nil { - return x.Root - } - return nil -} - -func (x *ClassRangeResponse) GetContractsRoot() *Hash { - if x != nil { - return x.ContractsRoot - } - return nil -} - -func (x *ClassRangeResponse) GetClassesRoot() *Hash { - if x != nil { - return x.ClassesRoot - } - return nil -} - -func (m *ClassRangeResponse) GetResponses() isClassRangeResponse_Responses { - if m != nil { - return m.Responses - } - return nil -} - -func (x *ClassRangeResponse) GetClasses() *Classes { - if x, ok := x.GetResponses().(*ClassRangeResponse_Classes); ok { - return x.Classes - } - return nil -} - -func (x *ClassRangeResponse) GetFin() *Fin { - if x, ok := x.GetResponses().(*ClassRangeResponse_Fin); ok { - return x.Fin - } - return nil -} - -type isClassRangeResponse_Responses interface { - isClassRangeResponse_Responses() -} - -type ClassRangeResponse_Classes struct { - Classes *Classes `protobuf:"bytes,4,opt,name=classes,proto3,oneof"` -} - -type ClassRangeResponse_Fin struct { - Fin *Fin `protobuf:"bytes,5,opt,name=fin,proto3,oneof"` -} - -func (*ClassRangeResponse_Classes) isClassRangeResponse_Responses() {} - -func (*ClassRangeResponse_Fin) isClassRangeResponse_Responses() {} - -// A position in some contract's state tree is identified by the state tree's root and the key in it -type StorageLeafQuery struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - ContractStorageRoot *Hash `protobuf:"bytes,1,opt,name=contract_storage_root,json=contractStorageRoot,proto3" json:"contract_storage_root,omitempty"` - Key *Felt252 `protobuf:"bytes,2,opt,name=key,proto3" json:"key,omitempty"` -} - -func (x *StorageLeafQuery) Reset() { - *x = StorageLeafQuery{} - if protoimpl.UnsafeEnabled { - mi := &file_p2p_proto_snapshot_proto_msgTypes[8] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *StorageLeafQuery) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*StorageLeafQuery) ProtoMessage() {} - -func (x *StorageLeafQuery) ProtoReflect() protoreflect.Message { - mi := &file_p2p_proto_snapshot_proto_msgTypes[8] - if protoimpl.UnsafeEnabled && x != nil { - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - if ms.LoadMessageInfo() == nil { - ms.StoreMessageInfo(mi) - } - return ms - } - return mi.MessageOf(x) -} - -// Deprecated: Use StorageLeafQuery.ProtoReflect.Descriptor instead. -func (*StorageLeafQuery) Descriptor() ([]byte, []int) { - return file_p2p_proto_snapshot_proto_rawDescGZIP(), []int{8} -} - -func (x *StorageLeafQuery) GetContractStorageRoot() *Hash { - if x != nil { - return x.ContractStorageRoot - } - return nil -} - -func (x *StorageLeafQuery) GetKey() *Felt252 { - if x != nil { - return x.Key - } - return nil -} - -type StorageRangeQuery struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - Start *StorageLeafQuery `protobuf:"bytes,1,opt,name=start,proto3" json:"start,omitempty"` - End *StorageLeafQuery `protobuf:"bytes,2,opt,name=end,proto3" json:"end,omitempty"` -} - -func (x *StorageRangeQuery) Reset() { - *x = StorageRangeQuery{} - if protoimpl.UnsafeEnabled { - mi := &file_p2p_proto_snapshot_proto_msgTypes[9] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *StorageRangeQuery) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*StorageRangeQuery) ProtoMessage() {} - -func (x *StorageRangeQuery) ProtoReflect() protoreflect.Message { - mi := &file_p2p_proto_snapshot_proto_msgTypes[9] - if protoimpl.UnsafeEnabled && x != nil { - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - if ms.LoadMessageInfo() == nil { - ms.StoreMessageInfo(mi) - } - return ms - } - return mi.MessageOf(x) -} - -// Deprecated: Use StorageRangeQuery.ProtoReflect.Descriptor instead. -func (*StorageRangeQuery) Descriptor() ([]byte, []int) { - return file_p2p_proto_snapshot_proto_rawDescGZIP(), []int{9} -} - -func (x *StorageRangeQuery) GetStart() *StorageLeafQuery { - if x != nil { - return x.Start - } - return nil -} - -func (x *StorageRangeQuery) GetEnd() *StorageLeafQuery { - if x != nil { - return x.End - } - return nil -} - -// result is (ContractStorageRange+, PatriciaRangeProof)* -type ContractStorageRequest struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - Domain uint32 `protobuf:"varint,1,opt,name=domain,proto3" json:"domain,omitempty"` // volition - StateRoot *Hash `protobuf:"bytes,2,opt,name=state_root,json=stateRoot,proto3" json:"state_root,omitempty"` - Query []*StorageRangeQuery `protobuf:"bytes,3,rep,name=query,proto3" json:"query,omitempty"` -} - -func (x *ContractStorageRequest) Reset() { - *x = ContractStorageRequest{} - if protoimpl.UnsafeEnabled { - mi := &file_p2p_proto_snapshot_proto_msgTypes[10] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *ContractStorageRequest) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*ContractStorageRequest) ProtoMessage() {} - -func (x *ContractStorageRequest) ProtoReflect() protoreflect.Message { - mi := &file_p2p_proto_snapshot_proto_msgTypes[10] - if protoimpl.UnsafeEnabled && x != nil { - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - if ms.LoadMessageInfo() == nil { - ms.StoreMessageInfo(mi) - } - return ms - } - return mi.MessageOf(x) -} - -// Deprecated: Use ContractStorageRequest.ProtoReflect.Descriptor instead. -func (*ContractStorageRequest) Descriptor() ([]byte, []int) { - return file_p2p_proto_snapshot_proto_rawDescGZIP(), []int{10} -} - -func (x *ContractStorageRequest) GetDomain() uint32 { - if x != nil { - return x.Domain - } - return 0 -} - -func (x *ContractStorageRequest) GetStateRoot() *Hash { - if x != nil { - return x.StateRoot - } - return nil -} - -func (x *ContractStorageRequest) GetQuery() []*StorageRangeQuery { - if x != nil { - return x.Query - } - return nil -} - -type ContractStorage struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - KeyValue []*ContractStoredValue `protobuf:"bytes,2,rep,name=keyValue,proto3" json:"keyValue,omitempty"` -} - -func (x *ContractStorage) Reset() { - *x = ContractStorage{} - if protoimpl.UnsafeEnabled { - mi := &file_p2p_proto_snapshot_proto_msgTypes[11] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *ContractStorage) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*ContractStorage) ProtoMessage() {} - -func (x *ContractStorage) ProtoReflect() protoreflect.Message { - mi := &file_p2p_proto_snapshot_proto_msgTypes[11] - if protoimpl.UnsafeEnabled && x != nil { - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - if ms.LoadMessageInfo() == nil { - ms.StoreMessageInfo(mi) - } - return ms - } - return mi.MessageOf(x) -} - -// Deprecated: Use ContractStorage.ProtoReflect.Descriptor instead. -func (*ContractStorage) Descriptor() ([]byte, []int) { - return file_p2p_proto_snapshot_proto_rawDescGZIP(), []int{11} -} - -func (x *ContractStorage) GetKeyValue() []*ContractStoredValue { - if x != nil { - return x.KeyValue - } - return nil -} - -type ContractStorageResponse struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - StateRoot *Hash `protobuf:"bytes,1,opt,name=state_root,json=stateRoot,proto3,oneof" json:"state_root,omitempty"` // may not appear if Fin is sent to end the whole response - // Types that are assignable to Responses: - // - // *ContractStorageResponse_Storage - // *ContractStorageResponse_Fin - Responses isContractStorageResponse_Responses `protobuf_oneof:"responses"` -} - -func (x *ContractStorageResponse) Reset() { - *x = ContractStorageResponse{} - if protoimpl.UnsafeEnabled { - mi := &file_p2p_proto_snapshot_proto_msgTypes[12] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *ContractStorageResponse) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*ContractStorageResponse) ProtoMessage() {} - -func (x *ContractStorageResponse) ProtoReflect() protoreflect.Message { - mi := &file_p2p_proto_snapshot_proto_msgTypes[12] - if protoimpl.UnsafeEnabled && x != nil { - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - if ms.LoadMessageInfo() == nil { - ms.StoreMessageInfo(mi) - } - return ms - } - return mi.MessageOf(x) -} - -// Deprecated: Use ContractStorageResponse.ProtoReflect.Descriptor instead. -func (*ContractStorageResponse) Descriptor() ([]byte, []int) { - return file_p2p_proto_snapshot_proto_rawDescGZIP(), []int{12} -} - -func (x *ContractStorageResponse) GetStateRoot() *Hash { - if x != nil { - return x.StateRoot - } - return nil -} - -func (m *ContractStorageResponse) GetResponses() isContractStorageResponse_Responses { - if m != nil { - return m.Responses - } - return nil -} - -func (x *ContractStorageResponse) GetStorage() *ContractStorage { - if x, ok := x.GetResponses().(*ContractStorageResponse_Storage); ok { - return x.Storage - } - return nil -} - -func (x *ContractStorageResponse) GetFin() *Fin { - if x, ok := x.GetResponses().(*ContractStorageResponse_Fin); ok { - return x.Fin - } - return nil -} - -type isContractStorageResponse_Responses interface { - isContractStorageResponse_Responses() -} - -type ContractStorageResponse_Storage struct { - Storage *ContractStorage `protobuf:"bytes,2,opt,name=storage,proto3,oneof"` -} - -type ContractStorageResponse_Fin struct { - Fin *Fin `protobuf:"bytes,3,opt,name=fin,proto3,oneof"` -} - -func (*ContractStorageResponse_Storage) isContractStorageResponse_Responses() {} - -func (*ContractStorageResponse_Fin) isContractStorageResponse_Responses() {} - -type PatriciaNode_Edge struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - Length uint32 `protobuf:"varint,1,opt,name=length,proto3" json:"length,omitempty"` - Path *Felt252 `protobuf:"bytes,2,opt,name=path,proto3" json:"path,omitempty"` // as bits of left/right - Value *Felt252 `protobuf:"bytes,3,opt,name=value,proto3" json:"value,omitempty"` -} - -func (x *PatriciaNode_Edge) Reset() { - *x = PatriciaNode_Edge{} - if protoimpl.UnsafeEnabled { - mi := &file_p2p_proto_snapshot_proto_msgTypes[13] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *PatriciaNode_Edge) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*PatriciaNode_Edge) ProtoMessage() {} - -func (x *PatriciaNode_Edge) ProtoReflect() protoreflect.Message { - mi := &file_p2p_proto_snapshot_proto_msgTypes[13] - if protoimpl.UnsafeEnabled && x != nil { - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - if ms.LoadMessageInfo() == nil { - ms.StoreMessageInfo(mi) - } - return ms - } - return mi.MessageOf(x) -} - -// Deprecated: Use PatriciaNode_Edge.ProtoReflect.Descriptor instead. -func (*PatriciaNode_Edge) Descriptor() ([]byte, []int) { - return file_p2p_proto_snapshot_proto_rawDescGZIP(), []int{0, 0} -} - -func (x *PatriciaNode_Edge) GetLength() uint32 { - if x != nil { - return x.Length - } - return 0 -} - -func (x *PatriciaNode_Edge) GetPath() *Felt252 { - if x != nil { - return x.Path - } - return nil -} - -func (x *PatriciaNode_Edge) GetValue() *Felt252 { - if x != nil { - return x.Value - } - return nil -} - -type PatriciaNode_Binary struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - Left *Felt252 `protobuf:"bytes,1,opt,name=left,proto3" json:"left,omitempty"` - Right *Felt252 `protobuf:"bytes,2,opt,name=right,proto3" json:"right,omitempty"` -} - -func (x *PatriciaNode_Binary) Reset() { - *x = PatriciaNode_Binary{} - if protoimpl.UnsafeEnabled { - mi := &file_p2p_proto_snapshot_proto_msgTypes[14] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *PatriciaNode_Binary) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*PatriciaNode_Binary) ProtoMessage() {} - -func (x *PatriciaNode_Binary) ProtoReflect() protoreflect.Message { - mi := &file_p2p_proto_snapshot_proto_msgTypes[14] - if protoimpl.UnsafeEnabled && x != nil { - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - if ms.LoadMessageInfo() == nil { - ms.StoreMessageInfo(mi) - } - return ms - } - return mi.MessageOf(x) -} - -// Deprecated: Use PatriciaNode_Binary.ProtoReflect.Descriptor instead. -func (*PatriciaNode_Binary) Descriptor() ([]byte, []int) { - return file_p2p_proto_snapshot_proto_rawDescGZIP(), []int{0, 1} -} - -func (x *PatriciaNode_Binary) GetLeft() *Felt252 { - if x != nil { - return x.Left - } - return nil -} - -func (x *PatriciaNode_Binary) GetRight() *Felt252 { - if x != nil { - return x.Right - } - return nil -} - -var File_p2p_proto_snapshot_proto protoreflect.FileDescriptor - -var file_p2p_proto_snapshot_proto_rawDesc = []byte{ - 0x0a, 0x18, 0x70, 0x32, 0x70, 0x2f, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2f, 0x73, 0x6e, 0x61, 0x70, - 0x73, 0x68, 0x6f, 0x74, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x1a, 0x16, 0x70, 0x32, 0x70, 0x2f, - 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2f, 0x63, 0x6f, 0x6d, 0x6d, 0x6f, 0x6e, 0x2e, 0x70, 0x72, 0x6f, - 0x74, 0x6f, 0x1a, 0x15, 0x70, 0x32, 0x70, 0x2f, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2f, 0x73, 0x74, - 0x61, 0x74, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x22, 0x96, 0x02, 0x0a, 0x0c, 0x50, 0x61, - 0x74, 0x72, 0x69, 0x63, 0x69, 0x61, 0x4e, 0x6f, 0x64, 0x65, 0x12, 0x28, 0x0a, 0x04, 0x65, 0x64, - 0x67, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x12, 0x2e, 0x50, 0x61, 0x74, 0x72, 0x69, - 0x63, 0x69, 0x61, 0x4e, 0x6f, 0x64, 0x65, 0x2e, 0x45, 0x64, 0x67, 0x65, 0x48, 0x00, 0x52, 0x04, - 0x65, 0x64, 0x67, 0x65, 0x12, 0x2e, 0x0a, 0x06, 0x62, 0x69, 0x6e, 0x61, 0x72, 0x79, 0x18, 0x02, - 0x20, 0x01, 0x28, 0x0b, 0x32, 0x14, 0x2e, 0x50, 0x61, 0x74, 0x72, 0x69, 0x63, 0x69, 0x61, 0x4e, - 0x6f, 0x64, 0x65, 0x2e, 0x42, 0x69, 0x6e, 0x61, 0x72, 0x79, 0x48, 0x00, 0x52, 0x06, 0x62, 0x69, - 0x6e, 0x61, 0x72, 0x79, 0x1a, 0x5c, 0x0a, 0x04, 0x45, 0x64, 0x67, 0x65, 0x12, 0x16, 0x0a, 0x06, - 0x6c, 0x65, 0x6e, 0x67, 0x74, 0x68, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0d, 0x52, 0x06, 0x6c, 0x65, - 0x6e, 0x67, 0x74, 0x68, 0x12, 0x1c, 0x0a, 0x04, 0x70, 0x61, 0x74, 0x68, 0x18, 0x02, 0x20, 0x01, - 0x28, 0x0b, 0x32, 0x08, 0x2e, 0x46, 0x65, 0x6c, 0x74, 0x32, 0x35, 0x32, 0x52, 0x04, 0x70, 0x61, - 0x74, 0x68, 0x12, 0x1e, 0x0a, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x18, 0x03, 0x20, 0x01, 0x28, - 0x0b, 0x32, 0x08, 0x2e, 0x46, 0x65, 0x6c, 0x74, 0x32, 0x35, 0x32, 0x52, 0x05, 0x76, 0x61, 0x6c, - 0x75, 0x65, 0x1a, 0x46, 0x0a, 0x06, 0x42, 0x69, 0x6e, 0x61, 0x72, 0x79, 0x12, 0x1c, 0x0a, 0x04, - 0x6c, 0x65, 0x66, 0x74, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x08, 0x2e, 0x46, 0x65, 0x6c, - 0x74, 0x32, 0x35, 0x32, 0x52, 0x04, 0x6c, 0x65, 0x66, 0x74, 0x12, 0x1e, 0x0a, 0x05, 0x72, 0x69, - 0x67, 0x68, 0x74, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x08, 0x2e, 0x46, 0x65, 0x6c, 0x74, - 0x32, 0x35, 0x32, 0x52, 0x05, 0x72, 0x69, 0x67, 0x68, 0x74, 0x42, 0x06, 0x0a, 0x04, 0x6e, 0x6f, - 0x64, 0x65, 0x22, 0x39, 0x0a, 0x12, 0x50, 0x61, 0x74, 0x72, 0x69, 0x63, 0x69, 0x61, 0x52, 0x61, - 0x6e, 0x67, 0x65, 0x50, 0x72, 0x6f, 0x6f, 0x66, 0x12, 0x23, 0x0a, 0x05, 0x6e, 0x6f, 0x64, 0x65, - 0x73, 0x18, 0x01, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x0d, 0x2e, 0x50, 0x61, 0x74, 0x72, 0x69, 0x63, - 0x69, 0x61, 0x4e, 0x6f, 0x64, 0x65, 0x52, 0x05, 0x6e, 0x6f, 0x64, 0x65, 0x73, 0x22, 0x87, 0x01, - 0x0a, 0x0d, 0x43, 0x6f, 0x6e, 0x74, 0x72, 0x61, 0x63, 0x74, 0x53, 0x74, 0x61, 0x74, 0x65, 0x12, - 0x22, 0x0a, 0x07, 0x61, 0x64, 0x64, 0x72, 0x65, 0x73, 0x73, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, - 0x32, 0x08, 0x2e, 0x41, 0x64, 0x64, 0x72, 0x65, 0x73, 0x73, 0x52, 0x07, 0x61, 0x64, 0x64, 0x72, - 0x65, 0x73, 0x73, 0x12, 0x1b, 0x0a, 0x05, 0x63, 0x6c, 0x61, 0x73, 0x73, 0x18, 0x02, 0x20, 0x01, - 0x28, 0x0b, 0x32, 0x05, 0x2e, 0x48, 0x61, 0x73, 0x68, 0x52, 0x05, 0x63, 0x6c, 0x61, 0x73, 0x73, - 0x12, 0x1f, 0x0a, 0x07, 0x73, 0x74, 0x6f, 0x72, 0x61, 0x67, 0x65, 0x18, 0x03, 0x20, 0x01, 0x28, - 0x0b, 0x32, 0x05, 0x2e, 0x48, 0x61, 0x73, 0x68, 0x52, 0x07, 0x73, 0x74, 0x6f, 0x72, 0x61, 0x67, - 0x65, 0x12, 0x14, 0x0a, 0x05, 0x6e, 0x6f, 0x6e, 0x63, 0x65, 0x18, 0x04, 0x20, 0x01, 0x28, 0x04, - 0x52, 0x05, 0x6e, 0x6f, 0x6e, 0x63, 0x65, 0x22, 0xba, 0x01, 0x0a, 0x14, 0x43, 0x6f, 0x6e, 0x74, - 0x72, 0x61, 0x63, 0x74, 0x52, 0x61, 0x6e, 0x67, 0x65, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, - 0x12, 0x16, 0x0a, 0x06, 0x64, 0x6f, 0x6d, 0x61, 0x69, 0x6e, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0d, - 0x52, 0x06, 0x64, 0x6f, 0x6d, 0x61, 0x69, 0x6e, 0x12, 0x24, 0x0a, 0x0a, 0x73, 0x74, 0x61, 0x74, - 0x65, 0x5f, 0x72, 0x6f, 0x6f, 0x74, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x05, 0x2e, 0x48, - 0x61, 0x73, 0x68, 0x52, 0x09, 0x73, 0x74, 0x61, 0x74, 0x65, 0x52, 0x6f, 0x6f, 0x74, 0x12, 0x1e, - 0x0a, 0x05, 0x73, 0x74, 0x61, 0x72, 0x74, 0x18, 0x03, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x08, 0x2e, - 0x41, 0x64, 0x64, 0x72, 0x65, 0x73, 0x73, 0x52, 0x05, 0x73, 0x74, 0x61, 0x72, 0x74, 0x12, 0x1a, - 0x0a, 0x03, 0x65, 0x6e, 0x64, 0x18, 0x04, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x08, 0x2e, 0x41, 0x64, - 0x64, 0x72, 0x65, 0x73, 0x73, 0x52, 0x03, 0x65, 0x6e, 0x64, 0x12, 0x28, 0x0a, 0x10, 0x63, 0x68, - 0x75, 0x6e, 0x6b, 0x73, 0x5f, 0x70, 0x65, 0x72, 0x5f, 0x70, 0x72, 0x6f, 0x6f, 0x66, 0x18, 0x05, - 0x20, 0x01, 0x28, 0x0d, 0x52, 0x0e, 0x63, 0x68, 0x75, 0x6e, 0x6b, 0x73, 0x50, 0x65, 0x72, 0x50, - 0x72, 0x6f, 0x6f, 0x66, 0x22, 0x35, 0x0a, 0x0d, 0x43, 0x6f, 0x6e, 0x74, 0x72, 0x61, 0x63, 0x74, - 0x52, 0x61, 0x6e, 0x67, 0x65, 0x12, 0x24, 0x0a, 0x05, 0x73, 0x74, 0x61, 0x74, 0x65, 0x18, 0x01, - 0x20, 0x03, 0x28, 0x0b, 0x32, 0x0e, 0x2e, 0x43, 0x6f, 0x6e, 0x74, 0x72, 0x61, 0x63, 0x74, 0x53, - 0x74, 0x61, 0x74, 0x65, 0x52, 0x05, 0x73, 0x74, 0x61, 0x74, 0x65, 0x22, 0x95, 0x02, 0x0a, 0x15, - 0x43, 0x6f, 0x6e, 0x74, 0x72, 0x61, 0x63, 0x74, 0x52, 0x61, 0x6e, 0x67, 0x65, 0x52, 0x65, 0x73, - 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x1e, 0x0a, 0x04, 0x72, 0x6f, 0x6f, 0x74, 0x18, 0x01, 0x20, - 0x01, 0x28, 0x0b, 0x32, 0x05, 0x2e, 0x48, 0x61, 0x73, 0x68, 0x48, 0x01, 0x52, 0x04, 0x72, 0x6f, - 0x6f, 0x74, 0x88, 0x01, 0x01, 0x12, 0x31, 0x0a, 0x0e, 0x63, 0x6f, 0x6e, 0x74, 0x72, 0x61, 0x63, - 0x74, 0x73, 0x5f, 0x72, 0x6f, 0x6f, 0x74, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x05, 0x2e, - 0x48, 0x61, 0x73, 0x68, 0x48, 0x02, 0x52, 0x0d, 0x63, 0x6f, 0x6e, 0x74, 0x72, 0x61, 0x63, 0x74, - 0x73, 0x52, 0x6f, 0x6f, 0x74, 0x88, 0x01, 0x01, 0x12, 0x2d, 0x0a, 0x0c, 0x63, 0x6c, 0x61, 0x73, - 0x73, 0x65, 0x73, 0x5f, 0x72, 0x6f, 0x6f, 0x74, 0x18, 0x03, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x05, - 0x2e, 0x48, 0x61, 0x73, 0x68, 0x48, 0x03, 0x52, 0x0b, 0x63, 0x6c, 0x61, 0x73, 0x73, 0x65, 0x73, - 0x52, 0x6f, 0x6f, 0x74, 0x88, 0x01, 0x01, 0x12, 0x26, 0x0a, 0x05, 0x72, 0x61, 0x6e, 0x67, 0x65, - 0x18, 0x04, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x0e, 0x2e, 0x43, 0x6f, 0x6e, 0x74, 0x72, 0x61, 0x63, - 0x74, 0x52, 0x61, 0x6e, 0x67, 0x65, 0x48, 0x00, 0x52, 0x05, 0x72, 0x61, 0x6e, 0x67, 0x65, 0x12, - 0x18, 0x0a, 0x03, 0x66, 0x69, 0x6e, 0x18, 0x05, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x04, 0x2e, 0x46, - 0x69, 0x6e, 0x48, 0x00, 0x52, 0x03, 0x66, 0x69, 0x6e, 0x42, 0x0b, 0x0a, 0x09, 0x72, 0x65, 0x73, - 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x73, 0x42, 0x07, 0x0a, 0x05, 0x5f, 0x72, 0x6f, 0x6f, 0x74, 0x42, - 0x11, 0x0a, 0x0f, 0x5f, 0x63, 0x6f, 0x6e, 0x74, 0x72, 0x61, 0x63, 0x74, 0x73, 0x5f, 0x72, 0x6f, - 0x6f, 0x74, 0x42, 0x0f, 0x0a, 0x0d, 0x5f, 0x63, 0x6c, 0x61, 0x73, 0x73, 0x65, 0x73, 0x5f, 0x72, - 0x6f, 0x6f, 0x74, 0x22, 0x8e, 0x01, 0x0a, 0x11, 0x43, 0x6c, 0x61, 0x73, 0x73, 0x52, 0x61, 0x6e, - 0x67, 0x65, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x19, 0x0a, 0x04, 0x72, 0x6f, 0x6f, - 0x74, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x05, 0x2e, 0x48, 0x61, 0x73, 0x68, 0x52, 0x04, - 0x72, 0x6f, 0x6f, 0x74, 0x12, 0x1b, 0x0a, 0x05, 0x73, 0x74, 0x61, 0x72, 0x74, 0x18, 0x02, 0x20, - 0x01, 0x28, 0x0b, 0x32, 0x05, 0x2e, 0x48, 0x61, 0x73, 0x68, 0x52, 0x05, 0x73, 0x74, 0x61, 0x72, - 0x74, 0x12, 0x17, 0x0a, 0x03, 0x65, 0x6e, 0x64, 0x18, 0x03, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x05, - 0x2e, 0x48, 0x61, 0x73, 0x68, 0x52, 0x03, 0x65, 0x6e, 0x64, 0x12, 0x28, 0x0a, 0x10, 0x63, 0x68, - 0x75, 0x6e, 0x6b, 0x73, 0x5f, 0x70, 0x65, 0x72, 0x5f, 0x70, 0x72, 0x6f, 0x6f, 0x66, 0x18, 0x04, - 0x20, 0x01, 0x28, 0x0d, 0x52, 0x0e, 0x63, 0x68, 0x75, 0x6e, 0x6b, 0x73, 0x50, 0x65, 0x72, 0x50, - 0x72, 0x6f, 0x6f, 0x66, 0x22, 0x90, 0x02, 0x0a, 0x12, 0x43, 0x6c, 0x61, 0x73, 0x73, 0x52, 0x61, - 0x6e, 0x67, 0x65, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x1e, 0x0a, 0x04, 0x72, - 0x6f, 0x6f, 0x74, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x05, 0x2e, 0x48, 0x61, 0x73, 0x68, - 0x48, 0x01, 0x52, 0x04, 0x72, 0x6f, 0x6f, 0x74, 0x88, 0x01, 0x01, 0x12, 0x31, 0x0a, 0x0e, 0x63, - 0x6f, 0x6e, 0x74, 0x72, 0x61, 0x63, 0x74, 0x73, 0x5f, 0x72, 0x6f, 0x6f, 0x74, 0x18, 0x02, 0x20, - 0x01, 0x28, 0x0b, 0x32, 0x05, 0x2e, 0x48, 0x61, 0x73, 0x68, 0x48, 0x02, 0x52, 0x0d, 0x63, 0x6f, - 0x6e, 0x74, 0x72, 0x61, 0x63, 0x74, 0x73, 0x52, 0x6f, 0x6f, 0x74, 0x88, 0x01, 0x01, 0x12, 0x2d, - 0x0a, 0x0c, 0x63, 0x6c, 0x61, 0x73, 0x73, 0x65, 0x73, 0x5f, 0x72, 0x6f, 0x6f, 0x74, 0x18, 0x03, - 0x20, 0x01, 0x28, 0x0b, 0x32, 0x05, 0x2e, 0x48, 0x61, 0x73, 0x68, 0x48, 0x03, 0x52, 0x0b, 0x63, - 0x6c, 0x61, 0x73, 0x73, 0x65, 0x73, 0x52, 0x6f, 0x6f, 0x74, 0x88, 0x01, 0x01, 0x12, 0x24, 0x0a, - 0x07, 0x63, 0x6c, 0x61, 0x73, 0x73, 0x65, 0x73, 0x18, 0x04, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x08, - 0x2e, 0x43, 0x6c, 0x61, 0x73, 0x73, 0x65, 0x73, 0x48, 0x00, 0x52, 0x07, 0x63, 0x6c, 0x61, 0x73, - 0x73, 0x65, 0x73, 0x12, 0x18, 0x0a, 0x03, 0x66, 0x69, 0x6e, 0x18, 0x05, 0x20, 0x01, 0x28, 0x0b, - 0x32, 0x04, 0x2e, 0x46, 0x69, 0x6e, 0x48, 0x00, 0x52, 0x03, 0x66, 0x69, 0x6e, 0x42, 0x0b, 0x0a, - 0x09, 0x72, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x73, 0x42, 0x07, 0x0a, 0x05, 0x5f, 0x72, - 0x6f, 0x6f, 0x74, 0x42, 0x11, 0x0a, 0x0f, 0x5f, 0x63, 0x6f, 0x6e, 0x74, 0x72, 0x61, 0x63, 0x74, - 0x73, 0x5f, 0x72, 0x6f, 0x6f, 0x74, 0x42, 0x0f, 0x0a, 0x0d, 0x5f, 0x63, 0x6c, 0x61, 0x73, 0x73, - 0x65, 0x73, 0x5f, 0x72, 0x6f, 0x6f, 0x74, 0x22, 0x69, 0x0a, 0x10, 0x53, 0x74, 0x6f, 0x72, 0x61, - 0x67, 0x65, 0x4c, 0x65, 0x61, 0x66, 0x51, 0x75, 0x65, 0x72, 0x79, 0x12, 0x39, 0x0a, 0x15, 0x63, - 0x6f, 0x6e, 0x74, 0x72, 0x61, 0x63, 0x74, 0x5f, 0x73, 0x74, 0x6f, 0x72, 0x61, 0x67, 0x65, 0x5f, - 0x72, 0x6f, 0x6f, 0x74, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x05, 0x2e, 0x48, 0x61, 0x73, - 0x68, 0x52, 0x13, 0x63, 0x6f, 0x6e, 0x74, 0x72, 0x61, 0x63, 0x74, 0x53, 0x74, 0x6f, 0x72, 0x61, - 0x67, 0x65, 0x52, 0x6f, 0x6f, 0x74, 0x12, 0x1a, 0x0a, 0x03, 0x6b, 0x65, 0x79, 0x18, 0x02, 0x20, - 0x01, 0x28, 0x0b, 0x32, 0x08, 0x2e, 0x46, 0x65, 0x6c, 0x74, 0x32, 0x35, 0x32, 0x52, 0x03, 0x6b, - 0x65, 0x79, 0x22, 0x61, 0x0a, 0x11, 0x53, 0x74, 0x6f, 0x72, 0x61, 0x67, 0x65, 0x52, 0x61, 0x6e, - 0x67, 0x65, 0x51, 0x75, 0x65, 0x72, 0x79, 0x12, 0x27, 0x0a, 0x05, 0x73, 0x74, 0x61, 0x72, 0x74, - 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x11, 0x2e, 0x53, 0x74, 0x6f, 0x72, 0x61, 0x67, 0x65, - 0x4c, 0x65, 0x61, 0x66, 0x51, 0x75, 0x65, 0x72, 0x79, 0x52, 0x05, 0x73, 0x74, 0x61, 0x72, 0x74, - 0x12, 0x23, 0x0a, 0x03, 0x65, 0x6e, 0x64, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x11, 0x2e, - 0x53, 0x74, 0x6f, 0x72, 0x61, 0x67, 0x65, 0x4c, 0x65, 0x61, 0x66, 0x51, 0x75, 0x65, 0x72, 0x79, - 0x52, 0x03, 0x65, 0x6e, 0x64, 0x22, 0x80, 0x01, 0x0a, 0x16, 0x43, 0x6f, 0x6e, 0x74, 0x72, 0x61, - 0x63, 0x74, 0x53, 0x74, 0x6f, 0x72, 0x61, 0x67, 0x65, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, - 0x12, 0x16, 0x0a, 0x06, 0x64, 0x6f, 0x6d, 0x61, 0x69, 0x6e, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0d, - 0x52, 0x06, 0x64, 0x6f, 0x6d, 0x61, 0x69, 0x6e, 0x12, 0x24, 0x0a, 0x0a, 0x73, 0x74, 0x61, 0x74, - 0x65, 0x5f, 0x72, 0x6f, 0x6f, 0x74, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x05, 0x2e, 0x48, - 0x61, 0x73, 0x68, 0x52, 0x09, 0x73, 0x74, 0x61, 0x74, 0x65, 0x52, 0x6f, 0x6f, 0x74, 0x12, 0x28, - 0x0a, 0x05, 0x71, 0x75, 0x65, 0x72, 0x79, 0x18, 0x03, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x12, 0x2e, - 0x53, 0x74, 0x6f, 0x72, 0x61, 0x67, 0x65, 0x52, 0x61, 0x6e, 0x67, 0x65, 0x51, 0x75, 0x65, 0x72, - 0x79, 0x52, 0x05, 0x71, 0x75, 0x65, 0x72, 0x79, 0x22, 0x43, 0x0a, 0x0f, 0x43, 0x6f, 0x6e, 0x74, - 0x72, 0x61, 0x63, 0x74, 0x53, 0x74, 0x6f, 0x72, 0x61, 0x67, 0x65, 0x12, 0x30, 0x0a, 0x08, 0x6b, - 0x65, 0x79, 0x56, 0x61, 0x6c, 0x75, 0x65, 0x18, 0x02, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x14, 0x2e, - 0x43, 0x6f, 0x6e, 0x74, 0x72, 0x61, 0x63, 0x74, 0x53, 0x74, 0x6f, 0x72, 0x65, 0x64, 0x56, 0x61, - 0x6c, 0x75, 0x65, 0x52, 0x08, 0x6b, 0x65, 0x79, 0x56, 0x61, 0x6c, 0x75, 0x65, 0x22, 0xa8, 0x01, - 0x0a, 0x17, 0x43, 0x6f, 0x6e, 0x74, 0x72, 0x61, 0x63, 0x74, 0x53, 0x74, 0x6f, 0x72, 0x61, 0x67, - 0x65, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x29, 0x0a, 0x0a, 0x73, 0x74, 0x61, - 0x74, 0x65, 0x5f, 0x72, 0x6f, 0x6f, 0x74, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x05, 0x2e, - 0x48, 0x61, 0x73, 0x68, 0x48, 0x01, 0x52, 0x09, 0x73, 0x74, 0x61, 0x74, 0x65, 0x52, 0x6f, 0x6f, - 0x74, 0x88, 0x01, 0x01, 0x12, 0x2c, 0x0a, 0x07, 0x73, 0x74, 0x6f, 0x72, 0x61, 0x67, 0x65, 0x18, - 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x10, 0x2e, 0x43, 0x6f, 0x6e, 0x74, 0x72, 0x61, 0x63, 0x74, - 0x53, 0x74, 0x6f, 0x72, 0x61, 0x67, 0x65, 0x48, 0x00, 0x52, 0x07, 0x73, 0x74, 0x6f, 0x72, 0x61, - 0x67, 0x65, 0x12, 0x18, 0x0a, 0x03, 0x66, 0x69, 0x6e, 0x18, 0x03, 0x20, 0x01, 0x28, 0x0b, 0x32, - 0x04, 0x2e, 0x46, 0x69, 0x6e, 0x48, 0x00, 0x52, 0x03, 0x66, 0x69, 0x6e, 0x42, 0x0b, 0x0a, 0x09, - 0x72, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x73, 0x42, 0x0d, 0x0a, 0x0b, 0x5f, 0x73, 0x74, - 0x61, 0x74, 0x65, 0x5f, 0x72, 0x6f, 0x6f, 0x74, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, -} - -var ( - file_p2p_proto_snapshot_proto_rawDescOnce sync.Once - file_p2p_proto_snapshot_proto_rawDescData = file_p2p_proto_snapshot_proto_rawDesc -) - -func file_p2p_proto_snapshot_proto_rawDescGZIP() []byte { - file_p2p_proto_snapshot_proto_rawDescOnce.Do(func() { - file_p2p_proto_snapshot_proto_rawDescData = protoimpl.X.CompressGZIP(file_p2p_proto_snapshot_proto_rawDescData) - }) - return file_p2p_proto_snapshot_proto_rawDescData -} - -var ( - file_p2p_proto_snapshot_proto_msgTypes = make([]protoimpl.MessageInfo, 15) - file_p2p_proto_snapshot_proto_goTypes = []interface{}{ - (*PatriciaNode)(nil), // 0: PatriciaNode - (*PatriciaRangeProof)(nil), // 1: PatriciaRangeProof - (*ContractState)(nil), // 2: ContractState - (*ContractRangeRequest)(nil), // 3: ContractRangeRequest - (*ContractRange)(nil), // 4: ContractRange - (*ContractRangeResponse)(nil), // 5: ContractRangeResponse - (*ClassRangeRequest)(nil), // 6: ClassRangeRequest - (*ClassRangeResponse)(nil), // 7: ClassRangeResponse - (*StorageLeafQuery)(nil), // 8: StorageLeafQuery - (*StorageRangeQuery)(nil), // 9: StorageRangeQuery - (*ContractStorageRequest)(nil), // 10: ContractStorageRequest - (*ContractStorage)(nil), // 11: ContractStorage - (*ContractStorageResponse)(nil), // 12: ContractStorageResponse - (*PatriciaNode_Edge)(nil), // 13: PatriciaNode.Edge - (*PatriciaNode_Binary)(nil), // 14: PatriciaNode.Binary - (*Address)(nil), // 15: Address - (*Hash)(nil), // 16: Hash - (*Fin)(nil), // 17: Fin - (*Classes)(nil), // 18: Classes - (*Felt252)(nil), // 19: Felt252 - (*ContractStoredValue)(nil), // 20: ContractStoredValue - } -) - -var file_p2p_proto_snapshot_proto_depIdxs = []int32{ - 13, // 0: PatriciaNode.edge:type_name -> PatriciaNode.Edge - 14, // 1: PatriciaNode.binary:type_name -> PatriciaNode.Binary - 0, // 2: PatriciaRangeProof.nodes:type_name -> PatriciaNode - 15, // 3: ContractState.address:type_name -> Address - 16, // 4: ContractState.class:type_name -> Hash - 16, // 5: ContractState.storage:type_name -> Hash - 16, // 6: ContractRangeRequest.state_root:type_name -> Hash - 15, // 7: ContractRangeRequest.start:type_name -> Address - 15, // 8: ContractRangeRequest.end:type_name -> Address - 2, // 9: ContractRange.state:type_name -> ContractState - 16, // 10: ContractRangeResponse.root:type_name -> Hash - 16, // 11: ContractRangeResponse.contracts_root:type_name -> Hash - 16, // 12: ContractRangeResponse.classes_root:type_name -> Hash - 4, // 13: ContractRangeResponse.range:type_name -> ContractRange - 17, // 14: ContractRangeResponse.fin:type_name -> Fin - 16, // 15: ClassRangeRequest.root:type_name -> Hash - 16, // 16: ClassRangeRequest.start:type_name -> Hash - 16, // 17: ClassRangeRequest.end:type_name -> Hash - 16, // 18: ClassRangeResponse.root:type_name -> Hash - 16, // 19: ClassRangeResponse.contracts_root:type_name -> Hash - 16, // 20: ClassRangeResponse.classes_root:type_name -> Hash - 18, // 21: ClassRangeResponse.classes:type_name -> Classes - 17, // 22: ClassRangeResponse.fin:type_name -> Fin - 16, // 23: StorageLeafQuery.contract_storage_root:type_name -> Hash - 19, // 24: StorageLeafQuery.key:type_name -> Felt252 - 8, // 25: StorageRangeQuery.start:type_name -> StorageLeafQuery - 8, // 26: StorageRangeQuery.end:type_name -> StorageLeafQuery - 16, // 27: ContractStorageRequest.state_root:type_name -> Hash - 9, // 28: ContractStorageRequest.query:type_name -> StorageRangeQuery - 20, // 29: ContractStorage.keyValue:type_name -> ContractStoredValue - 16, // 30: ContractStorageResponse.state_root:type_name -> Hash - 11, // 31: ContractStorageResponse.storage:type_name -> ContractStorage - 17, // 32: ContractStorageResponse.fin:type_name -> Fin - 19, // 33: PatriciaNode.Edge.path:type_name -> Felt252 - 19, // 34: PatriciaNode.Edge.value:type_name -> Felt252 - 19, // 35: PatriciaNode.Binary.left:type_name -> Felt252 - 19, // 36: PatriciaNode.Binary.right:type_name -> Felt252 - 37, // [37:37] is the sub-list for method output_type - 37, // [37:37] is the sub-list for method input_type - 37, // [37:37] is the sub-list for extension type_name - 37, // [37:37] is the sub-list for extension extendee - 0, // [0:37] is the sub-list for field type_name -} - -func init() { file_p2p_proto_snapshot_proto_init() } -func file_p2p_proto_snapshot_proto_init() { - if File_p2p_proto_snapshot_proto != nil { - return - } - file_p2p_proto_common_proto_init() - file_p2p_proto_state_proto_init() - if !protoimpl.UnsafeEnabled { - file_p2p_proto_snapshot_proto_msgTypes[0].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*PatriciaNode); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_p2p_proto_snapshot_proto_msgTypes[1].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*PatriciaRangeProof); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_p2p_proto_snapshot_proto_msgTypes[2].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*ContractState); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_p2p_proto_snapshot_proto_msgTypes[3].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*ContractRangeRequest); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_p2p_proto_snapshot_proto_msgTypes[4].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*ContractRange); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_p2p_proto_snapshot_proto_msgTypes[5].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*ContractRangeResponse); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_p2p_proto_snapshot_proto_msgTypes[6].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*ClassRangeRequest); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_p2p_proto_snapshot_proto_msgTypes[7].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*ClassRangeResponse); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_p2p_proto_snapshot_proto_msgTypes[8].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*StorageLeafQuery); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_p2p_proto_snapshot_proto_msgTypes[9].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*StorageRangeQuery); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_p2p_proto_snapshot_proto_msgTypes[10].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*ContractStorageRequest); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_p2p_proto_snapshot_proto_msgTypes[11].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*ContractStorage); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_p2p_proto_snapshot_proto_msgTypes[12].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*ContractStorageResponse); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_p2p_proto_snapshot_proto_msgTypes[13].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*PatriciaNode_Edge); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_p2p_proto_snapshot_proto_msgTypes[14].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*PatriciaNode_Binary); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - } - file_p2p_proto_snapshot_proto_msgTypes[0].OneofWrappers = []interface{}{ - (*PatriciaNode_Edge_)(nil), - (*PatriciaNode_Binary_)(nil), - } - file_p2p_proto_snapshot_proto_msgTypes[5].OneofWrappers = []interface{}{ - (*ContractRangeResponse_Range)(nil), - (*ContractRangeResponse_Fin)(nil), - } - file_p2p_proto_snapshot_proto_msgTypes[7].OneofWrappers = []interface{}{ - (*ClassRangeResponse_Classes)(nil), - (*ClassRangeResponse_Fin)(nil), - } - file_p2p_proto_snapshot_proto_msgTypes[12].OneofWrappers = []interface{}{ - (*ContractStorageResponse_Storage)(nil), - (*ContractStorageResponse_Fin)(nil), - } - type x struct{} - out := protoimpl.TypeBuilder{ - File: protoimpl.DescBuilder{ - GoPackagePath: reflect.TypeOf(x{}).PkgPath(), - RawDescriptor: file_p2p_proto_snapshot_proto_rawDesc, - NumEnums: 0, - NumMessages: 15, - NumExtensions: 0, - NumServices: 0, - }, - GoTypes: file_p2p_proto_snapshot_proto_goTypes, - DependencyIndexes: file_p2p_proto_snapshot_proto_depIdxs, - MessageInfos: file_p2p_proto_snapshot_proto_msgTypes, - }.Build() - File_p2p_proto_snapshot_proto = out.File - file_p2p_proto_snapshot_proto_rawDesc = nil - file_p2p_proto_snapshot_proto_goTypes = nil - file_p2p_proto_snapshot_proto_depIdxs = nil -} diff --git a/p2p/starknet/spec/state.pb.go b/p2p/starknet/spec/state.pb.go index c4540e1034..6e08325842 100644 --- a/p2p/starknet/spec/state.pb.go +++ b/p2p/starknet/spec/state.pb.go @@ -1,7 +1,7 @@ // Code generated by protoc-gen-go. DO NOT EDIT. // versions: -// protoc-gen-go v1.31.0 -// protoc v4.24.4 +// protoc-gen-go v1.26.0 +// protoc v4.25.1 // source: p2p/proto/state.proto package spec @@ -77,19 +77,21 @@ func (x *ContractStoredValue) GetValue() *Felt252 { return nil } -type StateDiff struct { +type ContractDiff struct { state protoimpl.MessageState sizeCache protoimpl.SizeCache unknownFields protoimpl.UnknownFields - Domain uint32 `protobuf:"varint,1,opt,name=domain,proto3" json:"domain,omitempty"` // volition state domain - ContractDiffs []*StateDiff_ContractDiff `protobuf:"bytes,2,rep,name=contract_diffs,json=contractDiffs,proto3" json:"contract_diffs,omitempty"` - ReplacedClasses []*StateDiff_ContractAddrToClassHash `protobuf:"bytes,3,rep,name=replaced_classes,json=replacedClasses,proto3" json:"replaced_classes,omitempty"` - DeployedContracts []*StateDiff_ContractAddrToClassHash `protobuf:"bytes,4,rep,name=deployed_contracts,json=deployedContracts,proto3" json:"deployed_contracts,omitempty"` + Address *Address `protobuf:"bytes,1,opt,name=address,proto3" json:"address,omitempty"` + Nonce *Felt252 `protobuf:"bytes,2,opt,name=nonce,proto3,oneof" json:"nonce,omitempty"` // Present only if the nonce was updated + ClassHash *Hash `protobuf:"bytes,3,opt,name=class_hash,json=classHash,proto3,oneof" json:"class_hash,omitempty"` // Present only if the contract was deployed or replaced in this block. + IsReplaced *bool `protobuf:"varint,4,opt,name=is_replaced,json=isReplaced,proto3,oneof" json:"is_replaced,omitempty"` // Present only if the contract was deployed or replaced, in order to determine whether the contract was deployed or replaced. + Values []*ContractStoredValue `protobuf:"bytes,5,rep,name=values,proto3" json:"values,omitempty"` + Domain uint32 `protobuf:"varint,6,opt,name=domain,proto3" json:"domain,omitempty"` // volition state domain } -func (x *StateDiff) Reset() { - *x = StateDiff{} +func (x *ContractDiff) Reset() { + *x = ContractDiff{} if protoimpl.UnsafeEnabled { mi := &file_p2p_proto_state_proto_msgTypes[1] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) @@ -97,13 +99,13 @@ func (x *StateDiff) Reset() { } } -func (x *StateDiff) String() string { +func (x *ContractDiff) String() string { return protoimpl.X.MessageStringOf(x) } -func (*StateDiff) ProtoMessage() {} +func (*ContractDiff) ProtoMessage() {} -func (x *StateDiff) ProtoReflect() protoreflect.Message { +func (x *ContractDiff) ProtoReflect() protoreflect.Message { mi := &file_p2p_proto_state_proto_msgTypes[1] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) @@ -115,320 +117,78 @@ func (x *StateDiff) ProtoReflect() protoreflect.Message { return mi.MessageOf(x) } -// Deprecated: Use StateDiff.ProtoReflect.Descriptor instead. -func (*StateDiff) Descriptor() ([]byte, []int) { +// Deprecated: Use ContractDiff.ProtoReflect.Descriptor instead. +func (*ContractDiff) Descriptor() ([]byte, []int) { return file_p2p_proto_state_proto_rawDescGZIP(), []int{1} } -func (x *StateDiff) GetDomain() uint32 { +func (x *ContractDiff) GetAddress() *Address { if x != nil { - return x.Domain - } - return 0 -} - -func (x *StateDiff) GetContractDiffs() []*StateDiff_ContractDiff { - if x != nil { - return x.ContractDiffs - } - return nil -} - -func (x *StateDiff) GetReplacedClasses() []*StateDiff_ContractAddrToClassHash { - if x != nil { - return x.ReplacedClasses - } - return nil -} - -func (x *StateDiff) GetDeployedContracts() []*StateDiff_ContractAddrToClassHash { - if x != nil { - return x.DeployedContracts - } - return nil -} - -type EntryPoint struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - Selector *Felt252 `protobuf:"bytes,1,opt,name=selector,proto3" json:"selector,omitempty"` - Offset *Felt252 `protobuf:"bytes,2,opt,name=offset,proto3" json:"offset,omitempty"` -} - -func (x *EntryPoint) Reset() { - *x = EntryPoint{} - if protoimpl.UnsafeEnabled { - mi := &file_p2p_proto_state_proto_msgTypes[2] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *EntryPoint) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*EntryPoint) ProtoMessage() {} - -func (x *EntryPoint) ProtoReflect() protoreflect.Message { - mi := &file_p2p_proto_state_proto_msgTypes[2] - if protoimpl.UnsafeEnabled && x != nil { - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - if ms.LoadMessageInfo() == nil { - ms.StoreMessageInfo(mi) - } - return ms - } - return mi.MessageOf(x) -} - -// Deprecated: Use EntryPoint.ProtoReflect.Descriptor instead. -func (*EntryPoint) Descriptor() ([]byte, []int) { - return file_p2p_proto_state_proto_rawDescGZIP(), []int{2} -} - -func (x *EntryPoint) GetSelector() *Felt252 { - if x != nil { - return x.Selector - } - return nil -} - -func (x *EntryPoint) GetOffset() *Felt252 { - if x != nil { - return x.Offset - } - return nil -} - -type Cairo0Class struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - Abi []byte `protobuf:"bytes,1,opt,name=abi,proto3" json:"abi,omitempty"` - Externals []*EntryPoint `protobuf:"bytes,2,rep,name=externals,proto3" json:"externals,omitempty"` - L1Handlers []*EntryPoint `protobuf:"bytes,3,rep,name=l1_handlers,json=l1Handlers,proto3" json:"l1_handlers,omitempty"` - Constructors []*EntryPoint `protobuf:"bytes,4,rep,name=constructors,proto3" json:"constructors,omitempty"` - Program []byte `protobuf:"bytes,5,opt,name=program,proto3" json:"program,omitempty"` -} - -func (x *Cairo0Class) Reset() { - *x = Cairo0Class{} - if protoimpl.UnsafeEnabled { - mi := &file_p2p_proto_state_proto_msgTypes[3] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *Cairo0Class) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*Cairo0Class) ProtoMessage() {} - -func (x *Cairo0Class) ProtoReflect() protoreflect.Message { - mi := &file_p2p_proto_state_proto_msgTypes[3] - if protoimpl.UnsafeEnabled && x != nil { - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - if ms.LoadMessageInfo() == nil { - ms.StoreMessageInfo(mi) - } - return ms - } - return mi.MessageOf(x) -} - -// Deprecated: Use Cairo0Class.ProtoReflect.Descriptor instead. -func (*Cairo0Class) Descriptor() ([]byte, []int) { - return file_p2p_proto_state_proto_rawDescGZIP(), []int{3} -} - -func (x *Cairo0Class) GetAbi() []byte { - if x != nil { - return x.Abi + return x.Address } return nil } -func (x *Cairo0Class) GetExternals() []*EntryPoint { +func (x *ContractDiff) GetNonce() *Felt252 { if x != nil { - return x.Externals + return x.Nonce } return nil } -func (x *Cairo0Class) GetL1Handlers() []*EntryPoint { +func (x *ContractDiff) GetClassHash() *Hash { if x != nil { - return x.L1Handlers + return x.ClassHash } return nil } -func (x *Cairo0Class) GetConstructors() []*EntryPoint { - if x != nil { - return x.Constructors +func (x *ContractDiff) GetIsReplaced() bool { + if x != nil && x.IsReplaced != nil { + return *x.IsReplaced } - return nil + return false } -func (x *Cairo0Class) GetProgram() []byte { +func (x *ContractDiff) GetValues() []*ContractStoredValue { if x != nil { - return x.Program + return x.Values } return nil } -type SierraEntryPoint struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - Index uint64 `protobuf:"varint,1,opt,name=index,proto3" json:"index,omitempty"` - Selector *Felt252 `protobuf:"bytes,2,opt,name=selector,proto3" json:"selector,omitempty"` -} - -func (x *SierraEntryPoint) Reset() { - *x = SierraEntryPoint{} - if protoimpl.UnsafeEnabled { - mi := &file_p2p_proto_state_proto_msgTypes[4] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *SierraEntryPoint) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*SierraEntryPoint) ProtoMessage() {} - -func (x *SierraEntryPoint) ProtoReflect() protoreflect.Message { - mi := &file_p2p_proto_state_proto_msgTypes[4] - if protoimpl.UnsafeEnabled && x != nil { - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - if ms.LoadMessageInfo() == nil { - ms.StoreMessageInfo(mi) - } - return ms - } - return mi.MessageOf(x) -} - -// Deprecated: Use SierraEntryPoint.ProtoReflect.Descriptor instead. -func (*SierraEntryPoint) Descriptor() ([]byte, []int) { - return file_p2p_proto_state_proto_rawDescGZIP(), []int{4} -} - -func (x *SierraEntryPoint) GetIndex() uint64 { +func (x *ContractDiff) GetDomain() uint32 { if x != nil { - return x.Index + return x.Domain } return 0 } -func (x *SierraEntryPoint) GetSelector() *Felt252 { - if x != nil { - return x.Selector - } - return nil -} - -type Cairo1EntryPoints struct { +type StateDiffsRequest struct { state protoimpl.MessageState sizeCache protoimpl.SizeCache unknownFields protoimpl.UnknownFields - Externals []*SierraEntryPoint `protobuf:"bytes,1,rep,name=externals,proto3" json:"externals,omitempty"` - L1Handlers []*SierraEntryPoint `protobuf:"bytes,2,rep,name=l1_handlers,json=l1Handlers,proto3" json:"l1_handlers,omitempty"` - Constructors []*SierraEntryPoint `protobuf:"bytes,3,rep,name=constructors,proto3" json:"constructors,omitempty"` + Iteration *Iteration `protobuf:"bytes,1,opt,name=iteration,proto3" json:"iteration,omitempty"` } -func (x *Cairo1EntryPoints) Reset() { - *x = Cairo1EntryPoints{} +func (x *StateDiffsRequest) Reset() { + *x = StateDiffsRequest{} if protoimpl.UnsafeEnabled { - mi := &file_p2p_proto_state_proto_msgTypes[5] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *Cairo1EntryPoints) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*Cairo1EntryPoints) ProtoMessage() {} - -func (x *Cairo1EntryPoints) ProtoReflect() protoreflect.Message { - mi := &file_p2p_proto_state_proto_msgTypes[5] - if protoimpl.UnsafeEnabled && x != nil { - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - if ms.LoadMessageInfo() == nil { - ms.StoreMessageInfo(mi) - } - return ms - } - return mi.MessageOf(x) -} - -// Deprecated: Use Cairo1EntryPoints.ProtoReflect.Descriptor instead. -func (*Cairo1EntryPoints) Descriptor() ([]byte, []int) { - return file_p2p_proto_state_proto_rawDescGZIP(), []int{5} -} - -func (x *Cairo1EntryPoints) GetExternals() []*SierraEntryPoint { - if x != nil { - return x.Externals - } - return nil -} - -func (x *Cairo1EntryPoints) GetL1Handlers() []*SierraEntryPoint { - if x != nil { - return x.L1Handlers - } - return nil -} - -func (x *Cairo1EntryPoints) GetConstructors() []*SierraEntryPoint { - if x != nil { - return x.Constructors - } - return nil -} - -type Cairo1Class struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - Abi []byte `protobuf:"bytes,1,opt,name=abi,proto3" json:"abi,omitempty"` - EntryPoints *Cairo1EntryPoints `protobuf:"bytes,2,opt,name=entry_points,json=entryPoints,proto3" json:"entry_points,omitempty"` - Program []*Felt252 `protobuf:"bytes,3,rep,name=program,proto3" json:"program,omitempty"` - ContractClassVersion string `protobuf:"bytes,4,opt,name=contract_class_version,json=contractClassVersion,proto3" json:"contract_class_version,omitempty"` - Compiled []byte `protobuf:"bytes,5,opt,name=compiled,proto3" json:"compiled,omitempty"` -} - -func (x *Cairo1Class) Reset() { - *x = Cairo1Class{} - if protoimpl.UnsafeEnabled { - mi := &file_p2p_proto_state_proto_msgTypes[6] + mi := &file_p2p_proto_state_proto_msgTypes[2] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } } -func (x *Cairo1Class) String() string { +func (x *StateDiffsRequest) String() string { return protoimpl.X.MessageStringOf(x) } -func (*Cairo1Class) ProtoMessage() {} +func (*StateDiffsRequest) ProtoMessage() {} -func (x *Cairo1Class) ProtoReflect() protoreflect.Message { - mi := &file_p2p_proto_state_proto_msgTypes[6] +func (x *StateDiffsRequest) ProtoReflect() protoreflect.Message { + mi := &file_p2p_proto_state_proto_msgTypes[2] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -439,79 +199,50 @@ func (x *Cairo1Class) ProtoReflect() protoreflect.Message { return mi.MessageOf(x) } -// Deprecated: Use Cairo1Class.ProtoReflect.Descriptor instead. -func (*Cairo1Class) Descriptor() ([]byte, []int) { - return file_p2p_proto_state_proto_rawDescGZIP(), []int{6} -} - -func (x *Cairo1Class) GetAbi() []byte { - if x != nil { - return x.Abi - } - return nil -} - -func (x *Cairo1Class) GetEntryPoints() *Cairo1EntryPoints { - if x != nil { - return x.EntryPoints - } - return nil -} - -func (x *Cairo1Class) GetProgram() []*Felt252 { - if x != nil { - return x.Program - } - return nil -} - -func (x *Cairo1Class) GetContractClassVersion() string { - if x != nil { - return x.ContractClassVersion - } - return "" +// Deprecated: Use StateDiffsRequest.ProtoReflect.Descriptor instead. +func (*StateDiffsRequest) Descriptor() ([]byte, []int) { + return file_p2p_proto_state_proto_rawDescGZIP(), []int{2} } -func (x *Cairo1Class) GetCompiled() []byte { +func (x *StateDiffsRequest) GetIteration() *Iteration { if x != nil { - return x.Compiled + return x.Iteration } return nil } -// is it better to separate the definition from the hashes? (will need to repeate the hashes -// for the definitions stream) -// or, make the definitions optional? maybe it is enough to know only that a class exists, not its definition -// which may be fetched lazily later. -type Class struct { +// Responses are sent ordered by the order given in the request. +type StateDiffsResponse struct { state protoimpl.MessageState sizeCache protoimpl.SizeCache unknownFields protoimpl.UnknownFields - // Types that are assignable to Class: + // All of the messages related to a block need to be sent before a message from the next block is sent. + // + // Types that are assignable to StateDiffMessage: // - // *Class_Cairo0 - // *Class_Cairo1 - Class isClass_Class `protobuf_oneof:"class"` + // *StateDiffsResponse_ContractDiff + // *StateDiffsResponse_Fin + StateDiffMessage isStateDiffsResponse_StateDiffMessage `protobuf_oneof:"state_diff_message"` } -func (x *Class) Reset() { - *x = Class{} +func (x *StateDiffsResponse) Reset() { + *x = StateDiffsResponse{} if protoimpl.UnsafeEnabled { - mi := &file_p2p_proto_state_proto_msgTypes[7] + mi := &file_p2p_proto_state_proto_msgTypes[3] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } } -func (x *Class) String() string { +func (x *StateDiffsResponse) String() string { return protoimpl.X.MessageStringOf(x) } -func (*Class) ProtoMessage() {} +func (*StateDiffsResponse) ProtoMessage() {} -func (x *Class) ProtoReflect() protoreflect.Message { - mi := &file_p2p_proto_state_proto_msgTypes[7] +func (x *StateDiffsResponse) ProtoReflect() protoreflect.Message { + mi := &file_p2p_proto_state_proto_msgTypes[3] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -522,229 +253,47 @@ func (x *Class) ProtoReflect() protoreflect.Message { return mi.MessageOf(x) } -// Deprecated: Use Class.ProtoReflect.Descriptor instead. -func (*Class) Descriptor() ([]byte, []int) { - return file_p2p_proto_state_proto_rawDescGZIP(), []int{7} +// Deprecated: Use StateDiffsResponse.ProtoReflect.Descriptor instead. +func (*StateDiffsResponse) Descriptor() ([]byte, []int) { + return file_p2p_proto_state_proto_rawDescGZIP(), []int{3} } -func (m *Class) GetClass() isClass_Class { +func (m *StateDiffsResponse) GetStateDiffMessage() isStateDiffsResponse_StateDiffMessage { if m != nil { - return m.Class + return m.StateDiffMessage } return nil } -func (x *Class) GetCairo0() *Cairo0Class { - if x, ok := x.GetClass().(*Class_Cairo0); ok { - return x.Cairo0 +func (x *StateDiffsResponse) GetContractDiff() *ContractDiff { + if x, ok := x.GetStateDiffMessage().(*StateDiffsResponse_ContractDiff); ok { + return x.ContractDiff } return nil } -func (x *Class) GetCairo1() *Cairo1Class { - if x, ok := x.GetClass().(*Class_Cairo1); ok { - return x.Cairo1 +func (x *StateDiffsResponse) GetFin() *Fin { + if x, ok := x.GetStateDiffMessage().(*StateDiffsResponse_Fin); ok { + return x.Fin } return nil } -type isClass_Class interface { - isClass_Class() +type isStateDiffsResponse_StateDiffMessage interface { + isStateDiffsResponse_StateDiffMessage() } -type Class_Cairo0 struct { - Cairo0 *Cairo0Class `protobuf:"bytes,1,opt,name=cairo0,proto3,oneof"` +type StateDiffsResponse_ContractDiff struct { + ContractDiff *ContractDiff `protobuf:"bytes,1,opt,name=contract_diff,json=contractDiff,proto3,oneof"` // Multiple contract diffs for the same contract may appear continuously if the diff is too large. } -type Class_Cairo1 struct { - Cairo1 *Cairo1Class `protobuf:"bytes,2,opt,name=cairo1,proto3,oneof"` +type StateDiffsResponse_Fin struct { + Fin *Fin `protobuf:"bytes,2,opt,name=fin,proto3,oneof"` // Fin is sent after the peer sent all the data or when it encountered a block that it doesn't have its state diff. } -func (*Class_Cairo0) isClass_Class() {} +func (*StateDiffsResponse_ContractDiff) isStateDiffsResponse_StateDiffMessage() {} -func (*Class_Cairo1) isClass_Class() {} - -type Classes struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - Domain uint32 `protobuf:"varint,1,opt,name=domain,proto3" json:"domain,omitempty"` - Classes []*Class `protobuf:"bytes,2,rep,name=classes,proto3" json:"classes,omitempty"` -} - -func (x *Classes) Reset() { - *x = Classes{} - if protoimpl.UnsafeEnabled { - mi := &file_p2p_proto_state_proto_msgTypes[8] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *Classes) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*Classes) ProtoMessage() {} - -func (x *Classes) ProtoReflect() protoreflect.Message { - mi := &file_p2p_proto_state_proto_msgTypes[8] - if protoimpl.UnsafeEnabled && x != nil { - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - if ms.LoadMessageInfo() == nil { - ms.StoreMessageInfo(mi) - } - return ms - } - return mi.MessageOf(x) -} - -// Deprecated: Use Classes.ProtoReflect.Descriptor instead. -func (*Classes) Descriptor() ([]byte, []int) { - return file_p2p_proto_state_proto_rawDescGZIP(), []int{8} -} - -func (x *Classes) GetDomain() uint32 { - if x != nil { - return x.Domain - } - return 0 -} - -func (x *Classes) GetClasses() []*Class { - if x != nil { - return x.Classes - } - return nil -} - -// a bit more efficient than the state sync separation -type StateDiff_ContractDiff struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - Address *Address `protobuf:"bytes,1,opt,name=address,proto3" json:"address,omitempty"` - Nonce *Felt252 `protobuf:"bytes,2,opt,name=nonce,proto3,oneof" json:"nonce,omitempty"` - ClassHash *Felt252 `protobuf:"bytes,3,opt,name=class_hash,json=classHash,proto3,oneof" json:"class_hash,omitempty"` // can change for replace_class or new contract - Values []*ContractStoredValue `protobuf:"bytes,4,rep,name=values,proto3" json:"values,omitempty"` -} - -func (x *StateDiff_ContractDiff) Reset() { - *x = StateDiff_ContractDiff{} - if protoimpl.UnsafeEnabled { - mi := &file_p2p_proto_state_proto_msgTypes[9] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *StateDiff_ContractDiff) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*StateDiff_ContractDiff) ProtoMessage() {} - -func (x *StateDiff_ContractDiff) ProtoReflect() protoreflect.Message { - mi := &file_p2p_proto_state_proto_msgTypes[9] - if protoimpl.UnsafeEnabled && x != nil { - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - if ms.LoadMessageInfo() == nil { - ms.StoreMessageInfo(mi) - } - return ms - } - return mi.MessageOf(x) -} - -// Deprecated: Use StateDiff_ContractDiff.ProtoReflect.Descriptor instead. -func (*StateDiff_ContractDiff) Descriptor() ([]byte, []int) { - return file_p2p_proto_state_proto_rawDescGZIP(), []int{1, 0} -} - -func (x *StateDiff_ContractDiff) GetAddress() *Address { - if x != nil { - return x.Address - } - return nil -} - -func (x *StateDiff_ContractDiff) GetNonce() *Felt252 { - if x != nil { - return x.Nonce - } - return nil -} - -func (x *StateDiff_ContractDiff) GetClassHash() *Felt252 { - if x != nil { - return x.ClassHash - } - return nil -} - -func (x *StateDiff_ContractDiff) GetValues() []*ContractStoredValue { - if x != nil { - return x.Values - } - return nil -} - -type StateDiff_ContractAddrToClassHash struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - ContractAddr *Address `protobuf:"bytes,1,opt,name=contract_addr,json=contractAddr,proto3" json:"contract_addr,omitempty"` - ClassHash *Hash `protobuf:"bytes,2,opt,name=class_hash,json=classHash,proto3" json:"class_hash,omitempty"` -} - -func (x *StateDiff_ContractAddrToClassHash) Reset() { - *x = StateDiff_ContractAddrToClassHash{} - if protoimpl.UnsafeEnabled { - mi := &file_p2p_proto_state_proto_msgTypes[10] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *StateDiff_ContractAddrToClassHash) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*StateDiff_ContractAddrToClassHash) ProtoMessage() {} - -func (x *StateDiff_ContractAddrToClassHash) ProtoReflect() protoreflect.Message { - mi := &file_p2p_proto_state_proto_msgTypes[10] - if protoimpl.UnsafeEnabled && x != nil { - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - if ms.LoadMessageInfo() == nil { - ms.StoreMessageInfo(mi) - } - return ms - } - return mi.MessageOf(x) -} - -// Deprecated: Use StateDiff_ContractAddrToClassHash.ProtoReflect.Descriptor instead. -func (*StateDiff_ContractAddrToClassHash) Descriptor() ([]byte, []int) { - return file_p2p_proto_state_proto_rawDescGZIP(), []int{1, 1} -} - -func (x *StateDiff_ContractAddrToClassHash) GetContractAddr() *Address { - if x != nil { - return x.ContractAddr - } - return nil -} - -func (x *StateDiff_ContractAddrToClassHash) GetClassHash() *Hash { - if x != nil { - return x.ClassHash - } - return nil -} +func (*StateDiffsResponse_Fin) isStateDiffsResponse_StateDiffMessage() {} var File_p2p_proto_state_proto protoreflect.FileDescriptor @@ -757,101 +306,40 @@ var file_p2p_proto_state_proto_rawDesc = []byte{ 0x01, 0x28, 0x0b, 0x32, 0x08, 0x2e, 0x46, 0x65, 0x6c, 0x74, 0x32, 0x35, 0x32, 0x52, 0x03, 0x6b, 0x65, 0x79, 0x12, 0x1e, 0x0a, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x08, 0x2e, 0x46, 0x65, 0x6c, 0x74, 0x32, 0x35, 0x32, 0x52, 0x05, 0x76, 0x61, 0x6c, - 0x75, 0x65, 0x22, 0xc4, 0x04, 0x0a, 0x09, 0x53, 0x74, 0x61, 0x74, 0x65, 0x44, 0x69, 0x66, 0x66, - 0x12, 0x16, 0x0a, 0x06, 0x64, 0x6f, 0x6d, 0x61, 0x69, 0x6e, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0d, - 0x52, 0x06, 0x64, 0x6f, 0x6d, 0x61, 0x69, 0x6e, 0x12, 0x3e, 0x0a, 0x0e, 0x63, 0x6f, 0x6e, 0x74, - 0x72, 0x61, 0x63, 0x74, 0x5f, 0x64, 0x69, 0x66, 0x66, 0x73, 0x18, 0x02, 0x20, 0x03, 0x28, 0x0b, - 0x32, 0x17, 0x2e, 0x53, 0x74, 0x61, 0x74, 0x65, 0x44, 0x69, 0x66, 0x66, 0x2e, 0x43, 0x6f, 0x6e, - 0x74, 0x72, 0x61, 0x63, 0x74, 0x44, 0x69, 0x66, 0x66, 0x52, 0x0d, 0x63, 0x6f, 0x6e, 0x74, 0x72, - 0x61, 0x63, 0x74, 0x44, 0x69, 0x66, 0x66, 0x73, 0x12, 0x4d, 0x0a, 0x10, 0x72, 0x65, 0x70, 0x6c, - 0x61, 0x63, 0x65, 0x64, 0x5f, 0x63, 0x6c, 0x61, 0x73, 0x73, 0x65, 0x73, 0x18, 0x03, 0x20, 0x03, - 0x28, 0x0b, 0x32, 0x22, 0x2e, 0x53, 0x74, 0x61, 0x74, 0x65, 0x44, 0x69, 0x66, 0x66, 0x2e, 0x43, - 0x6f, 0x6e, 0x74, 0x72, 0x61, 0x63, 0x74, 0x41, 0x64, 0x64, 0x72, 0x54, 0x6f, 0x43, 0x6c, 0x61, - 0x73, 0x73, 0x48, 0x61, 0x73, 0x68, 0x52, 0x0f, 0x72, 0x65, 0x70, 0x6c, 0x61, 0x63, 0x65, 0x64, - 0x43, 0x6c, 0x61, 0x73, 0x73, 0x65, 0x73, 0x12, 0x51, 0x0a, 0x12, 0x64, 0x65, 0x70, 0x6c, 0x6f, - 0x79, 0x65, 0x64, 0x5f, 0x63, 0x6f, 0x6e, 0x74, 0x72, 0x61, 0x63, 0x74, 0x73, 0x18, 0x04, 0x20, - 0x03, 0x28, 0x0b, 0x32, 0x22, 0x2e, 0x53, 0x74, 0x61, 0x74, 0x65, 0x44, 0x69, 0x66, 0x66, 0x2e, - 0x43, 0x6f, 0x6e, 0x74, 0x72, 0x61, 0x63, 0x74, 0x41, 0x64, 0x64, 0x72, 0x54, 0x6f, 0x43, 0x6c, - 0x61, 0x73, 0x73, 0x48, 0x61, 0x73, 0x68, 0x52, 0x11, 0x64, 0x65, 0x70, 0x6c, 0x6f, 0x79, 0x65, - 0x64, 0x43, 0x6f, 0x6e, 0x74, 0x72, 0x61, 0x63, 0x74, 0x73, 0x1a, 0xcc, 0x01, 0x0a, 0x0c, 0x43, - 0x6f, 0x6e, 0x74, 0x72, 0x61, 0x63, 0x74, 0x44, 0x69, 0x66, 0x66, 0x12, 0x22, 0x0a, 0x07, 0x61, - 0x64, 0x64, 0x72, 0x65, 0x73, 0x73, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x08, 0x2e, 0x41, - 0x64, 0x64, 0x72, 0x65, 0x73, 0x73, 0x52, 0x07, 0x61, 0x64, 0x64, 0x72, 0x65, 0x73, 0x73, 0x12, - 0x23, 0x0a, 0x05, 0x6e, 0x6f, 0x6e, 0x63, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x08, - 0x2e, 0x46, 0x65, 0x6c, 0x74, 0x32, 0x35, 0x32, 0x48, 0x00, 0x52, 0x05, 0x6e, 0x6f, 0x6e, 0x63, - 0x65, 0x88, 0x01, 0x01, 0x12, 0x2c, 0x0a, 0x0a, 0x63, 0x6c, 0x61, 0x73, 0x73, 0x5f, 0x68, 0x61, - 0x73, 0x68, 0x18, 0x03, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x08, 0x2e, 0x46, 0x65, 0x6c, 0x74, 0x32, - 0x35, 0x32, 0x48, 0x01, 0x52, 0x09, 0x63, 0x6c, 0x61, 0x73, 0x73, 0x48, 0x61, 0x73, 0x68, 0x88, - 0x01, 0x01, 0x12, 0x2c, 0x0a, 0x06, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x73, 0x18, 0x04, 0x20, 0x03, - 0x28, 0x0b, 0x32, 0x14, 0x2e, 0x43, 0x6f, 0x6e, 0x74, 0x72, 0x61, 0x63, 0x74, 0x53, 0x74, 0x6f, - 0x72, 0x65, 0x64, 0x56, 0x61, 0x6c, 0x75, 0x65, 0x52, 0x06, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x73, - 0x42, 0x08, 0x0a, 0x06, 0x5f, 0x6e, 0x6f, 0x6e, 0x63, 0x65, 0x42, 0x0d, 0x0a, 0x0b, 0x5f, 0x63, - 0x6c, 0x61, 0x73, 0x73, 0x5f, 0x68, 0x61, 0x73, 0x68, 0x1a, 0x6e, 0x0a, 0x17, 0x43, 0x6f, 0x6e, - 0x74, 0x72, 0x61, 0x63, 0x74, 0x41, 0x64, 0x64, 0x72, 0x54, 0x6f, 0x43, 0x6c, 0x61, 0x73, 0x73, - 0x48, 0x61, 0x73, 0x68, 0x12, 0x2d, 0x0a, 0x0d, 0x63, 0x6f, 0x6e, 0x74, 0x72, 0x61, 0x63, 0x74, - 0x5f, 0x61, 0x64, 0x64, 0x72, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x08, 0x2e, 0x41, 0x64, - 0x64, 0x72, 0x65, 0x73, 0x73, 0x52, 0x0c, 0x63, 0x6f, 0x6e, 0x74, 0x72, 0x61, 0x63, 0x74, 0x41, - 0x64, 0x64, 0x72, 0x12, 0x24, 0x0a, 0x0a, 0x63, 0x6c, 0x61, 0x73, 0x73, 0x5f, 0x68, 0x61, 0x73, - 0x68, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x05, 0x2e, 0x48, 0x61, 0x73, 0x68, 0x52, 0x09, - 0x63, 0x6c, 0x61, 0x73, 0x73, 0x48, 0x61, 0x73, 0x68, 0x22, 0x54, 0x0a, 0x0a, 0x45, 0x6e, 0x74, - 0x72, 0x79, 0x50, 0x6f, 0x69, 0x6e, 0x74, 0x12, 0x24, 0x0a, 0x08, 0x73, 0x65, 0x6c, 0x65, 0x63, - 0x74, 0x6f, 0x72, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x08, 0x2e, 0x46, 0x65, 0x6c, 0x74, - 0x32, 0x35, 0x32, 0x52, 0x08, 0x73, 0x65, 0x6c, 0x65, 0x63, 0x74, 0x6f, 0x72, 0x12, 0x20, 0x0a, - 0x06, 0x6f, 0x66, 0x66, 0x73, 0x65, 0x74, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x08, 0x2e, - 0x46, 0x65, 0x6c, 0x74, 0x32, 0x35, 0x32, 0x52, 0x06, 0x6f, 0x66, 0x66, 0x73, 0x65, 0x74, 0x22, - 0xc3, 0x01, 0x0a, 0x0b, 0x43, 0x61, 0x69, 0x72, 0x6f, 0x30, 0x43, 0x6c, 0x61, 0x73, 0x73, 0x12, - 0x10, 0x0a, 0x03, 0x61, 0x62, 0x69, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0c, 0x52, 0x03, 0x61, 0x62, - 0x69, 0x12, 0x29, 0x0a, 0x09, 0x65, 0x78, 0x74, 0x65, 0x72, 0x6e, 0x61, 0x6c, 0x73, 0x18, 0x02, - 0x20, 0x03, 0x28, 0x0b, 0x32, 0x0b, 0x2e, 0x45, 0x6e, 0x74, 0x72, 0x79, 0x50, 0x6f, 0x69, 0x6e, - 0x74, 0x52, 0x09, 0x65, 0x78, 0x74, 0x65, 0x72, 0x6e, 0x61, 0x6c, 0x73, 0x12, 0x2c, 0x0a, 0x0b, - 0x6c, 0x31, 0x5f, 0x68, 0x61, 0x6e, 0x64, 0x6c, 0x65, 0x72, 0x73, 0x18, 0x03, 0x20, 0x03, 0x28, - 0x0b, 0x32, 0x0b, 0x2e, 0x45, 0x6e, 0x74, 0x72, 0x79, 0x50, 0x6f, 0x69, 0x6e, 0x74, 0x52, 0x0a, - 0x6c, 0x31, 0x48, 0x61, 0x6e, 0x64, 0x6c, 0x65, 0x72, 0x73, 0x12, 0x2f, 0x0a, 0x0c, 0x63, 0x6f, - 0x6e, 0x73, 0x74, 0x72, 0x75, 0x63, 0x74, 0x6f, 0x72, 0x73, 0x18, 0x04, 0x20, 0x03, 0x28, 0x0b, - 0x32, 0x0b, 0x2e, 0x45, 0x6e, 0x74, 0x72, 0x79, 0x50, 0x6f, 0x69, 0x6e, 0x74, 0x52, 0x0c, 0x63, - 0x6f, 0x6e, 0x73, 0x74, 0x72, 0x75, 0x63, 0x74, 0x6f, 0x72, 0x73, 0x12, 0x18, 0x0a, 0x07, 0x70, - 0x72, 0x6f, 0x67, 0x72, 0x61, 0x6d, 0x18, 0x05, 0x20, 0x01, 0x28, 0x0c, 0x52, 0x07, 0x70, 0x72, - 0x6f, 0x67, 0x72, 0x61, 0x6d, 0x22, 0x4e, 0x0a, 0x10, 0x53, 0x69, 0x65, 0x72, 0x72, 0x61, 0x45, - 0x6e, 0x74, 0x72, 0x79, 0x50, 0x6f, 0x69, 0x6e, 0x74, 0x12, 0x14, 0x0a, 0x05, 0x69, 0x6e, 0x64, - 0x65, 0x78, 0x18, 0x01, 0x20, 0x01, 0x28, 0x04, 0x52, 0x05, 0x69, 0x6e, 0x64, 0x65, 0x78, 0x12, - 0x24, 0x0a, 0x08, 0x73, 0x65, 0x6c, 0x65, 0x63, 0x74, 0x6f, 0x72, 0x18, 0x02, 0x20, 0x01, 0x28, - 0x0b, 0x32, 0x08, 0x2e, 0x46, 0x65, 0x6c, 0x74, 0x32, 0x35, 0x32, 0x52, 0x08, 0x73, 0x65, 0x6c, - 0x65, 0x63, 0x74, 0x6f, 0x72, 0x22, 0xaf, 0x01, 0x0a, 0x11, 0x43, 0x61, 0x69, 0x72, 0x6f, 0x31, - 0x45, 0x6e, 0x74, 0x72, 0x79, 0x50, 0x6f, 0x69, 0x6e, 0x74, 0x73, 0x12, 0x2f, 0x0a, 0x09, 0x65, - 0x78, 0x74, 0x65, 0x72, 0x6e, 0x61, 0x6c, 0x73, 0x18, 0x01, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x11, - 0x2e, 0x53, 0x69, 0x65, 0x72, 0x72, 0x61, 0x45, 0x6e, 0x74, 0x72, 0x79, 0x50, 0x6f, 0x69, 0x6e, - 0x74, 0x52, 0x09, 0x65, 0x78, 0x74, 0x65, 0x72, 0x6e, 0x61, 0x6c, 0x73, 0x12, 0x32, 0x0a, 0x0b, - 0x6c, 0x31, 0x5f, 0x68, 0x61, 0x6e, 0x64, 0x6c, 0x65, 0x72, 0x73, 0x18, 0x02, 0x20, 0x03, 0x28, - 0x0b, 0x32, 0x11, 0x2e, 0x53, 0x69, 0x65, 0x72, 0x72, 0x61, 0x45, 0x6e, 0x74, 0x72, 0x79, 0x50, - 0x6f, 0x69, 0x6e, 0x74, 0x52, 0x0a, 0x6c, 0x31, 0x48, 0x61, 0x6e, 0x64, 0x6c, 0x65, 0x72, 0x73, - 0x12, 0x35, 0x0a, 0x0c, 0x63, 0x6f, 0x6e, 0x73, 0x74, 0x72, 0x75, 0x63, 0x74, 0x6f, 0x72, 0x73, - 0x18, 0x03, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x11, 0x2e, 0x53, 0x69, 0x65, 0x72, 0x72, 0x61, 0x45, - 0x6e, 0x74, 0x72, 0x79, 0x50, 0x6f, 0x69, 0x6e, 0x74, 0x52, 0x0c, 0x63, 0x6f, 0x6e, 0x73, 0x74, - 0x72, 0x75, 0x63, 0x74, 0x6f, 0x72, 0x73, 0x22, 0xcc, 0x01, 0x0a, 0x0b, 0x43, 0x61, 0x69, 0x72, - 0x6f, 0x31, 0x43, 0x6c, 0x61, 0x73, 0x73, 0x12, 0x10, 0x0a, 0x03, 0x61, 0x62, 0x69, 0x18, 0x01, - 0x20, 0x01, 0x28, 0x0c, 0x52, 0x03, 0x61, 0x62, 0x69, 0x12, 0x35, 0x0a, 0x0c, 0x65, 0x6e, 0x74, - 0x72, 0x79, 0x5f, 0x70, 0x6f, 0x69, 0x6e, 0x74, 0x73, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, - 0x12, 0x2e, 0x43, 0x61, 0x69, 0x72, 0x6f, 0x31, 0x45, 0x6e, 0x74, 0x72, 0x79, 0x50, 0x6f, 0x69, - 0x6e, 0x74, 0x73, 0x52, 0x0b, 0x65, 0x6e, 0x74, 0x72, 0x79, 0x50, 0x6f, 0x69, 0x6e, 0x74, 0x73, - 0x12, 0x22, 0x0a, 0x07, 0x70, 0x72, 0x6f, 0x67, 0x72, 0x61, 0x6d, 0x18, 0x03, 0x20, 0x03, 0x28, - 0x0b, 0x32, 0x08, 0x2e, 0x46, 0x65, 0x6c, 0x74, 0x32, 0x35, 0x32, 0x52, 0x07, 0x70, 0x72, 0x6f, - 0x67, 0x72, 0x61, 0x6d, 0x12, 0x34, 0x0a, 0x16, 0x63, 0x6f, 0x6e, 0x74, 0x72, 0x61, 0x63, 0x74, - 0x5f, 0x63, 0x6c, 0x61, 0x73, 0x73, 0x5f, 0x76, 0x65, 0x72, 0x73, 0x69, 0x6f, 0x6e, 0x18, 0x04, - 0x20, 0x01, 0x28, 0x09, 0x52, 0x14, 0x63, 0x6f, 0x6e, 0x74, 0x72, 0x61, 0x63, 0x74, 0x43, 0x6c, - 0x61, 0x73, 0x73, 0x56, 0x65, 0x72, 0x73, 0x69, 0x6f, 0x6e, 0x12, 0x1a, 0x0a, 0x08, 0x63, 0x6f, - 0x6d, 0x70, 0x69, 0x6c, 0x65, 0x64, 0x18, 0x05, 0x20, 0x01, 0x28, 0x0c, 0x52, 0x08, 0x63, 0x6f, - 0x6d, 0x70, 0x69, 0x6c, 0x65, 0x64, 0x22, 0x60, 0x0a, 0x05, 0x43, 0x6c, 0x61, 0x73, 0x73, 0x12, - 0x26, 0x0a, 0x06, 0x63, 0x61, 0x69, 0x72, 0x6f, 0x30, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, - 0x0c, 0x2e, 0x43, 0x61, 0x69, 0x72, 0x6f, 0x30, 0x43, 0x6c, 0x61, 0x73, 0x73, 0x48, 0x00, 0x52, - 0x06, 0x63, 0x61, 0x69, 0x72, 0x6f, 0x30, 0x12, 0x26, 0x0a, 0x06, 0x63, 0x61, 0x69, 0x72, 0x6f, - 0x31, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x0c, 0x2e, 0x43, 0x61, 0x69, 0x72, 0x6f, 0x31, - 0x43, 0x6c, 0x61, 0x73, 0x73, 0x48, 0x00, 0x52, 0x06, 0x63, 0x61, 0x69, 0x72, 0x6f, 0x31, 0x42, - 0x07, 0x0a, 0x05, 0x63, 0x6c, 0x61, 0x73, 0x73, 0x22, 0x43, 0x0a, 0x07, 0x43, 0x6c, 0x61, 0x73, - 0x73, 0x65, 0x73, 0x12, 0x16, 0x0a, 0x06, 0x64, 0x6f, 0x6d, 0x61, 0x69, 0x6e, 0x18, 0x01, 0x20, - 0x01, 0x28, 0x0d, 0x52, 0x06, 0x64, 0x6f, 0x6d, 0x61, 0x69, 0x6e, 0x12, 0x20, 0x0a, 0x07, 0x63, - 0x6c, 0x61, 0x73, 0x73, 0x65, 0x73, 0x18, 0x02, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x06, 0x2e, 0x43, - 0x6c, 0x61, 0x73, 0x73, 0x52, 0x07, 0x63, 0x6c, 0x61, 0x73, 0x73, 0x65, 0x73, 0x62, 0x06, 0x70, - 0x72, 0x6f, 0x74, 0x6f, 0x33, + 0x75, 0x65, 0x22, 0x97, 0x02, 0x0a, 0x0c, 0x43, 0x6f, 0x6e, 0x74, 0x72, 0x61, 0x63, 0x74, 0x44, + 0x69, 0x66, 0x66, 0x12, 0x22, 0x0a, 0x07, 0x61, 0x64, 0x64, 0x72, 0x65, 0x73, 0x73, 0x18, 0x01, + 0x20, 0x01, 0x28, 0x0b, 0x32, 0x08, 0x2e, 0x41, 0x64, 0x64, 0x72, 0x65, 0x73, 0x73, 0x52, 0x07, + 0x61, 0x64, 0x64, 0x72, 0x65, 0x73, 0x73, 0x12, 0x23, 0x0a, 0x05, 0x6e, 0x6f, 0x6e, 0x63, 0x65, + 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x08, 0x2e, 0x46, 0x65, 0x6c, 0x74, 0x32, 0x35, 0x32, + 0x48, 0x00, 0x52, 0x05, 0x6e, 0x6f, 0x6e, 0x63, 0x65, 0x88, 0x01, 0x01, 0x12, 0x29, 0x0a, 0x0a, + 0x63, 0x6c, 0x61, 0x73, 0x73, 0x5f, 0x68, 0x61, 0x73, 0x68, 0x18, 0x03, 0x20, 0x01, 0x28, 0x0b, + 0x32, 0x05, 0x2e, 0x48, 0x61, 0x73, 0x68, 0x48, 0x01, 0x52, 0x09, 0x63, 0x6c, 0x61, 0x73, 0x73, + 0x48, 0x61, 0x73, 0x68, 0x88, 0x01, 0x01, 0x12, 0x24, 0x0a, 0x0b, 0x69, 0x73, 0x5f, 0x72, 0x65, + 0x70, 0x6c, 0x61, 0x63, 0x65, 0x64, 0x18, 0x04, 0x20, 0x01, 0x28, 0x08, 0x48, 0x02, 0x52, 0x0a, + 0x69, 0x73, 0x52, 0x65, 0x70, 0x6c, 0x61, 0x63, 0x65, 0x64, 0x88, 0x01, 0x01, 0x12, 0x2c, 0x0a, + 0x06, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x73, 0x18, 0x05, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x14, 0x2e, + 0x43, 0x6f, 0x6e, 0x74, 0x72, 0x61, 0x63, 0x74, 0x53, 0x74, 0x6f, 0x72, 0x65, 0x64, 0x56, 0x61, + 0x6c, 0x75, 0x65, 0x52, 0x06, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x73, 0x12, 0x16, 0x0a, 0x06, 0x64, + 0x6f, 0x6d, 0x61, 0x69, 0x6e, 0x18, 0x06, 0x20, 0x01, 0x28, 0x0d, 0x52, 0x06, 0x64, 0x6f, 0x6d, + 0x61, 0x69, 0x6e, 0x42, 0x08, 0x0a, 0x06, 0x5f, 0x6e, 0x6f, 0x6e, 0x63, 0x65, 0x42, 0x0d, 0x0a, + 0x0b, 0x5f, 0x63, 0x6c, 0x61, 0x73, 0x73, 0x5f, 0x68, 0x61, 0x73, 0x68, 0x42, 0x0e, 0x0a, 0x0c, + 0x5f, 0x69, 0x73, 0x5f, 0x72, 0x65, 0x70, 0x6c, 0x61, 0x63, 0x65, 0x64, 0x22, 0x3d, 0x0a, 0x11, + 0x53, 0x74, 0x61, 0x74, 0x65, 0x44, 0x69, 0x66, 0x66, 0x73, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, + 0x74, 0x12, 0x28, 0x0a, 0x09, 0x69, 0x74, 0x65, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x18, 0x01, + 0x20, 0x01, 0x28, 0x0b, 0x32, 0x0a, 0x2e, 0x49, 0x74, 0x65, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, + 0x52, 0x09, 0x69, 0x74, 0x65, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x22, 0x7a, 0x0a, 0x12, 0x53, + 0x74, 0x61, 0x74, 0x65, 0x44, 0x69, 0x66, 0x66, 0x73, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, + 0x65, 0x12, 0x34, 0x0a, 0x0d, 0x63, 0x6f, 0x6e, 0x74, 0x72, 0x61, 0x63, 0x74, 0x5f, 0x64, 0x69, + 0x66, 0x66, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x0d, 0x2e, 0x43, 0x6f, 0x6e, 0x74, 0x72, + 0x61, 0x63, 0x74, 0x44, 0x69, 0x66, 0x66, 0x48, 0x00, 0x52, 0x0c, 0x63, 0x6f, 0x6e, 0x74, 0x72, + 0x61, 0x63, 0x74, 0x44, 0x69, 0x66, 0x66, 0x12, 0x18, 0x0a, 0x03, 0x66, 0x69, 0x6e, 0x18, 0x02, + 0x20, 0x01, 0x28, 0x0b, 0x32, 0x04, 0x2e, 0x46, 0x69, 0x6e, 0x48, 0x00, 0x52, 0x03, 0x66, 0x69, + 0x6e, 0x42, 0x14, 0x0a, 0x12, 0x73, 0x74, 0x61, 0x74, 0x65, 0x5f, 0x64, 0x69, 0x66, 0x66, 0x5f, + 0x6d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x42, 0x31, 0x5a, 0x2f, 0x67, 0x69, 0x74, 0x68, 0x75, + 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x4e, 0x65, 0x74, 0x68, 0x65, 0x72, 0x6d, 0x69, 0x6e, 0x64, + 0x45, 0x74, 0x68, 0x2f, 0x6a, 0x75, 0x6e, 0x6f, 0x2f, 0x70, 0x32, 0x70, 0x2f, 0x73, 0x74, 0x61, + 0x72, 0x6b, 0x6e, 0x65, 0x74, 0x2f, 0x73, 0x70, 0x65, 0x63, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, + 0x6f, 0x33, } var ( @@ -867,56 +355,34 @@ func file_p2p_proto_state_proto_rawDescGZIP() []byte { } var ( - file_p2p_proto_state_proto_msgTypes = make([]protoimpl.MessageInfo, 11) + file_p2p_proto_state_proto_msgTypes = make([]protoimpl.MessageInfo, 4) file_p2p_proto_state_proto_goTypes = []interface{}{ - (*ContractStoredValue)(nil), // 0: ContractStoredValue - (*StateDiff)(nil), // 1: StateDiff - (*EntryPoint)(nil), // 2: EntryPoint - (*Cairo0Class)(nil), // 3: Cairo0Class - (*SierraEntryPoint)(nil), // 4: SierraEntryPoint - (*Cairo1EntryPoints)(nil), // 5: Cairo1EntryPoints - (*Cairo1Class)(nil), // 6: Cairo1Class - (*Class)(nil), // 7: Class - (*Classes)(nil), // 8: Classes - (*StateDiff_ContractDiff)(nil), // 9: StateDiff.ContractDiff - (*StateDiff_ContractAddrToClassHash)(nil), // 10: StateDiff.ContractAddrToClassHash - (*Felt252)(nil), // 11: Felt252 - (*Address)(nil), // 12: Address - (*Hash)(nil), // 13: Hash + (*ContractStoredValue)(nil), // 0: ContractStoredValue + (*ContractDiff)(nil), // 1: ContractDiff + (*StateDiffsRequest)(nil), // 2: StateDiffsRequest + (*StateDiffsResponse)(nil), // 3: StateDiffsResponse + (*Felt252)(nil), // 4: Felt252 + (*Address)(nil), // 5: Address + (*Hash)(nil), // 6: Hash + (*Iteration)(nil), // 7: Iteration + (*Fin)(nil), // 8: Fin } ) - var file_p2p_proto_state_proto_depIdxs = []int32{ - 11, // 0: ContractStoredValue.key:type_name -> Felt252 - 11, // 1: ContractStoredValue.value:type_name -> Felt252 - 9, // 2: StateDiff.contract_diffs:type_name -> StateDiff.ContractDiff - 10, // 3: StateDiff.replaced_classes:type_name -> StateDiff.ContractAddrToClassHash - 10, // 4: StateDiff.deployed_contracts:type_name -> StateDiff.ContractAddrToClassHash - 11, // 5: EntryPoint.selector:type_name -> Felt252 - 11, // 6: EntryPoint.offset:type_name -> Felt252 - 2, // 7: Cairo0Class.externals:type_name -> EntryPoint - 2, // 8: Cairo0Class.l1_handlers:type_name -> EntryPoint - 2, // 9: Cairo0Class.constructors:type_name -> EntryPoint - 11, // 10: SierraEntryPoint.selector:type_name -> Felt252 - 4, // 11: Cairo1EntryPoints.externals:type_name -> SierraEntryPoint - 4, // 12: Cairo1EntryPoints.l1_handlers:type_name -> SierraEntryPoint - 4, // 13: Cairo1EntryPoints.constructors:type_name -> SierraEntryPoint - 5, // 14: Cairo1Class.entry_points:type_name -> Cairo1EntryPoints - 11, // 15: Cairo1Class.program:type_name -> Felt252 - 3, // 16: Class.cairo0:type_name -> Cairo0Class - 6, // 17: Class.cairo1:type_name -> Cairo1Class - 7, // 18: Classes.classes:type_name -> Class - 12, // 19: StateDiff.ContractDiff.address:type_name -> Address - 11, // 20: StateDiff.ContractDiff.nonce:type_name -> Felt252 - 11, // 21: StateDiff.ContractDiff.class_hash:type_name -> Felt252 - 0, // 22: StateDiff.ContractDiff.values:type_name -> ContractStoredValue - 12, // 23: StateDiff.ContractAddrToClassHash.contract_addr:type_name -> Address - 13, // 24: StateDiff.ContractAddrToClassHash.class_hash:type_name -> Hash - 25, // [25:25] is the sub-list for method output_type - 25, // [25:25] is the sub-list for method input_type - 25, // [25:25] is the sub-list for extension type_name - 25, // [25:25] is the sub-list for extension extendee - 0, // [0:25] is the sub-list for field type_name + 4, // 0: ContractStoredValue.key:type_name -> Felt252 + 4, // 1: ContractStoredValue.value:type_name -> Felt252 + 5, // 2: ContractDiff.address:type_name -> Address + 4, // 3: ContractDiff.nonce:type_name -> Felt252 + 6, // 4: ContractDiff.class_hash:type_name -> Hash + 0, // 5: ContractDiff.values:type_name -> ContractStoredValue + 7, // 6: StateDiffsRequest.iteration:type_name -> Iteration + 1, // 7: StateDiffsResponse.contract_diff:type_name -> ContractDiff + 8, // 8: StateDiffsResponse.fin:type_name -> Fin + 9, // [9:9] is the sub-list for method output_type + 9, // [9:9] is the sub-list for method input_type + 9, // [9:9] is the sub-list for extension type_name + 9, // [9:9] is the sub-list for extension extendee + 0, // [0:9] is the sub-list for field type_name } func init() { file_p2p_proto_state_proto_init() } @@ -939,7 +405,7 @@ func file_p2p_proto_state_proto_init() { } } file_p2p_proto_state_proto_msgTypes[1].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*StateDiff); i { + switch v := v.(*ContractDiff); i { case 0: return &v.state case 1: @@ -951,7 +417,7 @@ func file_p2p_proto_state_proto_init() { } } file_p2p_proto_state_proto_msgTypes[2].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*EntryPoint); i { + switch v := v.(*StateDiffsRequest); i { case 0: return &v.state case 1: @@ -963,91 +429,7 @@ func file_p2p_proto_state_proto_init() { } } file_p2p_proto_state_proto_msgTypes[3].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*Cairo0Class); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_p2p_proto_state_proto_msgTypes[4].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*SierraEntryPoint); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_p2p_proto_state_proto_msgTypes[5].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*Cairo1EntryPoints); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_p2p_proto_state_proto_msgTypes[6].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*Cairo1Class); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_p2p_proto_state_proto_msgTypes[7].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*Class); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_p2p_proto_state_proto_msgTypes[8].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*Classes); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_p2p_proto_state_proto_msgTypes[9].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*StateDiff_ContractDiff); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_p2p_proto_state_proto_msgTypes[10].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*StateDiff_ContractAddrToClassHash); i { + switch v := v.(*StateDiffsResponse); i { case 0: return &v.state case 1: @@ -1059,18 +441,18 @@ func file_p2p_proto_state_proto_init() { } } } - file_p2p_proto_state_proto_msgTypes[7].OneofWrappers = []interface{}{ - (*Class_Cairo0)(nil), - (*Class_Cairo1)(nil), + file_p2p_proto_state_proto_msgTypes[1].OneofWrappers = []interface{}{} + file_p2p_proto_state_proto_msgTypes[3].OneofWrappers = []interface{}{ + (*StateDiffsResponse_ContractDiff)(nil), + (*StateDiffsResponse_Fin)(nil), } - file_p2p_proto_state_proto_msgTypes[9].OneofWrappers = []interface{}{} type x struct{} out := protoimpl.TypeBuilder{ File: protoimpl.DescBuilder{ GoPackagePath: reflect.TypeOf(x{}).PkgPath(), RawDescriptor: file_p2p_proto_state_proto_rawDesc, NumEnums: 0, - NumMessages: 11, + NumMessages: 4, NumExtensions: 0, NumServices: 0, }, diff --git a/p2p/starknet/spec/transaction.pb.go b/p2p/starknet/spec/transaction.pb.go index 6a1a76fc90..207f8f5ab5 100644 --- a/p2p/starknet/spec/transaction.pb.go +++ b/p2p/starknet/spec/transaction.pb.go @@ -1,7 +1,7 @@ // Code generated by protoc-gen-go. DO NOT EDIT. // versions: -// protoc-gen-go v1.31.0 -// protoc v4.24.4 +// protoc-gen-go v1.26.0 +// protoc v4.25.1 // source: p2p/proto/transaction.proto package spec @@ -76,6 +76,61 @@ func (x *ResourceLimits) GetMaxPricePerUnit() *Felt252 { return nil } +type ResourceBounds struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + L1Gas *ResourceLimits `protobuf:"bytes,1,opt,name=l1_gas,json=l1Gas,proto3" json:"l1_gas,omitempty"` + L2Gas *ResourceLimits `protobuf:"bytes,2,opt,name=l2_gas,json=l2Gas,proto3" json:"l2_gas,omitempty"` +} + +func (x *ResourceBounds) Reset() { + *x = ResourceBounds{} + if protoimpl.UnsafeEnabled { + mi := &file_p2p_proto_transaction_proto_msgTypes[1] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *ResourceBounds) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*ResourceBounds) ProtoMessage() {} + +func (x *ResourceBounds) ProtoReflect() protoreflect.Message { + mi := &file_p2p_proto_transaction_proto_msgTypes[1] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use ResourceBounds.ProtoReflect.Descriptor instead. +func (*ResourceBounds) Descriptor() ([]byte, []int) { + return file_p2p_proto_transaction_proto_rawDescGZIP(), []int{1} +} + +func (x *ResourceBounds) GetL1Gas() *ResourceLimits { + if x != nil { + return x.L1Gas + } + return nil +} + +func (x *ResourceBounds) GetL2Gas() *ResourceLimits { + if x != nil { + return x.L2Gas + } + return nil +} + type AccountSignature struct { state protoimpl.MessageState sizeCache protoimpl.SizeCache @@ -87,7 +142,7 @@ type AccountSignature struct { func (x *AccountSignature) Reset() { *x = AccountSignature{} if protoimpl.UnsafeEnabled { - mi := &file_p2p_proto_transaction_proto_msgTypes[1] + mi := &file_p2p_proto_transaction_proto_msgTypes[2] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -100,7 +155,7 @@ func (x *AccountSignature) String() string { func (*AccountSignature) ProtoMessage() {} func (x *AccountSignature) ProtoReflect() protoreflect.Message { - mi := &file_p2p_proto_transaction_proto_msgTypes[1] + mi := &file_p2p_proto_transaction_proto_msgTypes[2] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -113,7 +168,7 @@ func (x *AccountSignature) ProtoReflect() protoreflect.Message { // Deprecated: Use AccountSignature.ProtoReflect.Descriptor instead. func (*AccountSignature) Descriptor() ([]byte, []int) { - return file_p2p_proto_transaction_proto_rawDescGZIP(), []int{1} + return file_p2p_proto_transaction_proto_rawDescGZIP(), []int{2} } func (x *AccountSignature) GetParts() []*Felt252 { @@ -141,13 +196,14 @@ type Transaction struct { // *Transaction_InvokeV1_ // *Transaction_InvokeV3_ // *Transaction_L1Handler - Txn isTransaction_Txn `protobuf_oneof:"txn"` + Txn isTransaction_Txn `protobuf_oneof:"txn"` + TransactionHash *Hash `protobuf:"bytes,12,opt,name=transaction_hash,json=transactionHash,proto3" json:"transaction_hash,omitempty"` } func (x *Transaction) Reset() { *x = Transaction{} if protoimpl.UnsafeEnabled { - mi := &file_p2p_proto_transaction_proto_msgTypes[2] + mi := &file_p2p_proto_transaction_proto_msgTypes[3] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -160,7 +216,7 @@ func (x *Transaction) String() string { func (*Transaction) ProtoMessage() {} func (x *Transaction) ProtoReflect() protoreflect.Message { - mi := &file_p2p_proto_transaction_proto_msgTypes[2] + mi := &file_p2p_proto_transaction_proto_msgTypes[3] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -173,7 +229,7 @@ func (x *Transaction) ProtoReflect() protoreflect.Message { // Deprecated: Use Transaction.ProtoReflect.Descriptor instead. func (*Transaction) Descriptor() ([]byte, []int) { - return file_p2p_proto_transaction_proto_rawDescGZIP(), []int{2} + return file_p2p_proto_transaction_proto_rawDescGZIP(), []int{3} } func (m *Transaction) GetTxn() isTransaction_Txn { @@ -253,13 +309,20 @@ func (x *Transaction) GetInvokeV3() *Transaction_InvokeV3 { return nil } -func (x *Transaction) GetL1Handler() *Transaction_L1HandlerV1 { +func (x *Transaction) GetL1Handler() *Transaction_L1HandlerV0 { if x, ok := x.GetTxn().(*Transaction_L1Handler); ok { return x.L1Handler } return nil } +func (x *Transaction) GetTransactionHash() *Hash { + if x != nil { + return x.TransactionHash + } + return nil +} + type isTransaction_Txn interface { isTransaction_Txn() } @@ -305,7 +368,7 @@ type Transaction_InvokeV3_ struct { } type Transaction_L1Handler struct { - L1Handler *Transaction_L1HandlerV1 `protobuf:"bytes,11,opt,name=l1_handler,json=l1Handler,proto3,oneof"` + L1Handler *Transaction_L1HandlerV0 `protobuf:"bytes,11,opt,name=l1_handler,json=l1Handler,proto3,oneof"` } func (*Transaction_DeclareV0_) isTransaction_Txn() {} @@ -343,7 +406,7 @@ type TransactionsRequest struct { func (x *TransactionsRequest) Reset() { *x = TransactionsRequest{} if protoimpl.UnsafeEnabled { - mi := &file_p2p_proto_transaction_proto_msgTypes[3] + mi := &file_p2p_proto_transaction_proto_msgTypes[4] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -356,7 +419,7 @@ func (x *TransactionsRequest) String() string { func (*TransactionsRequest) ProtoMessage() {} func (x *TransactionsRequest) ProtoReflect() protoreflect.Message { - mi := &file_p2p_proto_transaction_proto_msgTypes[3] + mi := &file_p2p_proto_transaction_proto_msgTypes[4] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -369,7 +432,7 @@ func (x *TransactionsRequest) ProtoReflect() protoreflect.Message { // Deprecated: Use TransactionsRequest.ProtoReflect.Descriptor instead. func (*TransactionsRequest) Descriptor() ([]byte, []int) { - return file_p2p_proto_transaction_proto_rawDescGZIP(), []int{3} + return file_p2p_proto_transaction_proto_rawDescGZIP(), []int{4} } func (x *TransactionsRequest) GetIteration() *Iteration { @@ -379,65 +442,17 @@ func (x *TransactionsRequest) GetIteration() *Iteration { return nil } -// can be several in a single reply -type Transactions struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - Items []*Transaction `protobuf:"bytes,1,rep,name=items,proto3" json:"items,omitempty"` -} - -func (x *Transactions) Reset() { - *x = Transactions{} - if protoimpl.UnsafeEnabled { - mi := &file_p2p_proto_transaction_proto_msgTypes[4] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *Transactions) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*Transactions) ProtoMessage() {} - -func (x *Transactions) ProtoReflect() protoreflect.Message { - mi := &file_p2p_proto_transaction_proto_msgTypes[4] - if protoimpl.UnsafeEnabled && x != nil { - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - if ms.LoadMessageInfo() == nil { - ms.StoreMessageInfo(mi) - } - return ms - } - return mi.MessageOf(x) -} - -// Deprecated: Use Transactions.ProtoReflect.Descriptor instead. -func (*Transactions) Descriptor() ([]byte, []int) { - return file_p2p_proto_transaction_proto_rawDescGZIP(), []int{4} -} - -func (x *Transactions) GetItems() []*Transaction { - if x != nil { - return x.Items - } - return nil -} - +// Responses are sent ordered by the order given in the request. type TransactionsResponse struct { state protoimpl.MessageState sizeCache protoimpl.SizeCache unknownFields protoimpl.UnknownFields - Id *BlockID `protobuf:"bytes,1,opt,name=id,proto3,oneof" json:"id,omitempty"` // may not appear if Fin is sent to end the whole response - // Types that are assignable to Responses: + // Types that are assignable to TransactionMessage: // - // *TransactionsResponse_Transactions + // *TransactionsResponse_Transaction // *TransactionsResponse_Fin - Responses isTransactionsResponse_Responses `protobuf_oneof:"responses"` + TransactionMessage isTransactionsResponse_TransactionMessage `protobuf_oneof:"transaction_message"` } func (x *TransactionsResponse) Reset() { @@ -472,49 +487,42 @@ func (*TransactionsResponse) Descriptor() ([]byte, []int) { return file_p2p_proto_transaction_proto_rawDescGZIP(), []int{5} } -func (x *TransactionsResponse) GetId() *BlockID { - if x != nil { - return x.Id - } - return nil -} - -func (m *TransactionsResponse) GetResponses() isTransactionsResponse_Responses { +func (m *TransactionsResponse) GetTransactionMessage() isTransactionsResponse_TransactionMessage { if m != nil { - return m.Responses + return m.TransactionMessage } return nil } -func (x *TransactionsResponse) GetTransactions() *Transactions { - if x, ok := x.GetResponses().(*TransactionsResponse_Transactions); ok { - return x.Transactions +func (x *TransactionsResponse) GetTransaction() *Transaction { + if x, ok := x.GetTransactionMessage().(*TransactionsResponse_Transaction); ok { + return x.Transaction } return nil } func (x *TransactionsResponse) GetFin() *Fin { - if x, ok := x.GetResponses().(*TransactionsResponse_Fin); ok { + if x, ok := x.GetTransactionMessage().(*TransactionsResponse_Fin); ok { return x.Fin } return nil } -type isTransactionsResponse_Responses interface { - isTransactionsResponse_Responses() +type isTransactionsResponse_TransactionMessage interface { + isTransactionsResponse_TransactionMessage() } -type TransactionsResponse_Transactions struct { - Transactions *Transactions `protobuf:"bytes,2,opt,name=transactions,proto3,oneof"` +type TransactionsResponse_Transaction struct { + Transaction *Transaction `protobuf:"bytes,1,opt,name=transaction,proto3,oneof"` } type TransactionsResponse_Fin struct { - Fin *Fin `protobuf:"bytes,3,opt,name=fin,proto3,oneof"` + Fin *Fin `protobuf:"bytes,2,opt,name=fin,proto3,oneof"` // Fin is sent after the peer sent all the data or when it encountered a block that it doesn't have its transactions. } -func (*TransactionsResponse_Transactions) isTransactionsResponse_Responses() {} +func (*TransactionsResponse_Transaction) isTransactionsResponse_TransactionMessage() {} -func (*TransactionsResponse_Fin) isTransactionsResponse_Responses() {} +func (*TransactionsResponse_Fin) isTransactionsResponse_TransactionMessage() {} type Transaction_DeclareV0 struct { state protoimpl.MessageState @@ -556,7 +564,7 @@ func (x *Transaction_DeclareV0) ProtoReflect() protoreflect.Message { // Deprecated: Use Transaction_DeclareV0.ProtoReflect.Descriptor instead. func (*Transaction_DeclareV0) Descriptor() ([]byte, []int) { - return file_p2p_proto_transaction_proto_rawDescGZIP(), []int{2, 0} + return file_p2p_proto_transaction_proto_rawDescGZIP(), []int{3, 0} } func (x *Transaction_DeclareV0) GetSender() *Address { @@ -628,7 +636,7 @@ func (x *Transaction_DeclareV1) ProtoReflect() protoreflect.Message { // Deprecated: Use Transaction_DeclareV1.ProtoReflect.Descriptor instead. func (*Transaction_DeclareV1) Descriptor() ([]byte, []int) { - return file_p2p_proto_transaction_proto_rawDescGZIP(), []int{2, 1} + return file_p2p_proto_transaction_proto_rawDescGZIP(), []int{3, 1} } func (x *Transaction_DeclareV1) GetSender() *Address { @@ -708,7 +716,7 @@ func (x *Transaction_DeclareV2) ProtoReflect() protoreflect.Message { // Deprecated: Use Transaction_DeclareV2.ProtoReflect.Descriptor instead. func (*Transaction_DeclareV2) Descriptor() ([]byte, []int) { - return file_p2p_proto_transaction_proto_rawDescGZIP(), []int{2, 2} + return file_p2p_proto_transaction_proto_rawDescGZIP(), []int{3, 2} } func (x *Transaction_DeclareV2) GetSender() *Address { @@ -753,23 +761,23 @@ func (x *Transaction_DeclareV2) GetCompiledClassHash() *Felt252 { return nil } +// see https://external.integration.starknet.io/feeder_gateway/get_transaction?transactionHash=0x41d1f5206ef58a443e7d3d1ca073171ec25fa75313394318fc83a074a6631c3 type Transaction_DeclareV3 struct { state protoimpl.MessageState sizeCache protoimpl.SizeCache unknownFields protoimpl.UnknownFields - Sender *Address `protobuf:"bytes,1,opt,name=sender,proto3" json:"sender,omitempty"` - MaxFee *Felt252 `protobuf:"bytes,2,opt,name=max_fee,json=maxFee,proto3" json:"max_fee,omitempty"` - Signature *AccountSignature `protobuf:"bytes,3,opt,name=signature,proto3" json:"signature,omitempty"` - ClassHash *Hash `protobuf:"bytes,4,opt,name=class_hash,json=classHash,proto3" json:"class_hash,omitempty"` - Nonce *Felt252 `protobuf:"bytes,5,opt,name=nonce,proto3" json:"nonce,omitempty"` - CompiledClassHash *Felt252 `protobuf:"bytes,6,opt,name=compiled_class_hash,json=compiledClassHash,proto3" json:"compiled_class_hash,omitempty"` - L1Gas *ResourceLimits `protobuf:"bytes,7,opt,name=l1_gas,json=l1Gas,proto3" json:"l1_gas,omitempty"` - L2Gas *ResourceLimits `protobuf:"bytes,8,opt,name=l2_gas,json=l2Gas,proto3" json:"l2_gas,omitempty"` - Tip *Felt252 `protobuf:"bytes,9,opt,name=tip,proto3" json:"tip,omitempty"` - Paymaster *Address `protobuf:"bytes,10,opt,name=paymaster,proto3" json:"paymaster,omitempty"` - NonceDomain string `protobuf:"bytes,11,opt,name=nonce_domain,json=nonceDomain,proto3" json:"nonce_domain,omitempty"` - FeeDomain string `protobuf:"bytes,12,opt,name=fee_domain,json=feeDomain,proto3" json:"fee_domain,omitempty"` + Sender *Address `protobuf:"bytes,1,opt,name=sender,proto3" json:"sender,omitempty"` + Signature *AccountSignature `protobuf:"bytes,2,opt,name=signature,proto3" json:"signature,omitempty"` + ClassHash *Hash `protobuf:"bytes,3,opt,name=class_hash,json=classHash,proto3" json:"class_hash,omitempty"` + Nonce *Felt252 `protobuf:"bytes,4,opt,name=nonce,proto3" json:"nonce,omitempty"` + CompiledClassHash *Felt252 `protobuf:"bytes,5,opt,name=compiled_class_hash,json=compiledClassHash,proto3" json:"compiled_class_hash,omitempty"` + ResourceBounds *ResourceBounds `protobuf:"bytes,6,opt,name=resource_bounds,json=resourceBounds,proto3" json:"resource_bounds,omitempty"` + Tip *Felt252 `protobuf:"bytes,7,opt,name=tip,proto3" json:"tip,omitempty"` + PaymasterData *Address `protobuf:"bytes,8,opt,name=paymaster_data,json=paymasterData,proto3" json:"paymaster_data,omitempty"` + AccountDeploymentData *Address `protobuf:"bytes,9,opt,name=account_deployment_data,json=accountDeploymentData,proto3" json:"account_deployment_data,omitempty"` + NonceDomain string `protobuf:"bytes,10,opt,name=nonce_domain,json=nonceDomain,proto3" json:"nonce_domain,omitempty"` // rename to nonce_data_availability_mode ? + FeeDomain string `protobuf:"bytes,11,opt,name=fee_domain,json=feeDomain,proto3" json:"fee_domain,omitempty"` // rename to fee_data_availability_mode ? } func (x *Transaction_DeclareV3) Reset() { @@ -801,7 +809,7 @@ func (x *Transaction_DeclareV3) ProtoReflect() protoreflect.Message { // Deprecated: Use Transaction_DeclareV3.ProtoReflect.Descriptor instead. func (*Transaction_DeclareV3) Descriptor() ([]byte, []int) { - return file_p2p_proto_transaction_proto_rawDescGZIP(), []int{2, 3} + return file_p2p_proto_transaction_proto_rawDescGZIP(), []int{3, 3} } func (x *Transaction_DeclareV3) GetSender() *Address { @@ -811,13 +819,6 @@ func (x *Transaction_DeclareV3) GetSender() *Address { return nil } -func (x *Transaction_DeclareV3) GetMaxFee() *Felt252 { - if x != nil { - return x.MaxFee - } - return nil -} - func (x *Transaction_DeclareV3) GetSignature() *AccountSignature { if x != nil { return x.Signature @@ -846,30 +847,30 @@ func (x *Transaction_DeclareV3) GetCompiledClassHash() *Felt252 { return nil } -func (x *Transaction_DeclareV3) GetL1Gas() *ResourceLimits { +func (x *Transaction_DeclareV3) GetResourceBounds() *ResourceBounds { if x != nil { - return x.L1Gas + return x.ResourceBounds } return nil } -func (x *Transaction_DeclareV3) GetL2Gas() *ResourceLimits { +func (x *Transaction_DeclareV3) GetTip() *Felt252 { if x != nil { - return x.L2Gas + return x.Tip } return nil } -func (x *Transaction_DeclareV3) GetTip() *Felt252 { +func (x *Transaction_DeclareV3) GetPaymasterData() *Address { if x != nil { - return x.Tip + return x.PaymasterData } return nil } -func (x *Transaction_DeclareV3) GetPaymaster() *Address { +func (x *Transaction_DeclareV3) GetAccountDeploymentData() *Address { if x != nil { - return x.Paymaster + return x.AccountDeploymentData } return nil } @@ -896,6 +897,7 @@ type Transaction_Deploy struct { ClassHash *Hash `protobuf:"bytes,1,opt,name=class_hash,json=classHash,proto3" json:"class_hash,omitempty"` AddressSalt *Felt252 `protobuf:"bytes,2,opt,name=address_salt,json=addressSalt,proto3" json:"address_salt,omitempty"` Calldata []*Felt252 `protobuf:"bytes,3,rep,name=calldata,proto3" json:"calldata,omitempty"` + Version uint32 `protobuf:"varint,4,opt,name=version,proto3" json:"version,omitempty"` } func (x *Transaction_Deploy) Reset() { @@ -927,7 +929,7 @@ func (x *Transaction_Deploy) ProtoReflect() protoreflect.Message { // Deprecated: Use Transaction_Deploy.ProtoReflect.Descriptor instead. func (*Transaction_Deploy) Descriptor() ([]byte, []int) { - return file_p2p_proto_transaction_proto_rawDescGZIP(), []int{2, 4} + return file_p2p_proto_transaction_proto_rawDescGZIP(), []int{3, 4} } func (x *Transaction_Deploy) GetClassHash() *Hash { @@ -951,6 +953,13 @@ func (x *Transaction_Deploy) GetCalldata() []*Felt252 { return nil } +func (x *Transaction_Deploy) GetVersion() uint32 { + if x != nil { + return x.Version + } + return 0 +} + type Transaction_DeployAccountV1 struct { state protoimpl.MessageState sizeCache protoimpl.SizeCache @@ -993,7 +1002,7 @@ func (x *Transaction_DeployAccountV1) ProtoReflect() protoreflect.Message { // Deprecated: Use Transaction_DeployAccountV1.ProtoReflect.Descriptor instead. func (*Transaction_DeployAccountV1) Descriptor() ([]byte, []int) { - return file_p2p_proto_transaction_proto_rawDescGZIP(), []int{2, 5} + return file_p2p_proto_transaction_proto_rawDescGZIP(), []int{3, 5} } func (x *Transaction_DeployAccountV1) GetMaxFee() *Felt252 { @@ -1038,23 +1047,22 @@ func (x *Transaction_DeployAccountV1) GetCalldata() []*Felt252 { return nil } +// see https://external.integration.starknet.io/feeder_gateway/get_transaction?transactionHash=0x29fd7881f14380842414cdfdd8d6c0b1f2174f8916edcfeb1ede1eb26ac3ef0 type Transaction_DeployAccountV3 struct { state protoimpl.MessageState sizeCache protoimpl.SizeCache unknownFields protoimpl.UnknownFields - MaxFee *Felt252 `protobuf:"bytes,1,opt,name=max_fee,json=maxFee,proto3" json:"max_fee,omitempty"` - Signature *AccountSignature `protobuf:"bytes,2,opt,name=signature,proto3" json:"signature,omitempty"` - ClassHash *Hash `protobuf:"bytes,3,opt,name=class_hash,json=classHash,proto3" json:"class_hash,omitempty"` - Nonce *Felt252 `protobuf:"bytes,4,opt,name=nonce,proto3" json:"nonce,omitempty"` - AddressSalt *Felt252 `protobuf:"bytes,5,opt,name=address_salt,json=addressSalt,proto3" json:"address_salt,omitempty"` - Calldata []*Felt252 `protobuf:"bytes,6,rep,name=calldata,proto3" json:"calldata,omitempty"` - L1Gas *ResourceLimits `protobuf:"bytes,7,opt,name=l1_gas,json=l1Gas,proto3" json:"l1_gas,omitempty"` - L2Gas *ResourceLimits `protobuf:"bytes,8,opt,name=l2_gas,json=l2Gas,proto3" json:"l2_gas,omitempty"` - Tip *Felt252 `protobuf:"bytes,9,opt,name=tip,proto3" json:"tip,omitempty"` - Paymaster *Address `protobuf:"bytes,10,opt,name=paymaster,proto3" json:"paymaster,omitempty"` - NonceDomain string `protobuf:"bytes,11,opt,name=nonce_domain,json=nonceDomain,proto3" json:"nonce_domain,omitempty"` - FeeDomain string `protobuf:"bytes,12,opt,name=fee_domain,json=feeDomain,proto3" json:"fee_domain,omitempty"` + Signature *AccountSignature `protobuf:"bytes,1,opt,name=signature,proto3" json:"signature,omitempty"` + ClassHash *Hash `protobuf:"bytes,2,opt,name=class_hash,json=classHash,proto3" json:"class_hash,omitempty"` + Nonce *Felt252 `protobuf:"bytes,3,opt,name=nonce,proto3" json:"nonce,omitempty"` + AddressSalt *Felt252 `protobuf:"bytes,4,opt,name=address_salt,json=addressSalt,proto3" json:"address_salt,omitempty"` + Calldata []*Felt252 `protobuf:"bytes,5,rep,name=calldata,proto3" json:"calldata,omitempty"` + ResourceBounds *ResourceBounds `protobuf:"bytes,6,opt,name=resource_bounds,json=resourceBounds,proto3" json:"resource_bounds,omitempty"` + Tip *Felt252 `protobuf:"bytes,7,opt,name=tip,proto3" json:"tip,omitempty"` + PaymasterData *Address `protobuf:"bytes,8,opt,name=paymaster_data,json=paymasterData,proto3" json:"paymaster_data,omitempty"` + NonceDomain string `protobuf:"bytes,9,opt,name=nonce_domain,json=nonceDomain,proto3" json:"nonce_domain,omitempty"` // rename to nonce_data_availability_mode ? + FeeDomain string `protobuf:"bytes,10,opt,name=fee_domain,json=feeDomain,proto3" json:"fee_domain,omitempty"` // rename to fee_data_availability_mode ? } func (x *Transaction_DeployAccountV3) Reset() { @@ -1086,14 +1094,7 @@ func (x *Transaction_DeployAccountV3) ProtoReflect() protoreflect.Message { // Deprecated: Use Transaction_DeployAccountV3.ProtoReflect.Descriptor instead. func (*Transaction_DeployAccountV3) Descriptor() ([]byte, []int) { - return file_p2p_proto_transaction_proto_rawDescGZIP(), []int{2, 6} -} - -func (x *Transaction_DeployAccountV3) GetMaxFee() *Felt252 { - if x != nil { - return x.MaxFee - } - return nil + return file_p2p_proto_transaction_proto_rawDescGZIP(), []int{3, 6} } func (x *Transaction_DeployAccountV3) GetSignature() *AccountSignature { @@ -1131,16 +1132,9 @@ func (x *Transaction_DeployAccountV3) GetCalldata() []*Felt252 { return nil } -func (x *Transaction_DeployAccountV3) GetL1Gas() *ResourceLimits { - if x != nil { - return x.L1Gas - } - return nil -} - -func (x *Transaction_DeployAccountV3) GetL2Gas() *ResourceLimits { +func (x *Transaction_DeployAccountV3) GetResourceBounds() *ResourceBounds { if x != nil { - return x.L2Gas + return x.ResourceBounds } return nil } @@ -1152,9 +1146,9 @@ func (x *Transaction_DeployAccountV3) GetTip() *Felt252 { return nil } -func (x *Transaction_DeployAccountV3) GetPaymaster() *Address { +func (x *Transaction_DeployAccountV3) GetPaymasterData() *Address { if x != nil { - return x.Paymaster + return x.PaymasterData } return nil } @@ -1214,7 +1208,7 @@ func (x *Transaction_InvokeV0) ProtoReflect() protoreflect.Message { // Deprecated: Use Transaction_InvokeV0.ProtoReflect.Descriptor instead. func (*Transaction_InvokeV0) Descriptor() ([]byte, []int) { - return file_p2p_proto_transaction_proto_rawDescGZIP(), []int{2, 7} + return file_p2p_proto_transaction_proto_rawDescGZIP(), []int{3, 7} } func (x *Transaction_InvokeV0) GetMaxFee() *Felt252 { @@ -1293,7 +1287,7 @@ func (x *Transaction_InvokeV1) ProtoReflect() protoreflect.Message { // Deprecated: Use Transaction_InvokeV1.ProtoReflect.Descriptor instead. func (*Transaction_InvokeV1) Descriptor() ([]byte, []int) { - return file_p2p_proto_transaction_proto_rawDescGZIP(), []int{2, 8} + return file_p2p_proto_transaction_proto_rawDescGZIP(), []int{3, 8} } func (x *Transaction_InvokeV1) GetSender() *Address { @@ -1331,22 +1325,22 @@ func (x *Transaction_InvokeV1) GetNonce() *Felt252 { return nil } +// see https://external.integration.starknet.io/feeder_gateway/get_transaction?transactionHash=0x41906f1c314cca5f43170ea75d3b1904196a10101190d2b12a41cc61cfd17c type Transaction_InvokeV3 struct { state protoimpl.MessageState sizeCache protoimpl.SizeCache unknownFields protoimpl.UnknownFields - Sender *Address `protobuf:"bytes,1,opt,name=sender,proto3" json:"sender,omitempty"` - MaxFee *Felt252 `protobuf:"bytes,2,opt,name=max_fee,json=maxFee,proto3" json:"max_fee,omitempty"` - Signature *AccountSignature `protobuf:"bytes,3,opt,name=signature,proto3" json:"signature,omitempty"` - Calldata []*Felt252 `protobuf:"bytes,4,rep,name=calldata,proto3" json:"calldata,omitempty"` - L1Gas *ResourceLimits `protobuf:"bytes,5,opt,name=l1_gas,json=l1Gas,proto3" json:"l1_gas,omitempty"` - L2Gas *ResourceLimits `protobuf:"bytes,6,opt,name=l2_gas,json=l2Gas,proto3" json:"l2_gas,omitempty"` - Tip *Felt252 `protobuf:"bytes,7,opt,name=tip,proto3" json:"tip,omitempty"` - Paymaster *Address `protobuf:"bytes,8,opt,name=paymaster,proto3" json:"paymaster,omitempty"` - NonceDomain string `protobuf:"bytes,9,opt,name=nonce_domain,json=nonceDomain,proto3" json:"nonce_domain,omitempty"` - FeeDomain string `protobuf:"bytes,10,opt,name=fee_domain,json=feeDomain,proto3" json:"fee_domain,omitempty"` - Nonce *Felt252 `protobuf:"bytes,11,opt,name=nonce,proto3" json:"nonce,omitempty"` + Sender *Address `protobuf:"bytes,1,opt,name=sender,proto3" json:"sender,omitempty"` + Signature *AccountSignature `protobuf:"bytes,2,opt,name=signature,proto3" json:"signature,omitempty"` + Calldata []*Felt252 `protobuf:"bytes,3,rep,name=calldata,proto3" json:"calldata,omitempty"` + ResourceBounds *ResourceBounds `protobuf:"bytes,4,opt,name=resource_bounds,json=resourceBounds,proto3" json:"resource_bounds,omitempty"` + Tip *Felt252 `protobuf:"bytes,5,opt,name=tip,proto3" json:"tip,omitempty"` + PaymasterData *Address `protobuf:"bytes,6,opt,name=paymaster_data,json=paymasterData,proto3" json:"paymaster_data,omitempty"` + AccountDeploymentData *Address `protobuf:"bytes,7,opt,name=account_deployment_data,json=accountDeploymentData,proto3" json:"account_deployment_data,omitempty"` + NonceDomain string `protobuf:"bytes,8,opt,name=nonce_domain,json=nonceDomain,proto3" json:"nonce_domain,omitempty"` // rename to nonce_data_availability_mode ? + FeeDomain string `protobuf:"bytes,9,opt,name=fee_domain,json=feeDomain,proto3" json:"fee_domain,omitempty"` // rename to fee_data_availability_mode ? + Nonce *Felt252 `protobuf:"bytes,10,opt,name=nonce,proto3" json:"nonce,omitempty"` } func (x *Transaction_InvokeV3) Reset() { @@ -1378,7 +1372,7 @@ func (x *Transaction_InvokeV3) ProtoReflect() protoreflect.Message { // Deprecated: Use Transaction_InvokeV3.ProtoReflect.Descriptor instead. func (*Transaction_InvokeV3) Descriptor() ([]byte, []int) { - return file_p2p_proto_transaction_proto_rawDescGZIP(), []int{2, 9} + return file_p2p_proto_transaction_proto_rawDescGZIP(), []int{3, 9} } func (x *Transaction_InvokeV3) GetSender() *Address { @@ -1388,13 +1382,6 @@ func (x *Transaction_InvokeV3) GetSender() *Address { return nil } -func (x *Transaction_InvokeV3) GetMaxFee() *Felt252 { - if x != nil { - return x.MaxFee - } - return nil -} - func (x *Transaction_InvokeV3) GetSignature() *AccountSignature { if x != nil { return x.Signature @@ -1409,30 +1396,30 @@ func (x *Transaction_InvokeV3) GetCalldata() []*Felt252 { return nil } -func (x *Transaction_InvokeV3) GetL1Gas() *ResourceLimits { +func (x *Transaction_InvokeV3) GetResourceBounds() *ResourceBounds { if x != nil { - return x.L1Gas + return x.ResourceBounds } return nil } -func (x *Transaction_InvokeV3) GetL2Gas() *ResourceLimits { +func (x *Transaction_InvokeV3) GetTip() *Felt252 { if x != nil { - return x.L2Gas + return x.Tip } return nil } -func (x *Transaction_InvokeV3) GetTip() *Felt252 { +func (x *Transaction_InvokeV3) GetPaymasterData() *Address { if x != nil { - return x.Tip + return x.PaymasterData } return nil } -func (x *Transaction_InvokeV3) GetPaymaster() *Address { +func (x *Transaction_InvokeV3) GetAccountDeploymentData() *Address { if x != nil { - return x.Paymaster + return x.AccountDeploymentData } return nil } @@ -1458,7 +1445,7 @@ func (x *Transaction_InvokeV3) GetNonce() *Felt252 { return nil } -type Transaction_L1HandlerV1 struct { +type Transaction_L1HandlerV0 struct { state protoimpl.MessageState sizeCache protoimpl.SizeCache unknownFields protoimpl.UnknownFields @@ -1469,8 +1456,8 @@ type Transaction_L1HandlerV1 struct { Calldata []*Felt252 `protobuf:"bytes,4,rep,name=calldata,proto3" json:"calldata,omitempty"` } -func (x *Transaction_L1HandlerV1) Reset() { - *x = Transaction_L1HandlerV1{} +func (x *Transaction_L1HandlerV0) Reset() { + *x = Transaction_L1HandlerV0{} if protoimpl.UnsafeEnabled { mi := &file_p2p_proto_transaction_proto_msgTypes[16] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) @@ -1478,13 +1465,13 @@ func (x *Transaction_L1HandlerV1) Reset() { } } -func (x *Transaction_L1HandlerV1) String() string { +func (x *Transaction_L1HandlerV0) String() string { return protoimpl.X.MessageStringOf(x) } -func (*Transaction_L1HandlerV1) ProtoMessage() {} +func (*Transaction_L1HandlerV0) ProtoMessage() {} -func (x *Transaction_L1HandlerV1) ProtoReflect() protoreflect.Message { +func (x *Transaction_L1HandlerV0) ProtoReflect() protoreflect.Message { mi := &file_p2p_proto_transaction_proto_msgTypes[16] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) @@ -1496,33 +1483,33 @@ func (x *Transaction_L1HandlerV1) ProtoReflect() protoreflect.Message { return mi.MessageOf(x) } -// Deprecated: Use Transaction_L1HandlerV1.ProtoReflect.Descriptor instead. -func (*Transaction_L1HandlerV1) Descriptor() ([]byte, []int) { - return file_p2p_proto_transaction_proto_rawDescGZIP(), []int{2, 10} +// Deprecated: Use Transaction_L1HandlerV0.ProtoReflect.Descriptor instead. +func (*Transaction_L1HandlerV0) Descriptor() ([]byte, []int) { + return file_p2p_proto_transaction_proto_rawDescGZIP(), []int{3, 10} } -func (x *Transaction_L1HandlerV1) GetNonce() *Felt252 { +func (x *Transaction_L1HandlerV0) GetNonce() *Felt252 { if x != nil { return x.Nonce } return nil } -func (x *Transaction_L1HandlerV1) GetAddress() *Address { +func (x *Transaction_L1HandlerV0) GetAddress() *Address { if x != nil { return x.Address } return nil } -func (x *Transaction_L1HandlerV1) GetEntryPointSelector() *Felt252 { +func (x *Transaction_L1HandlerV0) GetEntryPointSelector() *Felt252 { if x != nil { return x.EntryPointSelector } return nil } -func (x *Transaction_L1HandlerV1) GetCalldata() []*Felt252 { +func (x *Transaction_L1HandlerV0) GetCalldata() []*Felt252 { if x != nil { return x.Calldata } @@ -1542,76 +1529,62 @@ var file_p2p_proto_transaction_proto_rawDesc = []byte{ 0x12, 0x35, 0x0a, 0x12, 0x6d, 0x61, 0x78, 0x5f, 0x70, 0x72, 0x69, 0x63, 0x65, 0x5f, 0x70, 0x65, 0x72, 0x5f, 0x75, 0x6e, 0x69, 0x74, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x08, 0x2e, 0x46, 0x65, 0x6c, 0x74, 0x32, 0x35, 0x32, 0x52, 0x0f, 0x6d, 0x61, 0x78, 0x50, 0x72, 0x69, 0x63, 0x65, - 0x50, 0x65, 0x72, 0x55, 0x6e, 0x69, 0x74, 0x22, 0x32, 0x0a, 0x10, 0x41, 0x63, 0x63, 0x6f, 0x75, - 0x6e, 0x74, 0x53, 0x69, 0x67, 0x6e, 0x61, 0x74, 0x75, 0x72, 0x65, 0x12, 0x1e, 0x0a, 0x05, 0x70, - 0x61, 0x72, 0x74, 0x73, 0x18, 0x01, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x08, 0x2e, 0x46, 0x65, 0x6c, - 0x74, 0x32, 0x35, 0x32, 0x52, 0x05, 0x70, 0x61, 0x72, 0x74, 0x73, 0x22, 0xcf, 0x1c, 0x0a, 0x0b, - 0x54, 0x72, 0x61, 0x6e, 0x73, 0x61, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x12, 0x37, 0x0a, 0x0a, 0x64, - 0x65, 0x63, 0x6c, 0x61, 0x72, 0x65, 0x5f, 0x76, 0x30, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, - 0x16, 0x2e, 0x54, 0x72, 0x61, 0x6e, 0x73, 0x61, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x2e, 0x44, 0x65, - 0x63, 0x6c, 0x61, 0x72, 0x65, 0x56, 0x30, 0x48, 0x00, 0x52, 0x09, 0x64, 0x65, 0x63, 0x6c, 0x61, - 0x72, 0x65, 0x56, 0x30, 0x12, 0x37, 0x0a, 0x0a, 0x64, 0x65, 0x63, 0x6c, 0x61, 0x72, 0x65, 0x5f, - 0x76, 0x31, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x16, 0x2e, 0x54, 0x72, 0x61, 0x6e, 0x73, - 0x61, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x2e, 0x44, 0x65, 0x63, 0x6c, 0x61, 0x72, 0x65, 0x56, 0x31, - 0x48, 0x00, 0x52, 0x09, 0x64, 0x65, 0x63, 0x6c, 0x61, 0x72, 0x65, 0x56, 0x31, 0x12, 0x37, 0x0a, - 0x0a, 0x64, 0x65, 0x63, 0x6c, 0x61, 0x72, 0x65, 0x5f, 0x76, 0x32, 0x18, 0x03, 0x20, 0x01, 0x28, + 0x50, 0x65, 0x72, 0x55, 0x6e, 0x69, 0x74, 0x22, 0x60, 0x0a, 0x0e, 0x52, 0x65, 0x73, 0x6f, 0x75, + 0x72, 0x63, 0x65, 0x42, 0x6f, 0x75, 0x6e, 0x64, 0x73, 0x12, 0x26, 0x0a, 0x06, 0x6c, 0x31, 0x5f, + 0x67, 0x61, 0x73, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x0f, 0x2e, 0x52, 0x65, 0x73, 0x6f, + 0x75, 0x72, 0x63, 0x65, 0x4c, 0x69, 0x6d, 0x69, 0x74, 0x73, 0x52, 0x05, 0x6c, 0x31, 0x47, 0x61, + 0x73, 0x12, 0x26, 0x0a, 0x06, 0x6c, 0x32, 0x5f, 0x67, 0x61, 0x73, 0x18, 0x02, 0x20, 0x01, 0x28, + 0x0b, 0x32, 0x0f, 0x2e, 0x52, 0x65, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x4c, 0x69, 0x6d, 0x69, + 0x74, 0x73, 0x52, 0x05, 0x6c, 0x32, 0x47, 0x61, 0x73, 0x22, 0x32, 0x0a, 0x10, 0x41, 0x63, 0x63, + 0x6f, 0x75, 0x6e, 0x74, 0x53, 0x69, 0x67, 0x6e, 0x61, 0x74, 0x75, 0x72, 0x65, 0x12, 0x1e, 0x0a, + 0x05, 0x70, 0x61, 0x72, 0x74, 0x73, 0x18, 0x01, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x08, 0x2e, 0x46, + 0x65, 0x6c, 0x74, 0x32, 0x35, 0x32, 0x52, 0x05, 0x70, 0x61, 0x72, 0x74, 0x73, 0x22, 0x8f, 0x1d, + 0x0a, 0x0b, 0x54, 0x72, 0x61, 0x6e, 0x73, 0x61, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x12, 0x37, 0x0a, + 0x0a, 0x64, 0x65, 0x63, 0x6c, 0x61, 0x72, 0x65, 0x5f, 0x76, 0x30, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x16, 0x2e, 0x54, 0x72, 0x61, 0x6e, 0x73, 0x61, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x2e, - 0x44, 0x65, 0x63, 0x6c, 0x61, 0x72, 0x65, 0x56, 0x32, 0x48, 0x00, 0x52, 0x09, 0x64, 0x65, 0x63, - 0x6c, 0x61, 0x72, 0x65, 0x56, 0x32, 0x12, 0x37, 0x0a, 0x0a, 0x64, 0x65, 0x63, 0x6c, 0x61, 0x72, - 0x65, 0x5f, 0x76, 0x33, 0x18, 0x04, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x16, 0x2e, 0x54, 0x72, 0x61, + 0x44, 0x65, 0x63, 0x6c, 0x61, 0x72, 0x65, 0x56, 0x30, 0x48, 0x00, 0x52, 0x09, 0x64, 0x65, 0x63, + 0x6c, 0x61, 0x72, 0x65, 0x56, 0x30, 0x12, 0x37, 0x0a, 0x0a, 0x64, 0x65, 0x63, 0x6c, 0x61, 0x72, + 0x65, 0x5f, 0x76, 0x31, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x16, 0x2e, 0x54, 0x72, 0x61, 0x6e, 0x73, 0x61, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x2e, 0x44, 0x65, 0x63, 0x6c, 0x61, 0x72, 0x65, - 0x56, 0x33, 0x48, 0x00, 0x52, 0x09, 0x64, 0x65, 0x63, 0x6c, 0x61, 0x72, 0x65, 0x56, 0x33, 0x12, - 0x2d, 0x0a, 0x06, 0x64, 0x65, 0x70, 0x6c, 0x6f, 0x79, 0x18, 0x05, 0x20, 0x01, 0x28, 0x0b, 0x32, - 0x13, 0x2e, 0x54, 0x72, 0x61, 0x6e, 0x73, 0x61, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x2e, 0x44, 0x65, - 0x70, 0x6c, 0x6f, 0x79, 0x48, 0x00, 0x52, 0x06, 0x64, 0x65, 0x70, 0x6c, 0x6f, 0x79, 0x12, 0x4a, - 0x0a, 0x11, 0x64, 0x65, 0x70, 0x6c, 0x6f, 0x79, 0x5f, 0x61, 0x63, 0x63, 0x6f, 0x75, 0x6e, 0x74, - 0x5f, 0x76, 0x31, 0x18, 0x06, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1c, 0x2e, 0x54, 0x72, 0x61, 0x6e, - 0x73, 0x61, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x2e, 0x44, 0x65, 0x70, 0x6c, 0x6f, 0x79, 0x41, 0x63, - 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x56, 0x31, 0x48, 0x00, 0x52, 0x0f, 0x64, 0x65, 0x70, 0x6c, 0x6f, - 0x79, 0x41, 0x63, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x56, 0x31, 0x12, 0x4a, 0x0a, 0x11, 0x64, 0x65, - 0x70, 0x6c, 0x6f, 0x79, 0x5f, 0x61, 0x63, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x5f, 0x76, 0x33, 0x18, - 0x07, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1c, 0x2e, 0x54, 0x72, 0x61, 0x6e, 0x73, 0x61, 0x63, 0x74, - 0x69, 0x6f, 0x6e, 0x2e, 0x44, 0x65, 0x70, 0x6c, 0x6f, 0x79, 0x41, 0x63, 0x63, 0x6f, 0x75, 0x6e, - 0x74, 0x56, 0x33, 0x48, 0x00, 0x52, 0x0f, 0x64, 0x65, 0x70, 0x6c, 0x6f, 0x79, 0x41, 0x63, 0x63, - 0x6f, 0x75, 0x6e, 0x74, 0x56, 0x33, 0x12, 0x34, 0x0a, 0x09, 0x69, 0x6e, 0x76, 0x6f, 0x6b, 0x65, - 0x5f, 0x76, 0x30, 0x18, 0x08, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x15, 0x2e, 0x54, 0x72, 0x61, 0x6e, - 0x73, 0x61, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x2e, 0x49, 0x6e, 0x76, 0x6f, 0x6b, 0x65, 0x56, 0x30, - 0x48, 0x00, 0x52, 0x08, 0x69, 0x6e, 0x76, 0x6f, 0x6b, 0x65, 0x56, 0x30, 0x12, 0x34, 0x0a, 0x09, - 0x69, 0x6e, 0x76, 0x6f, 0x6b, 0x65, 0x5f, 0x76, 0x31, 0x18, 0x09, 0x20, 0x01, 0x28, 0x0b, 0x32, - 0x15, 0x2e, 0x54, 0x72, 0x61, 0x6e, 0x73, 0x61, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x2e, 0x49, 0x6e, - 0x76, 0x6f, 0x6b, 0x65, 0x56, 0x31, 0x48, 0x00, 0x52, 0x08, 0x69, 0x6e, 0x76, 0x6f, 0x6b, 0x65, - 0x56, 0x31, 0x12, 0x34, 0x0a, 0x09, 0x69, 0x6e, 0x76, 0x6f, 0x6b, 0x65, 0x5f, 0x76, 0x33, 0x18, - 0x0a, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x15, 0x2e, 0x54, 0x72, 0x61, 0x6e, 0x73, 0x61, 0x63, 0x74, - 0x69, 0x6f, 0x6e, 0x2e, 0x49, 0x6e, 0x76, 0x6f, 0x6b, 0x65, 0x56, 0x33, 0x48, 0x00, 0x52, 0x08, - 0x69, 0x6e, 0x76, 0x6f, 0x6b, 0x65, 0x56, 0x33, 0x12, 0x39, 0x0a, 0x0a, 0x6c, 0x31, 0x5f, 0x68, - 0x61, 0x6e, 0x64, 0x6c, 0x65, 0x72, 0x18, 0x0b, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x18, 0x2e, 0x54, - 0x72, 0x61, 0x6e, 0x73, 0x61, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x2e, 0x4c, 0x31, 0x48, 0x61, 0x6e, - 0x64, 0x6c, 0x65, 0x72, 0x56, 0x31, 0x48, 0x00, 0x52, 0x09, 0x6c, 0x31, 0x48, 0x61, 0x6e, 0x64, - 0x6c, 0x65, 0x72, 0x1a, 0xa7, 0x01, 0x0a, 0x09, 0x44, 0x65, 0x63, 0x6c, 0x61, 0x72, 0x65, 0x56, - 0x30, 0x12, 0x20, 0x0a, 0x06, 0x73, 0x65, 0x6e, 0x64, 0x65, 0x72, 0x18, 0x01, 0x20, 0x01, 0x28, - 0x0b, 0x32, 0x08, 0x2e, 0x41, 0x64, 0x64, 0x72, 0x65, 0x73, 0x73, 0x52, 0x06, 0x73, 0x65, 0x6e, - 0x64, 0x65, 0x72, 0x12, 0x21, 0x0a, 0x07, 0x6d, 0x61, 0x78, 0x5f, 0x66, 0x65, 0x65, 0x18, 0x02, - 0x20, 0x01, 0x28, 0x0b, 0x32, 0x08, 0x2e, 0x46, 0x65, 0x6c, 0x74, 0x32, 0x35, 0x32, 0x52, 0x06, - 0x6d, 0x61, 0x78, 0x46, 0x65, 0x65, 0x12, 0x2f, 0x0a, 0x09, 0x73, 0x69, 0x67, 0x6e, 0x61, 0x74, - 0x75, 0x72, 0x65, 0x18, 0x03, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x11, 0x2e, 0x41, 0x63, 0x63, 0x6f, - 0x75, 0x6e, 0x74, 0x53, 0x69, 0x67, 0x6e, 0x61, 0x74, 0x75, 0x72, 0x65, 0x52, 0x09, 0x73, 0x69, - 0x67, 0x6e, 0x61, 0x74, 0x75, 0x72, 0x65, 0x12, 0x24, 0x0a, 0x0a, 0x63, 0x6c, 0x61, 0x73, 0x73, - 0x5f, 0x68, 0x61, 0x73, 0x68, 0x18, 0x04, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x05, 0x2e, 0x48, 0x61, - 0x73, 0x68, 0x52, 0x09, 0x63, 0x6c, 0x61, 0x73, 0x73, 0x48, 0x61, 0x73, 0x68, 0x1a, 0xc7, 0x01, - 0x0a, 0x09, 0x44, 0x65, 0x63, 0x6c, 0x61, 0x72, 0x65, 0x56, 0x31, 0x12, 0x20, 0x0a, 0x06, 0x73, - 0x65, 0x6e, 0x64, 0x65, 0x72, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x08, 0x2e, 0x41, 0x64, - 0x64, 0x72, 0x65, 0x73, 0x73, 0x52, 0x06, 0x73, 0x65, 0x6e, 0x64, 0x65, 0x72, 0x12, 0x21, 0x0a, - 0x07, 0x6d, 0x61, 0x78, 0x5f, 0x66, 0x65, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x08, - 0x2e, 0x46, 0x65, 0x6c, 0x74, 0x32, 0x35, 0x32, 0x52, 0x06, 0x6d, 0x61, 0x78, 0x46, 0x65, 0x65, - 0x12, 0x2f, 0x0a, 0x09, 0x73, 0x69, 0x67, 0x6e, 0x61, 0x74, 0x75, 0x72, 0x65, 0x18, 0x03, 0x20, - 0x01, 0x28, 0x0b, 0x32, 0x11, 0x2e, 0x41, 0x63, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x53, 0x69, 0x67, - 0x6e, 0x61, 0x74, 0x75, 0x72, 0x65, 0x52, 0x09, 0x73, 0x69, 0x67, 0x6e, 0x61, 0x74, 0x75, 0x72, - 0x65, 0x12, 0x24, 0x0a, 0x0a, 0x63, 0x6c, 0x61, 0x73, 0x73, 0x5f, 0x68, 0x61, 0x73, 0x68, 0x18, - 0x04, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x05, 0x2e, 0x48, 0x61, 0x73, 0x68, 0x52, 0x09, 0x63, 0x6c, - 0x61, 0x73, 0x73, 0x48, 0x61, 0x73, 0x68, 0x12, 0x1e, 0x0a, 0x05, 0x6e, 0x6f, 0x6e, 0x63, 0x65, - 0x18, 0x05, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x08, 0x2e, 0x46, 0x65, 0x6c, 0x74, 0x32, 0x35, 0x32, - 0x52, 0x05, 0x6e, 0x6f, 0x6e, 0x63, 0x65, 0x1a, 0x81, 0x02, 0x0a, 0x09, 0x44, 0x65, 0x63, 0x6c, - 0x61, 0x72, 0x65, 0x56, 0x32, 0x12, 0x20, 0x0a, 0x06, 0x73, 0x65, 0x6e, 0x64, 0x65, 0x72, 0x18, + 0x56, 0x31, 0x48, 0x00, 0x52, 0x09, 0x64, 0x65, 0x63, 0x6c, 0x61, 0x72, 0x65, 0x56, 0x31, 0x12, + 0x37, 0x0a, 0x0a, 0x64, 0x65, 0x63, 0x6c, 0x61, 0x72, 0x65, 0x5f, 0x76, 0x32, 0x18, 0x03, 0x20, + 0x01, 0x28, 0x0b, 0x32, 0x16, 0x2e, 0x54, 0x72, 0x61, 0x6e, 0x73, 0x61, 0x63, 0x74, 0x69, 0x6f, + 0x6e, 0x2e, 0x44, 0x65, 0x63, 0x6c, 0x61, 0x72, 0x65, 0x56, 0x32, 0x48, 0x00, 0x52, 0x09, 0x64, + 0x65, 0x63, 0x6c, 0x61, 0x72, 0x65, 0x56, 0x32, 0x12, 0x37, 0x0a, 0x0a, 0x64, 0x65, 0x63, 0x6c, + 0x61, 0x72, 0x65, 0x5f, 0x76, 0x33, 0x18, 0x04, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x16, 0x2e, 0x54, + 0x72, 0x61, 0x6e, 0x73, 0x61, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x2e, 0x44, 0x65, 0x63, 0x6c, 0x61, + 0x72, 0x65, 0x56, 0x33, 0x48, 0x00, 0x52, 0x09, 0x64, 0x65, 0x63, 0x6c, 0x61, 0x72, 0x65, 0x56, + 0x33, 0x12, 0x2d, 0x0a, 0x06, 0x64, 0x65, 0x70, 0x6c, 0x6f, 0x79, 0x18, 0x05, 0x20, 0x01, 0x28, + 0x0b, 0x32, 0x13, 0x2e, 0x54, 0x72, 0x61, 0x6e, 0x73, 0x61, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x2e, + 0x44, 0x65, 0x70, 0x6c, 0x6f, 0x79, 0x48, 0x00, 0x52, 0x06, 0x64, 0x65, 0x70, 0x6c, 0x6f, 0x79, + 0x12, 0x4a, 0x0a, 0x11, 0x64, 0x65, 0x70, 0x6c, 0x6f, 0x79, 0x5f, 0x61, 0x63, 0x63, 0x6f, 0x75, + 0x6e, 0x74, 0x5f, 0x76, 0x31, 0x18, 0x06, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1c, 0x2e, 0x54, 0x72, + 0x61, 0x6e, 0x73, 0x61, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x2e, 0x44, 0x65, 0x70, 0x6c, 0x6f, 0x79, + 0x41, 0x63, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x56, 0x31, 0x48, 0x00, 0x52, 0x0f, 0x64, 0x65, 0x70, + 0x6c, 0x6f, 0x79, 0x41, 0x63, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x56, 0x31, 0x12, 0x4a, 0x0a, 0x11, + 0x64, 0x65, 0x70, 0x6c, 0x6f, 0x79, 0x5f, 0x61, 0x63, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x5f, 0x76, + 0x33, 0x18, 0x07, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1c, 0x2e, 0x54, 0x72, 0x61, 0x6e, 0x73, 0x61, + 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x2e, 0x44, 0x65, 0x70, 0x6c, 0x6f, 0x79, 0x41, 0x63, 0x63, 0x6f, + 0x75, 0x6e, 0x74, 0x56, 0x33, 0x48, 0x00, 0x52, 0x0f, 0x64, 0x65, 0x70, 0x6c, 0x6f, 0x79, 0x41, + 0x63, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x56, 0x33, 0x12, 0x34, 0x0a, 0x09, 0x69, 0x6e, 0x76, 0x6f, + 0x6b, 0x65, 0x5f, 0x76, 0x30, 0x18, 0x08, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x15, 0x2e, 0x54, 0x72, + 0x61, 0x6e, 0x73, 0x61, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x2e, 0x49, 0x6e, 0x76, 0x6f, 0x6b, 0x65, + 0x56, 0x30, 0x48, 0x00, 0x52, 0x08, 0x69, 0x6e, 0x76, 0x6f, 0x6b, 0x65, 0x56, 0x30, 0x12, 0x34, + 0x0a, 0x09, 0x69, 0x6e, 0x76, 0x6f, 0x6b, 0x65, 0x5f, 0x76, 0x31, 0x18, 0x09, 0x20, 0x01, 0x28, + 0x0b, 0x32, 0x15, 0x2e, 0x54, 0x72, 0x61, 0x6e, 0x73, 0x61, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x2e, + 0x49, 0x6e, 0x76, 0x6f, 0x6b, 0x65, 0x56, 0x31, 0x48, 0x00, 0x52, 0x08, 0x69, 0x6e, 0x76, 0x6f, + 0x6b, 0x65, 0x56, 0x31, 0x12, 0x34, 0x0a, 0x09, 0x69, 0x6e, 0x76, 0x6f, 0x6b, 0x65, 0x5f, 0x76, + 0x33, 0x18, 0x0a, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x15, 0x2e, 0x54, 0x72, 0x61, 0x6e, 0x73, 0x61, + 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x2e, 0x49, 0x6e, 0x76, 0x6f, 0x6b, 0x65, 0x56, 0x33, 0x48, 0x00, + 0x52, 0x08, 0x69, 0x6e, 0x76, 0x6f, 0x6b, 0x65, 0x56, 0x33, 0x12, 0x39, 0x0a, 0x0a, 0x6c, 0x31, + 0x5f, 0x68, 0x61, 0x6e, 0x64, 0x6c, 0x65, 0x72, 0x18, 0x0b, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x18, + 0x2e, 0x54, 0x72, 0x61, 0x6e, 0x73, 0x61, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x2e, 0x4c, 0x31, 0x48, + 0x61, 0x6e, 0x64, 0x6c, 0x65, 0x72, 0x56, 0x30, 0x48, 0x00, 0x52, 0x09, 0x6c, 0x31, 0x48, 0x61, + 0x6e, 0x64, 0x6c, 0x65, 0x72, 0x12, 0x30, 0x0a, 0x10, 0x74, 0x72, 0x61, 0x6e, 0x73, 0x61, 0x63, + 0x74, 0x69, 0x6f, 0x6e, 0x5f, 0x68, 0x61, 0x73, 0x68, 0x18, 0x0c, 0x20, 0x01, 0x28, 0x0b, 0x32, + 0x05, 0x2e, 0x48, 0x61, 0x73, 0x68, 0x52, 0x0f, 0x74, 0x72, 0x61, 0x6e, 0x73, 0x61, 0x63, 0x74, + 0x69, 0x6f, 0x6e, 0x48, 0x61, 0x73, 0x68, 0x1a, 0xa7, 0x01, 0x0a, 0x09, 0x44, 0x65, 0x63, 0x6c, + 0x61, 0x72, 0x65, 0x56, 0x30, 0x12, 0x20, 0x0a, 0x06, 0x73, 0x65, 0x6e, 0x64, 0x65, 0x72, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x08, 0x2e, 0x41, 0x64, 0x64, 0x72, 0x65, 0x73, 0x73, 0x52, 0x06, 0x73, 0x65, 0x6e, 0x64, 0x65, 0x72, 0x12, 0x21, 0x0a, 0x07, 0x6d, 0x61, 0x78, 0x5f, 0x66, 0x65, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x08, 0x2e, 0x46, 0x65, 0x6c, 0x74, 0x32, @@ -1621,13 +1594,20 @@ var file_p2p_proto_transaction_proto_rawDesc = []byte{ 0x52, 0x09, 0x73, 0x69, 0x67, 0x6e, 0x61, 0x74, 0x75, 0x72, 0x65, 0x12, 0x24, 0x0a, 0x0a, 0x63, 0x6c, 0x61, 0x73, 0x73, 0x5f, 0x68, 0x61, 0x73, 0x68, 0x18, 0x04, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x05, 0x2e, 0x48, 0x61, 0x73, 0x68, 0x52, 0x09, 0x63, 0x6c, 0x61, 0x73, 0x73, 0x48, 0x61, 0x73, - 0x68, 0x12, 0x1e, 0x0a, 0x05, 0x6e, 0x6f, 0x6e, 0x63, 0x65, 0x18, 0x05, 0x20, 0x01, 0x28, 0x0b, - 0x32, 0x08, 0x2e, 0x46, 0x65, 0x6c, 0x74, 0x32, 0x35, 0x32, 0x52, 0x05, 0x6e, 0x6f, 0x6e, 0x63, - 0x65, 0x12, 0x38, 0x0a, 0x13, 0x63, 0x6f, 0x6d, 0x70, 0x69, 0x6c, 0x65, 0x64, 0x5f, 0x63, 0x6c, - 0x61, 0x73, 0x73, 0x5f, 0x68, 0x61, 0x73, 0x68, 0x18, 0x06, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x08, - 0x2e, 0x46, 0x65, 0x6c, 0x74, 0x32, 0x35, 0x32, 0x52, 0x11, 0x63, 0x6f, 0x6d, 0x70, 0x69, 0x6c, - 0x65, 0x64, 0x43, 0x6c, 0x61, 0x73, 0x73, 0x48, 0x61, 0x73, 0x68, 0x1a, 0xd7, 0x03, 0x0a, 0x09, - 0x44, 0x65, 0x63, 0x6c, 0x61, 0x72, 0x65, 0x56, 0x33, 0x12, 0x20, 0x0a, 0x06, 0x73, 0x65, 0x6e, + 0x68, 0x1a, 0xc7, 0x01, 0x0a, 0x09, 0x44, 0x65, 0x63, 0x6c, 0x61, 0x72, 0x65, 0x56, 0x31, 0x12, + 0x20, 0x0a, 0x06, 0x73, 0x65, 0x6e, 0x64, 0x65, 0x72, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, + 0x08, 0x2e, 0x41, 0x64, 0x64, 0x72, 0x65, 0x73, 0x73, 0x52, 0x06, 0x73, 0x65, 0x6e, 0x64, 0x65, + 0x72, 0x12, 0x21, 0x0a, 0x07, 0x6d, 0x61, 0x78, 0x5f, 0x66, 0x65, 0x65, 0x18, 0x02, 0x20, 0x01, + 0x28, 0x0b, 0x32, 0x08, 0x2e, 0x46, 0x65, 0x6c, 0x74, 0x32, 0x35, 0x32, 0x52, 0x06, 0x6d, 0x61, + 0x78, 0x46, 0x65, 0x65, 0x12, 0x2f, 0x0a, 0x09, 0x73, 0x69, 0x67, 0x6e, 0x61, 0x74, 0x75, 0x72, + 0x65, 0x18, 0x03, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x11, 0x2e, 0x41, 0x63, 0x63, 0x6f, 0x75, 0x6e, + 0x74, 0x53, 0x69, 0x67, 0x6e, 0x61, 0x74, 0x75, 0x72, 0x65, 0x52, 0x09, 0x73, 0x69, 0x67, 0x6e, + 0x61, 0x74, 0x75, 0x72, 0x65, 0x12, 0x24, 0x0a, 0x0a, 0x63, 0x6c, 0x61, 0x73, 0x73, 0x5f, 0x68, + 0x61, 0x73, 0x68, 0x18, 0x04, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x05, 0x2e, 0x48, 0x61, 0x73, 0x68, + 0x52, 0x09, 0x63, 0x6c, 0x61, 0x73, 0x73, 0x48, 0x61, 0x73, 0x68, 0x12, 0x1e, 0x0a, 0x05, 0x6e, + 0x6f, 0x6e, 0x63, 0x65, 0x18, 0x05, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x08, 0x2e, 0x46, 0x65, 0x6c, + 0x74, 0x32, 0x35, 0x32, 0x52, 0x05, 0x6e, 0x6f, 0x6e, 0x63, 0x65, 0x1a, 0x81, 0x02, 0x0a, 0x09, + 0x44, 0x65, 0x63, 0x6c, 0x61, 0x72, 0x65, 0x56, 0x32, 0x12, 0x20, 0x0a, 0x06, 0x73, 0x65, 0x6e, 0x64, 0x65, 0x72, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x08, 0x2e, 0x41, 0x64, 0x64, 0x72, 0x65, 0x73, 0x73, 0x52, 0x06, 0x73, 0x65, 0x6e, 0x64, 0x65, 0x72, 0x12, 0x21, 0x0a, 0x07, 0x6d, 0x61, 0x78, 0x5f, 0x66, 0x65, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x08, 0x2e, 0x46, @@ -1642,29 +1622,48 @@ var file_p2p_proto_transaction_proto_rawDesc = []byte{ 0x6e, 0x6f, 0x6e, 0x63, 0x65, 0x12, 0x38, 0x0a, 0x13, 0x63, 0x6f, 0x6d, 0x70, 0x69, 0x6c, 0x65, 0x64, 0x5f, 0x63, 0x6c, 0x61, 0x73, 0x73, 0x5f, 0x68, 0x61, 0x73, 0x68, 0x18, 0x06, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x08, 0x2e, 0x46, 0x65, 0x6c, 0x74, 0x32, 0x35, 0x32, 0x52, 0x11, 0x63, 0x6f, - 0x6d, 0x70, 0x69, 0x6c, 0x65, 0x64, 0x43, 0x6c, 0x61, 0x73, 0x73, 0x48, 0x61, 0x73, 0x68, 0x12, - 0x26, 0x0a, 0x06, 0x6c, 0x31, 0x5f, 0x67, 0x61, 0x73, 0x18, 0x07, 0x20, 0x01, 0x28, 0x0b, 0x32, - 0x0f, 0x2e, 0x52, 0x65, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x4c, 0x69, 0x6d, 0x69, 0x74, 0x73, - 0x52, 0x05, 0x6c, 0x31, 0x47, 0x61, 0x73, 0x12, 0x26, 0x0a, 0x06, 0x6c, 0x32, 0x5f, 0x67, 0x61, - 0x73, 0x18, 0x08, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x0f, 0x2e, 0x52, 0x65, 0x73, 0x6f, 0x75, 0x72, - 0x63, 0x65, 0x4c, 0x69, 0x6d, 0x69, 0x74, 0x73, 0x52, 0x05, 0x6c, 0x32, 0x47, 0x61, 0x73, 0x12, - 0x1a, 0x0a, 0x03, 0x74, 0x69, 0x70, 0x18, 0x09, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x08, 0x2e, 0x46, - 0x65, 0x6c, 0x74, 0x32, 0x35, 0x32, 0x52, 0x03, 0x74, 0x69, 0x70, 0x12, 0x26, 0x0a, 0x09, 0x70, - 0x61, 0x79, 0x6d, 0x61, 0x73, 0x74, 0x65, 0x72, 0x18, 0x0a, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x08, - 0x2e, 0x41, 0x64, 0x64, 0x72, 0x65, 0x73, 0x73, 0x52, 0x09, 0x70, 0x61, 0x79, 0x6d, 0x61, 0x73, - 0x74, 0x65, 0x72, 0x12, 0x21, 0x0a, 0x0c, 0x6e, 0x6f, 0x6e, 0x63, 0x65, 0x5f, 0x64, 0x6f, 0x6d, - 0x61, 0x69, 0x6e, 0x18, 0x0b, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0b, 0x6e, 0x6f, 0x6e, 0x63, 0x65, - 0x44, 0x6f, 0x6d, 0x61, 0x69, 0x6e, 0x12, 0x1d, 0x0a, 0x0a, 0x66, 0x65, 0x65, 0x5f, 0x64, 0x6f, - 0x6d, 0x61, 0x69, 0x6e, 0x18, 0x0c, 0x20, 0x01, 0x28, 0x09, 0x52, 0x09, 0x66, 0x65, 0x65, 0x44, - 0x6f, 0x6d, 0x61, 0x69, 0x6e, 0x1a, 0x81, 0x01, 0x0a, 0x06, 0x44, 0x65, 0x70, 0x6c, 0x6f, 0x79, - 0x12, 0x24, 0x0a, 0x0a, 0x63, 0x6c, 0x61, 0x73, 0x73, 0x5f, 0x68, 0x61, 0x73, 0x68, 0x18, 0x01, + 0x6d, 0x70, 0x69, 0x6c, 0x65, 0x64, 0x43, 0x6c, 0x61, 0x73, 0x73, 0x48, 0x61, 0x73, 0x68, 0x1a, + 0xe9, 0x03, 0x0a, 0x09, 0x44, 0x65, 0x63, 0x6c, 0x61, 0x72, 0x65, 0x56, 0x33, 0x12, 0x20, 0x0a, + 0x06, 0x73, 0x65, 0x6e, 0x64, 0x65, 0x72, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x08, 0x2e, + 0x41, 0x64, 0x64, 0x72, 0x65, 0x73, 0x73, 0x52, 0x06, 0x73, 0x65, 0x6e, 0x64, 0x65, 0x72, 0x12, + 0x2f, 0x0a, 0x09, 0x73, 0x69, 0x67, 0x6e, 0x61, 0x74, 0x75, 0x72, 0x65, 0x18, 0x02, 0x20, 0x01, + 0x28, 0x0b, 0x32, 0x11, 0x2e, 0x41, 0x63, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x53, 0x69, 0x67, 0x6e, + 0x61, 0x74, 0x75, 0x72, 0x65, 0x52, 0x09, 0x73, 0x69, 0x67, 0x6e, 0x61, 0x74, 0x75, 0x72, 0x65, + 0x12, 0x24, 0x0a, 0x0a, 0x63, 0x6c, 0x61, 0x73, 0x73, 0x5f, 0x68, 0x61, 0x73, 0x68, 0x18, 0x03, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x05, 0x2e, 0x48, 0x61, 0x73, 0x68, 0x52, 0x09, 0x63, 0x6c, 0x61, - 0x73, 0x73, 0x48, 0x61, 0x73, 0x68, 0x12, 0x2b, 0x0a, 0x0c, 0x61, 0x64, 0x64, 0x72, 0x65, 0x73, - 0x73, 0x5f, 0x73, 0x61, 0x6c, 0x74, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x08, 0x2e, 0x46, - 0x65, 0x6c, 0x74, 0x32, 0x35, 0x32, 0x52, 0x0b, 0x61, 0x64, 0x64, 0x72, 0x65, 0x73, 0x73, 0x53, - 0x61, 0x6c, 0x74, 0x12, 0x24, 0x0a, 0x08, 0x63, 0x61, 0x6c, 0x6c, 0x64, 0x61, 0x74, 0x61, 0x18, - 0x03, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x08, 0x2e, 0x46, 0x65, 0x6c, 0x74, 0x32, 0x35, 0x32, 0x52, - 0x08, 0x63, 0x61, 0x6c, 0x6c, 0x64, 0x61, 0x74, 0x61, 0x1a, 0xfe, 0x01, 0x0a, 0x0f, 0x44, 0x65, + 0x73, 0x73, 0x48, 0x61, 0x73, 0x68, 0x12, 0x1e, 0x0a, 0x05, 0x6e, 0x6f, 0x6e, 0x63, 0x65, 0x18, + 0x04, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x08, 0x2e, 0x46, 0x65, 0x6c, 0x74, 0x32, 0x35, 0x32, 0x52, + 0x05, 0x6e, 0x6f, 0x6e, 0x63, 0x65, 0x12, 0x38, 0x0a, 0x13, 0x63, 0x6f, 0x6d, 0x70, 0x69, 0x6c, + 0x65, 0x64, 0x5f, 0x63, 0x6c, 0x61, 0x73, 0x73, 0x5f, 0x68, 0x61, 0x73, 0x68, 0x18, 0x05, 0x20, + 0x01, 0x28, 0x0b, 0x32, 0x08, 0x2e, 0x46, 0x65, 0x6c, 0x74, 0x32, 0x35, 0x32, 0x52, 0x11, 0x63, + 0x6f, 0x6d, 0x70, 0x69, 0x6c, 0x65, 0x64, 0x43, 0x6c, 0x61, 0x73, 0x73, 0x48, 0x61, 0x73, 0x68, + 0x12, 0x38, 0x0a, 0x0f, 0x72, 0x65, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x5f, 0x62, 0x6f, 0x75, + 0x6e, 0x64, 0x73, 0x18, 0x06, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x0f, 0x2e, 0x52, 0x65, 0x73, 0x6f, + 0x75, 0x72, 0x63, 0x65, 0x42, 0x6f, 0x75, 0x6e, 0x64, 0x73, 0x52, 0x0e, 0x72, 0x65, 0x73, 0x6f, + 0x75, 0x72, 0x63, 0x65, 0x42, 0x6f, 0x75, 0x6e, 0x64, 0x73, 0x12, 0x1a, 0x0a, 0x03, 0x74, 0x69, + 0x70, 0x18, 0x07, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x08, 0x2e, 0x46, 0x65, 0x6c, 0x74, 0x32, 0x35, + 0x32, 0x52, 0x03, 0x74, 0x69, 0x70, 0x12, 0x2f, 0x0a, 0x0e, 0x70, 0x61, 0x79, 0x6d, 0x61, 0x73, + 0x74, 0x65, 0x72, 0x5f, 0x64, 0x61, 0x74, 0x61, 0x18, 0x08, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x08, + 0x2e, 0x41, 0x64, 0x64, 0x72, 0x65, 0x73, 0x73, 0x52, 0x0d, 0x70, 0x61, 0x79, 0x6d, 0x61, 0x73, + 0x74, 0x65, 0x72, 0x44, 0x61, 0x74, 0x61, 0x12, 0x40, 0x0a, 0x17, 0x61, 0x63, 0x63, 0x6f, 0x75, + 0x6e, 0x74, 0x5f, 0x64, 0x65, 0x70, 0x6c, 0x6f, 0x79, 0x6d, 0x65, 0x6e, 0x74, 0x5f, 0x64, 0x61, + 0x74, 0x61, 0x18, 0x09, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x08, 0x2e, 0x41, 0x64, 0x64, 0x72, 0x65, + 0x73, 0x73, 0x52, 0x15, 0x61, 0x63, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x44, 0x65, 0x70, 0x6c, 0x6f, + 0x79, 0x6d, 0x65, 0x6e, 0x74, 0x44, 0x61, 0x74, 0x61, 0x12, 0x21, 0x0a, 0x0c, 0x6e, 0x6f, 0x6e, + 0x63, 0x65, 0x5f, 0x64, 0x6f, 0x6d, 0x61, 0x69, 0x6e, 0x18, 0x0a, 0x20, 0x01, 0x28, 0x09, 0x52, + 0x0b, 0x6e, 0x6f, 0x6e, 0x63, 0x65, 0x44, 0x6f, 0x6d, 0x61, 0x69, 0x6e, 0x12, 0x1d, 0x0a, 0x0a, + 0x66, 0x65, 0x65, 0x5f, 0x64, 0x6f, 0x6d, 0x61, 0x69, 0x6e, 0x18, 0x0b, 0x20, 0x01, 0x28, 0x09, + 0x52, 0x09, 0x66, 0x65, 0x65, 0x44, 0x6f, 0x6d, 0x61, 0x69, 0x6e, 0x1a, 0x9b, 0x01, 0x0a, 0x06, + 0x44, 0x65, 0x70, 0x6c, 0x6f, 0x79, 0x12, 0x24, 0x0a, 0x0a, 0x63, 0x6c, 0x61, 0x73, 0x73, 0x5f, + 0x68, 0x61, 0x73, 0x68, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x05, 0x2e, 0x48, 0x61, 0x73, + 0x68, 0x52, 0x09, 0x63, 0x6c, 0x61, 0x73, 0x73, 0x48, 0x61, 0x73, 0x68, 0x12, 0x2b, 0x0a, 0x0c, + 0x61, 0x64, 0x64, 0x72, 0x65, 0x73, 0x73, 0x5f, 0x73, 0x61, 0x6c, 0x74, 0x18, 0x02, 0x20, 0x01, + 0x28, 0x0b, 0x32, 0x08, 0x2e, 0x46, 0x65, 0x6c, 0x74, 0x32, 0x35, 0x32, 0x52, 0x0b, 0x61, 0x64, + 0x64, 0x72, 0x65, 0x73, 0x73, 0x53, 0x61, 0x6c, 0x74, 0x12, 0x24, 0x0a, 0x08, 0x63, 0x61, 0x6c, + 0x6c, 0x64, 0x61, 0x74, 0x61, 0x18, 0x03, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x08, 0x2e, 0x46, 0x65, + 0x6c, 0x74, 0x32, 0x35, 0x32, 0x52, 0x08, 0x63, 0x61, 0x6c, 0x6c, 0x64, 0x61, 0x74, 0x61, 0x12, + 0x18, 0x0a, 0x07, 0x76, 0x65, 0x72, 0x73, 0x69, 0x6f, 0x6e, 0x18, 0x04, 0x20, 0x01, 0x28, 0x0d, + 0x52, 0x07, 0x76, 0x65, 0x72, 0x73, 0x69, 0x6f, 0x6e, 0x1a, 0xfe, 0x01, 0x0a, 0x0f, 0x44, 0x65, 0x70, 0x6c, 0x6f, 0x79, 0x41, 0x63, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x56, 0x31, 0x12, 0x21, 0x0a, 0x07, 0x6d, 0x61, 0x78, 0x5f, 0x66, 0x65, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x08, 0x2e, 0x46, 0x65, 0x6c, 0x74, 0x32, 0x35, 0x32, 0x52, 0x06, 0x6d, 0x61, 0x78, 0x46, 0x65, 0x65, @@ -1680,36 +1679,33 @@ var file_p2p_proto_transaction_proto_rawDesc = []byte{ 0x46, 0x65, 0x6c, 0x74, 0x32, 0x35, 0x32, 0x52, 0x0b, 0x61, 0x64, 0x64, 0x72, 0x65, 0x73, 0x73, 0x53, 0x61, 0x6c, 0x74, 0x12, 0x24, 0x0a, 0x08, 0x63, 0x61, 0x6c, 0x6c, 0x64, 0x61, 0x74, 0x61, 0x18, 0x06, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x08, 0x2e, 0x46, 0x65, 0x6c, 0x74, 0x32, 0x35, 0x32, - 0x52, 0x08, 0x63, 0x61, 0x6c, 0x6c, 0x64, 0x61, 0x74, 0x61, 0x1a, 0xd4, 0x03, 0x0a, 0x0f, 0x44, - 0x65, 0x70, 0x6c, 0x6f, 0x79, 0x41, 0x63, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x56, 0x33, 0x12, 0x21, - 0x0a, 0x07, 0x6d, 0x61, 0x78, 0x5f, 0x66, 0x65, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, - 0x08, 0x2e, 0x46, 0x65, 0x6c, 0x74, 0x32, 0x35, 0x32, 0x52, 0x06, 0x6d, 0x61, 0x78, 0x46, 0x65, - 0x65, 0x12, 0x2f, 0x0a, 0x09, 0x73, 0x69, 0x67, 0x6e, 0x61, 0x74, 0x75, 0x72, 0x65, 0x18, 0x02, - 0x20, 0x01, 0x28, 0x0b, 0x32, 0x11, 0x2e, 0x41, 0x63, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x53, 0x69, - 0x67, 0x6e, 0x61, 0x74, 0x75, 0x72, 0x65, 0x52, 0x09, 0x73, 0x69, 0x67, 0x6e, 0x61, 0x74, 0x75, - 0x72, 0x65, 0x12, 0x24, 0x0a, 0x0a, 0x63, 0x6c, 0x61, 0x73, 0x73, 0x5f, 0x68, 0x61, 0x73, 0x68, - 0x18, 0x03, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x05, 0x2e, 0x48, 0x61, 0x73, 0x68, 0x52, 0x09, 0x63, - 0x6c, 0x61, 0x73, 0x73, 0x48, 0x61, 0x73, 0x68, 0x12, 0x1e, 0x0a, 0x05, 0x6e, 0x6f, 0x6e, 0x63, - 0x65, 0x18, 0x04, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x08, 0x2e, 0x46, 0x65, 0x6c, 0x74, 0x32, 0x35, - 0x32, 0x52, 0x05, 0x6e, 0x6f, 0x6e, 0x63, 0x65, 0x12, 0x2b, 0x0a, 0x0c, 0x61, 0x64, 0x64, 0x72, - 0x65, 0x73, 0x73, 0x5f, 0x73, 0x61, 0x6c, 0x74, 0x18, 0x05, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x08, - 0x2e, 0x46, 0x65, 0x6c, 0x74, 0x32, 0x35, 0x32, 0x52, 0x0b, 0x61, 0x64, 0x64, 0x72, 0x65, 0x73, - 0x73, 0x53, 0x61, 0x6c, 0x74, 0x12, 0x24, 0x0a, 0x08, 0x63, 0x61, 0x6c, 0x6c, 0x64, 0x61, 0x74, - 0x61, 0x18, 0x06, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x08, 0x2e, 0x46, 0x65, 0x6c, 0x74, 0x32, 0x35, - 0x32, 0x52, 0x08, 0x63, 0x61, 0x6c, 0x6c, 0x64, 0x61, 0x74, 0x61, 0x12, 0x26, 0x0a, 0x06, 0x6c, - 0x31, 0x5f, 0x67, 0x61, 0x73, 0x18, 0x07, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x0f, 0x2e, 0x52, 0x65, - 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x4c, 0x69, 0x6d, 0x69, 0x74, 0x73, 0x52, 0x05, 0x6c, 0x31, - 0x47, 0x61, 0x73, 0x12, 0x26, 0x0a, 0x06, 0x6c, 0x32, 0x5f, 0x67, 0x61, 0x73, 0x18, 0x08, 0x20, - 0x01, 0x28, 0x0b, 0x32, 0x0f, 0x2e, 0x52, 0x65, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x4c, 0x69, - 0x6d, 0x69, 0x74, 0x73, 0x52, 0x05, 0x6c, 0x32, 0x47, 0x61, 0x73, 0x12, 0x1a, 0x0a, 0x03, 0x74, - 0x69, 0x70, 0x18, 0x09, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x08, 0x2e, 0x46, 0x65, 0x6c, 0x74, 0x32, - 0x35, 0x32, 0x52, 0x03, 0x74, 0x69, 0x70, 0x12, 0x26, 0x0a, 0x09, 0x70, 0x61, 0x79, 0x6d, 0x61, - 0x73, 0x74, 0x65, 0x72, 0x18, 0x0a, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x08, 0x2e, 0x41, 0x64, 0x64, - 0x72, 0x65, 0x73, 0x73, 0x52, 0x09, 0x70, 0x61, 0x79, 0x6d, 0x61, 0x73, 0x74, 0x65, 0x72, 0x12, + 0x52, 0x08, 0x63, 0x61, 0x6c, 0x6c, 0x64, 0x61, 0x74, 0x61, 0x1a, 0xa4, 0x03, 0x0a, 0x0f, 0x44, + 0x65, 0x70, 0x6c, 0x6f, 0x79, 0x41, 0x63, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x56, 0x33, 0x12, 0x2f, + 0x0a, 0x09, 0x73, 0x69, 0x67, 0x6e, 0x61, 0x74, 0x75, 0x72, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, + 0x0b, 0x32, 0x11, 0x2e, 0x41, 0x63, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x53, 0x69, 0x67, 0x6e, 0x61, + 0x74, 0x75, 0x72, 0x65, 0x52, 0x09, 0x73, 0x69, 0x67, 0x6e, 0x61, 0x74, 0x75, 0x72, 0x65, 0x12, + 0x24, 0x0a, 0x0a, 0x63, 0x6c, 0x61, 0x73, 0x73, 0x5f, 0x68, 0x61, 0x73, 0x68, 0x18, 0x02, 0x20, + 0x01, 0x28, 0x0b, 0x32, 0x05, 0x2e, 0x48, 0x61, 0x73, 0x68, 0x52, 0x09, 0x63, 0x6c, 0x61, 0x73, + 0x73, 0x48, 0x61, 0x73, 0x68, 0x12, 0x1e, 0x0a, 0x05, 0x6e, 0x6f, 0x6e, 0x63, 0x65, 0x18, 0x03, + 0x20, 0x01, 0x28, 0x0b, 0x32, 0x08, 0x2e, 0x46, 0x65, 0x6c, 0x74, 0x32, 0x35, 0x32, 0x52, 0x05, + 0x6e, 0x6f, 0x6e, 0x63, 0x65, 0x12, 0x2b, 0x0a, 0x0c, 0x61, 0x64, 0x64, 0x72, 0x65, 0x73, 0x73, + 0x5f, 0x73, 0x61, 0x6c, 0x74, 0x18, 0x04, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x08, 0x2e, 0x46, 0x65, + 0x6c, 0x74, 0x32, 0x35, 0x32, 0x52, 0x0b, 0x61, 0x64, 0x64, 0x72, 0x65, 0x73, 0x73, 0x53, 0x61, + 0x6c, 0x74, 0x12, 0x24, 0x0a, 0x08, 0x63, 0x61, 0x6c, 0x6c, 0x64, 0x61, 0x74, 0x61, 0x18, 0x05, + 0x20, 0x03, 0x28, 0x0b, 0x32, 0x08, 0x2e, 0x46, 0x65, 0x6c, 0x74, 0x32, 0x35, 0x32, 0x52, 0x08, + 0x63, 0x61, 0x6c, 0x6c, 0x64, 0x61, 0x74, 0x61, 0x12, 0x38, 0x0a, 0x0f, 0x72, 0x65, 0x73, 0x6f, + 0x75, 0x72, 0x63, 0x65, 0x5f, 0x62, 0x6f, 0x75, 0x6e, 0x64, 0x73, 0x18, 0x06, 0x20, 0x01, 0x28, + 0x0b, 0x32, 0x0f, 0x2e, 0x52, 0x65, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x42, 0x6f, 0x75, 0x6e, + 0x64, 0x73, 0x52, 0x0e, 0x72, 0x65, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x42, 0x6f, 0x75, 0x6e, + 0x64, 0x73, 0x12, 0x1a, 0x0a, 0x03, 0x74, 0x69, 0x70, 0x18, 0x07, 0x20, 0x01, 0x28, 0x0b, 0x32, + 0x08, 0x2e, 0x46, 0x65, 0x6c, 0x74, 0x32, 0x35, 0x32, 0x52, 0x03, 0x74, 0x69, 0x70, 0x12, 0x2f, + 0x0a, 0x0e, 0x70, 0x61, 0x79, 0x6d, 0x61, 0x73, 0x74, 0x65, 0x72, 0x5f, 0x64, 0x61, 0x74, 0x61, + 0x18, 0x08, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x08, 0x2e, 0x41, 0x64, 0x64, 0x72, 0x65, 0x73, 0x73, + 0x52, 0x0d, 0x70, 0x61, 0x79, 0x6d, 0x61, 0x73, 0x74, 0x65, 0x72, 0x44, 0x61, 0x74, 0x61, 0x12, 0x21, 0x0a, 0x0c, 0x6e, 0x6f, 0x6e, 0x63, 0x65, 0x5f, 0x64, 0x6f, 0x6d, 0x61, 0x69, 0x6e, 0x18, - 0x0b, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0b, 0x6e, 0x6f, 0x6e, 0x63, 0x65, 0x44, 0x6f, 0x6d, 0x61, + 0x09, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0b, 0x6e, 0x6f, 0x6e, 0x63, 0x65, 0x44, 0x6f, 0x6d, 0x61, 0x69, 0x6e, 0x12, 0x1d, 0x0a, 0x0a, 0x66, 0x65, 0x65, 0x5f, 0x64, 0x6f, 0x6d, 0x61, 0x69, 0x6e, - 0x18, 0x0c, 0x20, 0x01, 0x28, 0x09, 0x52, 0x09, 0x66, 0x65, 0x65, 0x44, 0x6f, 0x6d, 0x61, 0x69, + 0x18, 0x0a, 0x20, 0x01, 0x28, 0x09, 0x52, 0x09, 0x66, 0x65, 0x65, 0x44, 0x6f, 0x6d, 0x61, 0x69, 0x6e, 0x1a, 0xe4, 0x01, 0x0a, 0x08, 0x49, 0x6e, 0x76, 0x6f, 0x6b, 0x65, 0x56, 0x30, 0x12, 0x21, 0x0a, 0x07, 0x6d, 0x61, 0x78, 0x5f, 0x66, 0x65, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x08, 0x2e, 0x46, 0x65, 0x6c, 0x74, 0x32, 0x35, 0x32, 0x52, 0x06, 0x6d, 0x61, 0x78, 0x46, 0x65, @@ -1737,62 +1733,61 @@ var file_p2p_proto_transaction_proto_rawDesc = []byte{ 0x46, 0x65, 0x6c, 0x74, 0x32, 0x35, 0x32, 0x52, 0x08, 0x63, 0x61, 0x6c, 0x6c, 0x64, 0x61, 0x74, 0x61, 0x12, 0x1e, 0x0a, 0x05, 0x6e, 0x6f, 0x6e, 0x63, 0x65, 0x18, 0x05, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x08, 0x2e, 0x46, 0x65, 0x6c, 0x74, 0x32, 0x35, 0x32, 0x52, 0x05, 0x6e, 0x6f, 0x6e, 0x63, - 0x65, 0x1a, 0x9c, 0x03, 0x0a, 0x08, 0x49, 0x6e, 0x76, 0x6f, 0x6b, 0x65, 0x56, 0x33, 0x12, 0x20, + 0x65, 0x1a, 0xae, 0x03, 0x0a, 0x08, 0x49, 0x6e, 0x76, 0x6f, 0x6b, 0x65, 0x56, 0x33, 0x12, 0x20, 0x0a, 0x06, 0x73, 0x65, 0x6e, 0x64, 0x65, 0x72, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x08, 0x2e, 0x41, 0x64, 0x64, 0x72, 0x65, 0x73, 0x73, 0x52, 0x06, 0x73, 0x65, 0x6e, 0x64, 0x65, 0x72, - 0x12, 0x21, 0x0a, 0x07, 0x6d, 0x61, 0x78, 0x5f, 0x66, 0x65, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, - 0x0b, 0x32, 0x08, 0x2e, 0x46, 0x65, 0x6c, 0x74, 0x32, 0x35, 0x32, 0x52, 0x06, 0x6d, 0x61, 0x78, - 0x46, 0x65, 0x65, 0x12, 0x2f, 0x0a, 0x09, 0x73, 0x69, 0x67, 0x6e, 0x61, 0x74, 0x75, 0x72, 0x65, - 0x18, 0x03, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x11, 0x2e, 0x41, 0x63, 0x63, 0x6f, 0x75, 0x6e, 0x74, - 0x53, 0x69, 0x67, 0x6e, 0x61, 0x74, 0x75, 0x72, 0x65, 0x52, 0x09, 0x73, 0x69, 0x67, 0x6e, 0x61, - 0x74, 0x75, 0x72, 0x65, 0x12, 0x24, 0x0a, 0x08, 0x63, 0x61, 0x6c, 0x6c, 0x64, 0x61, 0x74, 0x61, - 0x18, 0x04, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x08, 0x2e, 0x46, 0x65, 0x6c, 0x74, 0x32, 0x35, 0x32, - 0x52, 0x08, 0x63, 0x61, 0x6c, 0x6c, 0x64, 0x61, 0x74, 0x61, 0x12, 0x26, 0x0a, 0x06, 0x6c, 0x31, - 0x5f, 0x67, 0x61, 0x73, 0x18, 0x05, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x0f, 0x2e, 0x52, 0x65, 0x73, - 0x6f, 0x75, 0x72, 0x63, 0x65, 0x4c, 0x69, 0x6d, 0x69, 0x74, 0x73, 0x52, 0x05, 0x6c, 0x31, 0x47, - 0x61, 0x73, 0x12, 0x26, 0x0a, 0x06, 0x6c, 0x32, 0x5f, 0x67, 0x61, 0x73, 0x18, 0x06, 0x20, 0x01, - 0x28, 0x0b, 0x32, 0x0f, 0x2e, 0x52, 0x65, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x4c, 0x69, 0x6d, - 0x69, 0x74, 0x73, 0x52, 0x05, 0x6c, 0x32, 0x47, 0x61, 0x73, 0x12, 0x1a, 0x0a, 0x03, 0x74, 0x69, - 0x70, 0x18, 0x07, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x08, 0x2e, 0x46, 0x65, 0x6c, 0x74, 0x32, 0x35, - 0x32, 0x52, 0x03, 0x74, 0x69, 0x70, 0x12, 0x26, 0x0a, 0x09, 0x70, 0x61, 0x79, 0x6d, 0x61, 0x73, - 0x74, 0x65, 0x72, 0x18, 0x08, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x08, 0x2e, 0x41, 0x64, 0x64, 0x72, - 0x65, 0x73, 0x73, 0x52, 0x09, 0x70, 0x61, 0x79, 0x6d, 0x61, 0x73, 0x74, 0x65, 0x72, 0x12, 0x21, - 0x0a, 0x0c, 0x6e, 0x6f, 0x6e, 0x63, 0x65, 0x5f, 0x64, 0x6f, 0x6d, 0x61, 0x69, 0x6e, 0x18, 0x09, - 0x20, 0x01, 0x28, 0x09, 0x52, 0x0b, 0x6e, 0x6f, 0x6e, 0x63, 0x65, 0x44, 0x6f, 0x6d, 0x61, 0x69, - 0x6e, 0x12, 0x1d, 0x0a, 0x0a, 0x66, 0x65, 0x65, 0x5f, 0x64, 0x6f, 0x6d, 0x61, 0x69, 0x6e, 0x18, - 0x0a, 0x20, 0x01, 0x28, 0x09, 0x52, 0x09, 0x66, 0x65, 0x65, 0x44, 0x6f, 0x6d, 0x61, 0x69, 0x6e, - 0x12, 0x1e, 0x0a, 0x05, 0x6e, 0x6f, 0x6e, 0x63, 0x65, 0x18, 0x0b, 0x20, 0x01, 0x28, 0x0b, 0x32, - 0x08, 0x2e, 0x46, 0x65, 0x6c, 0x74, 0x32, 0x35, 0x32, 0x52, 0x05, 0x6e, 0x6f, 0x6e, 0x63, 0x65, - 0x1a, 0xb3, 0x01, 0x0a, 0x0b, 0x4c, 0x31, 0x48, 0x61, 0x6e, 0x64, 0x6c, 0x65, 0x72, 0x56, 0x31, - 0x12, 0x1e, 0x0a, 0x05, 0x6e, 0x6f, 0x6e, 0x63, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, - 0x08, 0x2e, 0x46, 0x65, 0x6c, 0x74, 0x32, 0x35, 0x32, 0x52, 0x05, 0x6e, 0x6f, 0x6e, 0x63, 0x65, - 0x12, 0x22, 0x0a, 0x07, 0x61, 0x64, 0x64, 0x72, 0x65, 0x73, 0x73, 0x18, 0x02, 0x20, 0x01, 0x28, - 0x0b, 0x32, 0x08, 0x2e, 0x41, 0x64, 0x64, 0x72, 0x65, 0x73, 0x73, 0x52, 0x07, 0x61, 0x64, 0x64, - 0x72, 0x65, 0x73, 0x73, 0x12, 0x3a, 0x0a, 0x14, 0x65, 0x6e, 0x74, 0x72, 0x79, 0x5f, 0x70, 0x6f, - 0x69, 0x6e, 0x74, 0x5f, 0x73, 0x65, 0x6c, 0x65, 0x63, 0x74, 0x6f, 0x72, 0x18, 0x03, 0x20, 0x01, - 0x28, 0x0b, 0x32, 0x08, 0x2e, 0x46, 0x65, 0x6c, 0x74, 0x32, 0x35, 0x32, 0x52, 0x12, 0x65, 0x6e, - 0x74, 0x72, 0x79, 0x50, 0x6f, 0x69, 0x6e, 0x74, 0x53, 0x65, 0x6c, 0x65, 0x63, 0x74, 0x6f, 0x72, - 0x12, 0x24, 0x0a, 0x08, 0x63, 0x61, 0x6c, 0x6c, 0x64, 0x61, 0x74, 0x61, 0x18, 0x04, 0x20, 0x03, - 0x28, 0x0b, 0x32, 0x08, 0x2e, 0x46, 0x65, 0x6c, 0x74, 0x32, 0x35, 0x32, 0x52, 0x08, 0x63, 0x61, - 0x6c, 0x6c, 0x64, 0x61, 0x74, 0x61, 0x42, 0x05, 0x0a, 0x03, 0x74, 0x78, 0x6e, 0x22, 0x3f, 0x0a, - 0x13, 0x54, 0x72, 0x61, 0x6e, 0x73, 0x61, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x52, 0x65, 0x71, - 0x75, 0x65, 0x73, 0x74, 0x12, 0x28, 0x0a, 0x09, 0x69, 0x74, 0x65, 0x72, 0x61, 0x74, 0x69, 0x6f, - 0x6e, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x0a, 0x2e, 0x49, 0x74, 0x65, 0x72, 0x61, 0x74, - 0x69, 0x6f, 0x6e, 0x52, 0x09, 0x69, 0x74, 0x65, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x22, 0x32, - 0x0a, 0x0c, 0x54, 0x72, 0x61, 0x6e, 0x73, 0x61, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x12, 0x22, - 0x0a, 0x05, 0x69, 0x74, 0x65, 0x6d, 0x73, 0x18, 0x01, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x0c, 0x2e, - 0x54, 0x72, 0x61, 0x6e, 0x73, 0x61, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x52, 0x05, 0x69, 0x74, 0x65, - 0x6d, 0x73, 0x22, 0x98, 0x01, 0x0a, 0x14, 0x54, 0x72, 0x61, 0x6e, 0x73, 0x61, 0x63, 0x74, 0x69, - 0x6f, 0x6e, 0x73, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x1d, 0x0a, 0x02, 0x69, - 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x08, 0x2e, 0x42, 0x6c, 0x6f, 0x63, 0x6b, 0x49, - 0x44, 0x48, 0x01, 0x52, 0x02, 0x69, 0x64, 0x88, 0x01, 0x01, 0x12, 0x33, 0x0a, 0x0c, 0x74, 0x72, - 0x61, 0x6e, 0x73, 0x61, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, - 0x32, 0x0d, 0x2e, 0x54, 0x72, 0x61, 0x6e, 0x73, 0x61, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x48, - 0x00, 0x52, 0x0c, 0x74, 0x72, 0x61, 0x6e, 0x73, 0x61, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x12, - 0x18, 0x0a, 0x03, 0x66, 0x69, 0x6e, 0x18, 0x03, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x04, 0x2e, 0x46, - 0x69, 0x6e, 0x48, 0x00, 0x52, 0x03, 0x66, 0x69, 0x6e, 0x42, 0x0b, 0x0a, 0x09, 0x72, 0x65, 0x73, - 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x73, 0x42, 0x05, 0x0a, 0x03, 0x5f, 0x69, 0x64, 0x62, 0x06, 0x70, - 0x72, 0x6f, 0x74, 0x6f, 0x33, + 0x12, 0x2f, 0x0a, 0x09, 0x73, 0x69, 0x67, 0x6e, 0x61, 0x74, 0x75, 0x72, 0x65, 0x18, 0x02, 0x20, + 0x01, 0x28, 0x0b, 0x32, 0x11, 0x2e, 0x41, 0x63, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x53, 0x69, 0x67, + 0x6e, 0x61, 0x74, 0x75, 0x72, 0x65, 0x52, 0x09, 0x73, 0x69, 0x67, 0x6e, 0x61, 0x74, 0x75, 0x72, + 0x65, 0x12, 0x24, 0x0a, 0x08, 0x63, 0x61, 0x6c, 0x6c, 0x64, 0x61, 0x74, 0x61, 0x18, 0x03, 0x20, + 0x03, 0x28, 0x0b, 0x32, 0x08, 0x2e, 0x46, 0x65, 0x6c, 0x74, 0x32, 0x35, 0x32, 0x52, 0x08, 0x63, + 0x61, 0x6c, 0x6c, 0x64, 0x61, 0x74, 0x61, 0x12, 0x38, 0x0a, 0x0f, 0x72, 0x65, 0x73, 0x6f, 0x75, + 0x72, 0x63, 0x65, 0x5f, 0x62, 0x6f, 0x75, 0x6e, 0x64, 0x73, 0x18, 0x04, 0x20, 0x01, 0x28, 0x0b, + 0x32, 0x0f, 0x2e, 0x52, 0x65, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x42, 0x6f, 0x75, 0x6e, 0x64, + 0x73, 0x52, 0x0e, 0x72, 0x65, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x42, 0x6f, 0x75, 0x6e, 0x64, + 0x73, 0x12, 0x1a, 0x0a, 0x03, 0x74, 0x69, 0x70, 0x18, 0x05, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x08, + 0x2e, 0x46, 0x65, 0x6c, 0x74, 0x32, 0x35, 0x32, 0x52, 0x03, 0x74, 0x69, 0x70, 0x12, 0x2f, 0x0a, + 0x0e, 0x70, 0x61, 0x79, 0x6d, 0x61, 0x73, 0x74, 0x65, 0x72, 0x5f, 0x64, 0x61, 0x74, 0x61, 0x18, + 0x06, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x08, 0x2e, 0x41, 0x64, 0x64, 0x72, 0x65, 0x73, 0x73, 0x52, + 0x0d, 0x70, 0x61, 0x79, 0x6d, 0x61, 0x73, 0x74, 0x65, 0x72, 0x44, 0x61, 0x74, 0x61, 0x12, 0x40, + 0x0a, 0x17, 0x61, 0x63, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x5f, 0x64, 0x65, 0x70, 0x6c, 0x6f, 0x79, + 0x6d, 0x65, 0x6e, 0x74, 0x5f, 0x64, 0x61, 0x74, 0x61, 0x18, 0x07, 0x20, 0x01, 0x28, 0x0b, 0x32, + 0x08, 0x2e, 0x41, 0x64, 0x64, 0x72, 0x65, 0x73, 0x73, 0x52, 0x15, 0x61, 0x63, 0x63, 0x6f, 0x75, + 0x6e, 0x74, 0x44, 0x65, 0x70, 0x6c, 0x6f, 0x79, 0x6d, 0x65, 0x6e, 0x74, 0x44, 0x61, 0x74, 0x61, + 0x12, 0x21, 0x0a, 0x0c, 0x6e, 0x6f, 0x6e, 0x63, 0x65, 0x5f, 0x64, 0x6f, 0x6d, 0x61, 0x69, 0x6e, + 0x18, 0x08, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0b, 0x6e, 0x6f, 0x6e, 0x63, 0x65, 0x44, 0x6f, 0x6d, + 0x61, 0x69, 0x6e, 0x12, 0x1d, 0x0a, 0x0a, 0x66, 0x65, 0x65, 0x5f, 0x64, 0x6f, 0x6d, 0x61, 0x69, + 0x6e, 0x18, 0x09, 0x20, 0x01, 0x28, 0x09, 0x52, 0x09, 0x66, 0x65, 0x65, 0x44, 0x6f, 0x6d, 0x61, + 0x69, 0x6e, 0x12, 0x1e, 0x0a, 0x05, 0x6e, 0x6f, 0x6e, 0x63, 0x65, 0x18, 0x0a, 0x20, 0x01, 0x28, + 0x0b, 0x32, 0x08, 0x2e, 0x46, 0x65, 0x6c, 0x74, 0x32, 0x35, 0x32, 0x52, 0x05, 0x6e, 0x6f, 0x6e, + 0x63, 0x65, 0x1a, 0xb3, 0x01, 0x0a, 0x0b, 0x4c, 0x31, 0x48, 0x61, 0x6e, 0x64, 0x6c, 0x65, 0x72, + 0x56, 0x30, 0x12, 0x1e, 0x0a, 0x05, 0x6e, 0x6f, 0x6e, 0x63, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, + 0x0b, 0x32, 0x08, 0x2e, 0x46, 0x65, 0x6c, 0x74, 0x32, 0x35, 0x32, 0x52, 0x05, 0x6e, 0x6f, 0x6e, + 0x63, 0x65, 0x12, 0x22, 0x0a, 0x07, 0x61, 0x64, 0x64, 0x72, 0x65, 0x73, 0x73, 0x18, 0x02, 0x20, + 0x01, 0x28, 0x0b, 0x32, 0x08, 0x2e, 0x41, 0x64, 0x64, 0x72, 0x65, 0x73, 0x73, 0x52, 0x07, 0x61, + 0x64, 0x64, 0x72, 0x65, 0x73, 0x73, 0x12, 0x3a, 0x0a, 0x14, 0x65, 0x6e, 0x74, 0x72, 0x79, 0x5f, + 0x70, 0x6f, 0x69, 0x6e, 0x74, 0x5f, 0x73, 0x65, 0x6c, 0x65, 0x63, 0x74, 0x6f, 0x72, 0x18, 0x03, + 0x20, 0x01, 0x28, 0x0b, 0x32, 0x08, 0x2e, 0x46, 0x65, 0x6c, 0x74, 0x32, 0x35, 0x32, 0x52, 0x12, + 0x65, 0x6e, 0x74, 0x72, 0x79, 0x50, 0x6f, 0x69, 0x6e, 0x74, 0x53, 0x65, 0x6c, 0x65, 0x63, 0x74, + 0x6f, 0x72, 0x12, 0x24, 0x0a, 0x08, 0x63, 0x61, 0x6c, 0x6c, 0x64, 0x61, 0x74, 0x61, 0x18, 0x04, + 0x20, 0x03, 0x28, 0x0b, 0x32, 0x08, 0x2e, 0x46, 0x65, 0x6c, 0x74, 0x32, 0x35, 0x32, 0x52, 0x08, + 0x63, 0x61, 0x6c, 0x6c, 0x64, 0x61, 0x74, 0x61, 0x42, 0x05, 0x0a, 0x03, 0x74, 0x78, 0x6e, 0x22, + 0x3f, 0x0a, 0x13, 0x54, 0x72, 0x61, 0x6e, 0x73, 0x61, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x52, + 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x28, 0x0a, 0x09, 0x69, 0x74, 0x65, 0x72, 0x61, 0x74, + 0x69, 0x6f, 0x6e, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x0a, 0x2e, 0x49, 0x74, 0x65, 0x72, + 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x52, 0x09, 0x69, 0x74, 0x65, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, + 0x22, 0x79, 0x0a, 0x14, 0x54, 0x72, 0x61, 0x6e, 0x73, 0x61, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x73, + 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x30, 0x0a, 0x0b, 0x74, 0x72, 0x61, 0x6e, + 0x73, 0x61, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x0c, 0x2e, + 0x54, 0x72, 0x61, 0x6e, 0x73, 0x61, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x48, 0x00, 0x52, 0x0b, 0x74, + 0x72, 0x61, 0x6e, 0x73, 0x61, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x12, 0x18, 0x0a, 0x03, 0x66, 0x69, + 0x6e, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x04, 0x2e, 0x46, 0x69, 0x6e, 0x48, 0x00, 0x52, + 0x03, 0x66, 0x69, 0x6e, 0x42, 0x15, 0x0a, 0x13, 0x74, 0x72, 0x61, 0x6e, 0x73, 0x61, 0x63, 0x74, + 0x69, 0x6f, 0x6e, 0x5f, 0x6d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x42, 0x31, 0x5a, 0x2f, 0x67, + 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x4e, 0x65, 0x74, 0x68, 0x65, 0x72, + 0x6d, 0x69, 0x6e, 0x64, 0x45, 0x74, 0x68, 0x2f, 0x6a, 0x75, 0x6e, 0x6f, 0x2f, 0x70, 0x32, 0x70, + 0x2f, 0x73, 0x74, 0x61, 0x72, 0x6b, 0x6e, 0x65, 0x74, 0x2f, 0x73, 0x70, 0x65, 0x63, 0x62, 0x06, + 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, } var ( @@ -1811,10 +1806,10 @@ var ( file_p2p_proto_transaction_proto_msgTypes = make([]protoimpl.MessageInfo, 17) file_p2p_proto_transaction_proto_goTypes = []interface{}{ (*ResourceLimits)(nil), // 0: ResourceLimits - (*AccountSignature)(nil), // 1: AccountSignature - (*Transaction)(nil), // 2: Transaction - (*TransactionsRequest)(nil), // 3: TransactionsRequest - (*Transactions)(nil), // 4: Transactions + (*ResourceBounds)(nil), // 1: ResourceBounds + (*AccountSignature)(nil), // 2: AccountSignature + (*Transaction)(nil), // 3: Transaction + (*TransactionsRequest)(nil), // 4: TransactionsRequest (*TransactionsResponse)(nil), // 5: TransactionsResponse (*Transaction_DeclareV0)(nil), // 6: Transaction.DeclareV0 (*Transaction_DeclareV1)(nil), // 7: Transaction.DeclareV1 @@ -1826,108 +1821,103 @@ var ( (*Transaction_InvokeV0)(nil), // 13: Transaction.InvokeV0 (*Transaction_InvokeV1)(nil), // 14: Transaction.InvokeV1 (*Transaction_InvokeV3)(nil), // 15: Transaction.InvokeV3 - (*Transaction_L1HandlerV1)(nil), // 16: Transaction.L1HandlerV1 + (*Transaction_L1HandlerV0)(nil), // 16: Transaction.L1HandlerV0 (*Felt252)(nil), // 17: Felt252 - (*Iteration)(nil), // 18: Iteration - (*BlockID)(nil), // 19: BlockID + (*Hash)(nil), // 18: Hash + (*Iteration)(nil), // 19: Iteration (*Fin)(nil), // 20: Fin (*Address)(nil), // 21: Address - (*Hash)(nil), // 22: Hash } ) - var file_p2p_proto_transaction_proto_depIdxs = []int32{ 17, // 0: ResourceLimits.max_amount:type_name -> Felt252 17, // 1: ResourceLimits.max_price_per_unit:type_name -> Felt252 - 17, // 2: AccountSignature.parts:type_name -> Felt252 - 6, // 3: Transaction.declare_v0:type_name -> Transaction.DeclareV0 - 7, // 4: Transaction.declare_v1:type_name -> Transaction.DeclareV1 - 8, // 5: Transaction.declare_v2:type_name -> Transaction.DeclareV2 - 9, // 6: Transaction.declare_v3:type_name -> Transaction.DeclareV3 - 10, // 7: Transaction.deploy:type_name -> Transaction.Deploy - 11, // 8: Transaction.deploy_account_v1:type_name -> Transaction.DeployAccountV1 - 12, // 9: Transaction.deploy_account_v3:type_name -> Transaction.DeployAccountV3 - 13, // 10: Transaction.invoke_v0:type_name -> Transaction.InvokeV0 - 14, // 11: Transaction.invoke_v1:type_name -> Transaction.InvokeV1 - 15, // 12: Transaction.invoke_v3:type_name -> Transaction.InvokeV3 - 16, // 13: Transaction.l1_handler:type_name -> Transaction.L1HandlerV1 - 18, // 14: TransactionsRequest.iteration:type_name -> Iteration - 2, // 15: Transactions.items:type_name -> Transaction - 19, // 16: TransactionsResponse.id:type_name -> BlockID - 4, // 17: TransactionsResponse.transactions:type_name -> Transactions - 20, // 18: TransactionsResponse.fin:type_name -> Fin - 21, // 19: Transaction.DeclareV0.sender:type_name -> Address - 17, // 20: Transaction.DeclareV0.max_fee:type_name -> Felt252 - 1, // 21: Transaction.DeclareV0.signature:type_name -> AccountSignature - 22, // 22: Transaction.DeclareV0.class_hash:type_name -> Hash - 21, // 23: Transaction.DeclareV1.sender:type_name -> Address - 17, // 24: Transaction.DeclareV1.max_fee:type_name -> Felt252 - 1, // 25: Transaction.DeclareV1.signature:type_name -> AccountSignature - 22, // 26: Transaction.DeclareV1.class_hash:type_name -> Hash - 17, // 27: Transaction.DeclareV1.nonce:type_name -> Felt252 - 21, // 28: Transaction.DeclareV2.sender:type_name -> Address - 17, // 29: Transaction.DeclareV2.max_fee:type_name -> Felt252 - 1, // 30: Transaction.DeclareV2.signature:type_name -> AccountSignature - 22, // 31: Transaction.DeclareV2.class_hash:type_name -> Hash - 17, // 32: Transaction.DeclareV2.nonce:type_name -> Felt252 - 17, // 33: Transaction.DeclareV2.compiled_class_hash:type_name -> Felt252 - 21, // 34: Transaction.DeclareV3.sender:type_name -> Address - 17, // 35: Transaction.DeclareV3.max_fee:type_name -> Felt252 - 1, // 36: Transaction.DeclareV3.signature:type_name -> AccountSignature - 22, // 37: Transaction.DeclareV3.class_hash:type_name -> Hash + 0, // 2: ResourceBounds.l1_gas:type_name -> ResourceLimits + 0, // 3: ResourceBounds.l2_gas:type_name -> ResourceLimits + 17, // 4: AccountSignature.parts:type_name -> Felt252 + 6, // 5: Transaction.declare_v0:type_name -> Transaction.DeclareV0 + 7, // 6: Transaction.declare_v1:type_name -> Transaction.DeclareV1 + 8, // 7: Transaction.declare_v2:type_name -> Transaction.DeclareV2 + 9, // 8: Transaction.declare_v3:type_name -> Transaction.DeclareV3 + 10, // 9: Transaction.deploy:type_name -> Transaction.Deploy + 11, // 10: Transaction.deploy_account_v1:type_name -> Transaction.DeployAccountV1 + 12, // 11: Transaction.deploy_account_v3:type_name -> Transaction.DeployAccountV3 + 13, // 12: Transaction.invoke_v0:type_name -> Transaction.InvokeV0 + 14, // 13: Transaction.invoke_v1:type_name -> Transaction.InvokeV1 + 15, // 14: Transaction.invoke_v3:type_name -> Transaction.InvokeV3 + 16, // 15: Transaction.l1_handler:type_name -> Transaction.L1HandlerV0 + 18, // 16: Transaction.transaction_hash:type_name -> Hash + 19, // 17: TransactionsRequest.iteration:type_name -> Iteration + 3, // 18: TransactionsResponse.transaction:type_name -> Transaction + 20, // 19: TransactionsResponse.fin:type_name -> Fin + 21, // 20: Transaction.DeclareV0.sender:type_name -> Address + 17, // 21: Transaction.DeclareV0.max_fee:type_name -> Felt252 + 2, // 22: Transaction.DeclareV0.signature:type_name -> AccountSignature + 18, // 23: Transaction.DeclareV0.class_hash:type_name -> Hash + 21, // 24: Transaction.DeclareV1.sender:type_name -> Address + 17, // 25: Transaction.DeclareV1.max_fee:type_name -> Felt252 + 2, // 26: Transaction.DeclareV1.signature:type_name -> AccountSignature + 18, // 27: Transaction.DeclareV1.class_hash:type_name -> Hash + 17, // 28: Transaction.DeclareV1.nonce:type_name -> Felt252 + 21, // 29: Transaction.DeclareV2.sender:type_name -> Address + 17, // 30: Transaction.DeclareV2.max_fee:type_name -> Felt252 + 2, // 31: Transaction.DeclareV2.signature:type_name -> AccountSignature + 18, // 32: Transaction.DeclareV2.class_hash:type_name -> Hash + 17, // 33: Transaction.DeclareV2.nonce:type_name -> Felt252 + 17, // 34: Transaction.DeclareV2.compiled_class_hash:type_name -> Felt252 + 21, // 35: Transaction.DeclareV3.sender:type_name -> Address + 2, // 36: Transaction.DeclareV3.signature:type_name -> AccountSignature + 18, // 37: Transaction.DeclareV3.class_hash:type_name -> Hash 17, // 38: Transaction.DeclareV3.nonce:type_name -> Felt252 17, // 39: Transaction.DeclareV3.compiled_class_hash:type_name -> Felt252 - 0, // 40: Transaction.DeclareV3.l1_gas:type_name -> ResourceLimits - 0, // 41: Transaction.DeclareV3.l2_gas:type_name -> ResourceLimits - 17, // 42: Transaction.DeclareV3.tip:type_name -> Felt252 - 21, // 43: Transaction.DeclareV3.paymaster:type_name -> Address - 22, // 44: Transaction.Deploy.class_hash:type_name -> Hash + 1, // 40: Transaction.DeclareV3.resource_bounds:type_name -> ResourceBounds + 17, // 41: Transaction.DeclareV3.tip:type_name -> Felt252 + 21, // 42: Transaction.DeclareV3.paymaster_data:type_name -> Address + 21, // 43: Transaction.DeclareV3.account_deployment_data:type_name -> Address + 18, // 44: Transaction.Deploy.class_hash:type_name -> Hash 17, // 45: Transaction.Deploy.address_salt:type_name -> Felt252 17, // 46: Transaction.Deploy.calldata:type_name -> Felt252 17, // 47: Transaction.DeployAccountV1.max_fee:type_name -> Felt252 - 1, // 48: Transaction.DeployAccountV1.signature:type_name -> AccountSignature - 22, // 49: Transaction.DeployAccountV1.class_hash:type_name -> Hash + 2, // 48: Transaction.DeployAccountV1.signature:type_name -> AccountSignature + 18, // 49: Transaction.DeployAccountV1.class_hash:type_name -> Hash 17, // 50: Transaction.DeployAccountV1.nonce:type_name -> Felt252 17, // 51: Transaction.DeployAccountV1.address_salt:type_name -> Felt252 17, // 52: Transaction.DeployAccountV1.calldata:type_name -> Felt252 - 17, // 53: Transaction.DeployAccountV3.max_fee:type_name -> Felt252 - 1, // 54: Transaction.DeployAccountV3.signature:type_name -> AccountSignature - 22, // 55: Transaction.DeployAccountV3.class_hash:type_name -> Hash - 17, // 56: Transaction.DeployAccountV3.nonce:type_name -> Felt252 - 17, // 57: Transaction.DeployAccountV3.address_salt:type_name -> Felt252 - 17, // 58: Transaction.DeployAccountV3.calldata:type_name -> Felt252 - 0, // 59: Transaction.DeployAccountV3.l1_gas:type_name -> ResourceLimits - 0, // 60: Transaction.DeployAccountV3.l2_gas:type_name -> ResourceLimits - 17, // 61: Transaction.DeployAccountV3.tip:type_name -> Felt252 - 21, // 62: Transaction.DeployAccountV3.paymaster:type_name -> Address - 17, // 63: Transaction.InvokeV0.max_fee:type_name -> Felt252 - 1, // 64: Transaction.InvokeV0.signature:type_name -> AccountSignature - 21, // 65: Transaction.InvokeV0.address:type_name -> Address - 17, // 66: Transaction.InvokeV0.entry_point_selector:type_name -> Felt252 - 17, // 67: Transaction.InvokeV0.calldata:type_name -> Felt252 - 21, // 68: Transaction.InvokeV1.sender:type_name -> Address - 17, // 69: Transaction.InvokeV1.max_fee:type_name -> Felt252 - 1, // 70: Transaction.InvokeV1.signature:type_name -> AccountSignature - 17, // 71: Transaction.InvokeV1.calldata:type_name -> Felt252 - 17, // 72: Transaction.InvokeV1.nonce:type_name -> Felt252 - 21, // 73: Transaction.InvokeV3.sender:type_name -> Address - 17, // 74: Transaction.InvokeV3.max_fee:type_name -> Felt252 - 1, // 75: Transaction.InvokeV3.signature:type_name -> AccountSignature - 17, // 76: Transaction.InvokeV3.calldata:type_name -> Felt252 - 0, // 77: Transaction.InvokeV3.l1_gas:type_name -> ResourceLimits - 0, // 78: Transaction.InvokeV3.l2_gas:type_name -> ResourceLimits - 17, // 79: Transaction.InvokeV3.tip:type_name -> Felt252 - 21, // 80: Transaction.InvokeV3.paymaster:type_name -> Address - 17, // 81: Transaction.InvokeV3.nonce:type_name -> Felt252 - 17, // 82: Transaction.L1HandlerV1.nonce:type_name -> Felt252 - 21, // 83: Transaction.L1HandlerV1.address:type_name -> Address - 17, // 84: Transaction.L1HandlerV1.entry_point_selector:type_name -> Felt252 - 17, // 85: Transaction.L1HandlerV1.calldata:type_name -> Felt252 - 86, // [86:86] is the sub-list for method output_type - 86, // [86:86] is the sub-list for method input_type - 86, // [86:86] is the sub-list for extension type_name - 86, // [86:86] is the sub-list for extension extendee - 0, // [0:86] is the sub-list for field type_name + 2, // 53: Transaction.DeployAccountV3.signature:type_name -> AccountSignature + 18, // 54: Transaction.DeployAccountV3.class_hash:type_name -> Hash + 17, // 55: Transaction.DeployAccountV3.nonce:type_name -> Felt252 + 17, // 56: Transaction.DeployAccountV3.address_salt:type_name -> Felt252 + 17, // 57: Transaction.DeployAccountV3.calldata:type_name -> Felt252 + 1, // 58: Transaction.DeployAccountV3.resource_bounds:type_name -> ResourceBounds + 17, // 59: Transaction.DeployAccountV3.tip:type_name -> Felt252 + 21, // 60: Transaction.DeployAccountV3.paymaster_data:type_name -> Address + 17, // 61: Transaction.InvokeV0.max_fee:type_name -> Felt252 + 2, // 62: Transaction.InvokeV0.signature:type_name -> AccountSignature + 21, // 63: Transaction.InvokeV0.address:type_name -> Address + 17, // 64: Transaction.InvokeV0.entry_point_selector:type_name -> Felt252 + 17, // 65: Transaction.InvokeV0.calldata:type_name -> Felt252 + 21, // 66: Transaction.InvokeV1.sender:type_name -> Address + 17, // 67: Transaction.InvokeV1.max_fee:type_name -> Felt252 + 2, // 68: Transaction.InvokeV1.signature:type_name -> AccountSignature + 17, // 69: Transaction.InvokeV1.calldata:type_name -> Felt252 + 17, // 70: Transaction.InvokeV1.nonce:type_name -> Felt252 + 21, // 71: Transaction.InvokeV3.sender:type_name -> Address + 2, // 72: Transaction.InvokeV3.signature:type_name -> AccountSignature + 17, // 73: Transaction.InvokeV3.calldata:type_name -> Felt252 + 1, // 74: Transaction.InvokeV3.resource_bounds:type_name -> ResourceBounds + 17, // 75: Transaction.InvokeV3.tip:type_name -> Felt252 + 21, // 76: Transaction.InvokeV3.paymaster_data:type_name -> Address + 21, // 77: Transaction.InvokeV3.account_deployment_data:type_name -> Address + 17, // 78: Transaction.InvokeV3.nonce:type_name -> Felt252 + 17, // 79: Transaction.L1HandlerV0.nonce:type_name -> Felt252 + 21, // 80: Transaction.L1HandlerV0.address:type_name -> Address + 17, // 81: Transaction.L1HandlerV0.entry_point_selector:type_name -> Felt252 + 17, // 82: Transaction.L1HandlerV0.calldata:type_name -> Felt252 + 83, // [83:83] is the sub-list for method output_type + 83, // [83:83] is the sub-list for method input_type + 83, // [83:83] is the sub-list for extension type_name + 83, // [83:83] is the sub-list for extension extendee + 0, // [0:83] is the sub-list for field type_name } func init() { file_p2p_proto_transaction_proto_init() } @@ -1950,7 +1940,7 @@ func file_p2p_proto_transaction_proto_init() { } } file_p2p_proto_transaction_proto_msgTypes[1].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*AccountSignature); i { + switch v := v.(*ResourceBounds); i { case 0: return &v.state case 1: @@ -1962,7 +1952,7 @@ func file_p2p_proto_transaction_proto_init() { } } file_p2p_proto_transaction_proto_msgTypes[2].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*Transaction); i { + switch v := v.(*AccountSignature); i { case 0: return &v.state case 1: @@ -1974,7 +1964,7 @@ func file_p2p_proto_transaction_proto_init() { } } file_p2p_proto_transaction_proto_msgTypes[3].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*TransactionsRequest); i { + switch v := v.(*Transaction); i { case 0: return &v.state case 1: @@ -1986,7 +1976,7 @@ func file_p2p_proto_transaction_proto_init() { } } file_p2p_proto_transaction_proto_msgTypes[4].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*Transactions); i { + switch v := v.(*TransactionsRequest); i { case 0: return &v.state case 1: @@ -2130,7 +2120,7 @@ func file_p2p_proto_transaction_proto_init() { } } file_p2p_proto_transaction_proto_msgTypes[16].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*Transaction_L1HandlerV1); i { + switch v := v.(*Transaction_L1HandlerV0); i { case 0: return &v.state case 1: @@ -2142,7 +2132,7 @@ func file_p2p_proto_transaction_proto_init() { } } } - file_p2p_proto_transaction_proto_msgTypes[2].OneofWrappers = []interface{}{ + file_p2p_proto_transaction_proto_msgTypes[3].OneofWrappers = []interface{}{ (*Transaction_DeclareV0_)(nil), (*Transaction_DeclareV1_)(nil), (*Transaction_DeclareV2_)(nil), @@ -2156,7 +2146,7 @@ func file_p2p_proto_transaction_proto_init() { (*Transaction_L1Handler)(nil), } file_p2p_proto_transaction_proto_msgTypes[5].OneofWrappers = []interface{}{ - (*TransactionsResponse_Transactions)(nil), + (*TransactionsResponse_Transaction)(nil), (*TransactionsResponse_Fin)(nil), } type x struct{} diff --git a/p2p/sync.go b/p2p/sync.go index 635673891d..9e9e72f880 100644 --- a/p2p/sync.go +++ b/p2p/sync.go @@ -119,7 +119,8 @@ func (s *syncService) start(ctx context.Context) { s.log.Infow("Start Pipeline", "Random node height", randHeight, "Current height", nextHeight-1, "Start", nextHeight, "End", nextHeight+min(blockBehind, maxBlocks)) - commonIt := s.createIterator(uint64(nextHeight), uint64(min(blockBehind, maxBlocks))) + // todo change iteration to fetch several objects uint64(min(blockBehind, maxBlocks)) + commonIt := s.createIterator(uint64(nextHeight), 1) headersAndSigsCh, err := s.genHeadersAndSigs(iterCtx, commonIt) if err != nil { s.logError("Failed to get block headers parts", err) @@ -127,12 +128,15 @@ func (s *syncService) start(ctx context.Context) { continue } - blockBodiesCh, err := s.genBlockBodies(iterCtx, commonIt) - if err != nil { - s.logError("Failed to get block bodies", err) - cancelIteration() - continue - } + /* + blockBodiesCh, err := s.genBlockBodies(iterCtx, commonIt) + if err != nil { + s.logError("Failed to get block bodies", err) + cancelIteration() + continue + } + + */ txsCh, err := s.genTransactions(iterCtx, commonIt) if err != nil { @@ -157,7 +161,7 @@ func (s *syncService) start(ctx context.Context) { blocksCh := pipeline.Bridge(iterCtx, s.processSpecBlockParts(iterCtx, uint64(nextHeight), pipeline.FanIn(iterCtx, pipeline.Stage(iterCtx, headersAndSigsCh, specBlockPartsFunc[specBlockHeaderAndSigs]), - pipeline.Stage(iterCtx, blockBodiesCh, specBlockPartsFunc[specBlockBody]), + // pipeline.Stage(iterCtx, blockBodiesCh, specBlockPartsFunc[specBlockBody]), pipeline.Stage(iterCtx, txsCh, specBlockPartsFunc[specTransactions]), pipeline.Stage(iterCtx, receiptsCh, specBlockPartsFunc[specReceipts]), pipeline.Stage(iterCtx, eventsCh, specBlockPartsFunc[specEvents]), @@ -276,7 +280,8 @@ func (s *syncService) processSpecBlockParts( if curBlockNum > 0 { // First check cache if the header is not present, then get it from the db. if oldHeader, ok := specBlockHeadersAndSigsM[curBlockNum-1]; ok { - prevBlockRoot = p2p2core.AdaptHash(oldHeader.header.State.Root) + _ = oldHeader + // prevBlockRoot = p2p2core.AdaptHash(oldHeader.header.State.Root) } else { oldHeader, err := s.blockchain.BlockHeaderByNumber(curBlockNum - 1) if err != nil { @@ -287,8 +292,12 @@ func (s *syncService) processSpecBlockParts( } } - orderedBlockBodiesCh <- s.adaptAndSanityCheckBlock(ctx, headerAndSig.header, headerAndSig.sig, body.stateDiff, - body.classes, txs.txs, rs.receipts, es.events, prevBlockRoot) + _ = headerAndSig + _ = body.classes + _ = txs.txs + _ = es.events + orderedBlockBodiesCh <- s.adaptAndSanityCheckBlock(ctx, nil, body.stateDiff, + nil, nil, rs.receipts, nil, prevBlockRoot) } if curBlockNum > 0 { @@ -306,8 +315,8 @@ func (s *syncService) processSpecBlockParts( return orderedBlockBodiesCh } -func (s *syncService) adaptAndSanityCheckBlock(ctx context.Context, header *spec.BlockHeader, sig *spec.Signatures, diff *spec.StateDiff, - classes *spec.Classes, txs *spec.Transactions, receipts *spec.Receipts, events *spec.Events, prevBlockRoot *felt.Felt, +func (s *syncService) adaptAndSanityCheckBlock(ctx context.Context, header *spec.SignedBlockHeader, diff interface{}, + classes []*spec.Class, txs []*spec.Transaction, receipts *spec.Receipts, events []*spec.Event, prevBlockRoot *felt.Felt, ) <-chan blockBody { bodyCh := make(chan blockBody) go func() { @@ -319,16 +328,16 @@ func (s *syncService) adaptAndSanityCheckBlock(ctx context.Context, header *spec coreBlock := new(core.Block) var coreTxs []core.Transaction - for _, i := range txs.GetItems() { - coreTxs = append(coreTxs, p2p2core.AdaptTransaction(i, s.network)) + for _, tx := range txs { + coreTxs = append(coreTxs, p2p2core.AdaptTransaction(tx, s.network)) } coreBlock.Transactions = coreTxs txHashEventsM := make(map[felt.Felt][]*core.Event) - for _, item := range events.GetItems() { - txH := p2p2core.AdaptHash(item.TransactionHash) - txHashEventsM[*txH] = append(txHashEventsM[*txH], p2p2core.AdaptEvent(item)) + for _, event := range events { + txH := p2p2core.AdaptHash(event.TransactionHash) + txHashEventsM[*txH] = append(txHashEventsM[*txH], p2p2core.AdaptEvent(event)) } coreReceipts := utils.Map(receipts.GetItems(), p2p2core.AdaptReceipt) @@ -339,7 +348,7 @@ func (s *syncService) adaptAndSanityCheckBlock(ctx context.Context, header *spec coreBlock.Receipts = coreReceipts coreHeader := p2p2core.AdaptBlockHeader(header) - coreHeader.Signatures = utils.Map(sig.GetSignatures(), p2p2core.AdaptSignature) + coreHeader.Signatures = utils.Map(header.Signatures, p2p2core.AdaptSignature) coreBlock.Header = &coreHeader coreBlock.EventsBloom = core.EventsBloom(coreBlock.Receipts) @@ -351,8 +360,8 @@ func (s *syncService) adaptAndSanityCheckBlock(ctx context.Context, header *spec coreBlock.Hash = h newClasses := make(map[felt.Felt]core.Class) - for _, i := range classes.GetClasses() { - coreC := p2p2core.AdaptClass(i) + for _, cls := range classes { + coreC := p2p2core.AdaptClass(cls) h, err = coreC.Hash() if err != nil { bodyCh <- blockBody{err: fmt.Errorf("class hash calculation error: %v", err)} @@ -369,7 +378,7 @@ func (s *syncService) adaptAndSanityCheckBlock(ctx context.Context, header *spec BlockHash: coreBlock.Hash, NewRoot: coreBlock.GlobalStateRoot, OldRoot: prevBlockRoot, - StateDiff: p2p2core.AdaptStateDiff(diff, classes.GetClasses()), + StateDiff: p2p2core.AdaptStateDiff(diff, classes), } commitments, err := s.blockchain.SanityCheckNewHeight(coreBlock, stateUpdate, newClasses) @@ -393,8 +402,7 @@ type specBlockParts interface { } type specBlockHeaderAndSigs struct { - header *spec.BlockHeader - sig *spec.Signatures + header *spec.SignedBlockHeader } func (s specBlockHeaderAndSigs) blockNumber() uint64 { @@ -413,15 +421,11 @@ func (s *syncService) genHeadersAndSigs(ctx context.Context, it *spec.Iteration) headersIt(func(res *spec.BlockHeadersResponse) bool { headerAndSig := specBlockHeaderAndSigs{} - for _, part := range res.GetPart() { - switch part.HeaderMessage.(type) { - case *spec.BlockHeadersResponsePart_Header: - headerAndSig.header = part.GetHeader() - case *spec.BlockHeadersResponsePart_Signatures: - headerAndSig.sig = part.GetSignatures() - case *spec.BlockHeadersResponsePart_Fin: - return false - } + switch v := res.HeaderMessage.(type) { + case *spec.BlockHeadersResponse_Header: + headerAndSig.header = v.Header + case *spec.BlockHeadersResponse_Fin: + return false } select { @@ -448,6 +452,7 @@ func (s specBlockBody) blockNumber() uint64 { return s.id.Number } +/* func (s *syncService) genBlockBodies(ctx context.Context, it *spec.Iteration) (<-chan specBlockBody, error) { blockIt, err := s.client.RequestBlockBodies(ctx, &spec.BlockBodiesRequest{Iteration: it}) if err != nil { @@ -499,6 +504,8 @@ func (s *syncService) genBlockBodies(ctx context.Context, it *spec.Iteration) (< return specBodiesCh, nil } +*/ + type specReceipts struct { id *spec.BlockID receipts *spec.Receipts @@ -520,8 +527,8 @@ func (s *syncService) genReceipts(ctx context.Context, it *spec.Iteration) (<-ch defer close(receiptsCh) receiptsIt(func(res *spec.ReceiptsResponse) bool { - switch res.Responses.(type) { - case *spec.ReceiptsResponse_Receipts: + switch res.ReceiptMessage.(type) { + case *spec.ReceiptsResponse_Receipt: select { case <-ctx.Done(): return false @@ -540,7 +547,7 @@ func (s *syncService) genReceipts(ctx context.Context, it *spec.Iteration) (<-ch type specEvents struct { id *spec.BlockID - events *spec.Events + events []spec.Event } func (s specEvents) blockNumber() uint64 { @@ -578,7 +585,7 @@ func (s *syncService) genEvents(ctx context.Context, it *spec.Iteration) (<-chan type specTransactions struct { id *spec.BlockID - txs *spec.Transactions + txs []spec.Transaction } func (s specTransactions) blockNumber() uint64 { @@ -597,8 +604,8 @@ func (s *syncService) genTransactions(ctx context.Context, it *spec.Iteration) ( defer close(txsCh) txsIt(func(res *spec.TransactionsResponse) bool { - switch res.Responses.(type) { - case *spec.TransactionsResponse_Transactions: + switch res.TransactionMessage.(type) { + case *spec.TransactionsResponse_Transaction: select { case <-ctx.Done(): return false From 31a573bf7ccba9f0f78741e891b59a768127ff82 Mon Sep 17 00:00:00 2001 From: Kirill Date: Mon, 6 May 2024 14:08:50 +0400 Subject: [PATCH 03/18] Fix some compilation errors --- adapters/core2p2p/state.go | 28 ++++++++--------- adapters/p2p2core/state.go | 39 ++++++++++++++---------- p2p/starknet/client.go | 20 ++++++------- p2p/starknet/handlers.go | 58 +++++++++++++++++------------------- p2p/sync.go | 61 +++++++++++++++++++------------------- 5 files changed, 106 insertions(+), 100 deletions(-) diff --git a/adapters/core2p2p/state.go b/adapters/core2p2p/state.go index 3ebfcbd0c8..e272239b1e 100644 --- a/adapters/core2p2p/state.go +++ b/adapters/core2p2p/state.go @@ -6,14 +6,14 @@ import ( "github.com/NethermindEth/juno/utils" ) -func AdaptStateDiff(addr, nonce *felt.Felt, diff map[felt.Felt]*felt.Felt) *spec.StateDiff_ContractDiff { - return &spec.StateDiff_ContractDiff{ - Address: AdaptAddress(addr), - Nonce: AdaptFelt(nonce), - ClassHash: nil, // This will need to be set if deployed_contracts and replaced_classes are removed from StateDiff - Values: AdaptStorageDiff(diff), - } -} +//func AdaptStateDiff(addr, nonce *felt.Felt, diff map[felt.Felt]*felt.Felt) *spec.StateDiff_ContractDiff { +// return &spec.StateDiff_ContractDiff{ +// Address: AdaptAddress(addr), +// Nonce: AdaptFelt(nonce), +// ClassHash: nil, // This will need to be set if deployed_contracts and replaced_classes are removed from StateDiff +// Values: AdaptStorageDiff(diff), +// } +//} func AdaptStorageDiff(diff map[felt.Felt]*felt.Felt) []*spec.ContractStoredValue { return utils.ToSlice(diff, func(key felt.Felt, value *felt.Felt) *spec.ContractStoredValue { @@ -24,9 +24,9 @@ func AdaptStorageDiff(diff map[felt.Felt]*felt.Felt) []*spec.ContractStoredValue }) } -func AdaptAddressClassHashPair(address felt.Felt, classHash *felt.Felt) *spec.StateDiff_ContractAddrToClassHash { - return &spec.StateDiff_ContractAddrToClassHash{ - ContractAddr: AdaptAddress(&address), - ClassHash: AdaptHash(classHash), - } -} +//func AdaptAddressClassHashPair(address felt.Felt, classHash *felt.Felt) *spec.StateDiff_ContractAddrToClassHash { +// return &spec.StateDiff_ContractAddrToClassHash{ +// ContractAddr: AdaptAddress(&address), +// ClassHash: AdaptHash(classHash), +// } +//} diff --git a/adapters/p2p2core/state.go b/adapters/p2p2core/state.go index bb5ca5df92..636404c319 100644 --- a/adapters/p2p2core/state.go +++ b/adapters/p2p2core/state.go @@ -9,17 +9,7 @@ import ( "github.com/NethermindEth/juno/utils" ) -func AdaptStateDiff(s *spec.StateDiff, classes []*spec.Class) *core.StateDiff { - /** - - Address *Address `protobuf:"bytes,1,opt,name=address,proto3" json:"address,omitempty"` - Nonce *Felt252 `protobuf:"bytes,2,opt,name=nonce,proto3,oneof" json:"nonce,omitempty"` // Present only if the nonce was updated - ClassHash *Hash `protobuf:"bytes,3,opt,name=class_hash,json=classHash,proto3,oneof" json:"class_hash,omitempty"` // Present only if the contract was deployed or replaced in this block. - IsReplaced *bool `protobuf:"varint,4,opt,name=is_replaced,json=isReplaced,proto3,oneof" json:"is_replaced,omitempty"` // Present only if the contract was deployed or replaced, in order to determine whether the contract was deployed or replaced. - Values []*ContractStoredValue `protobuf:"bytes,5,rep,name=values,proto3" json:"values,omitempty"` - Domain uint32 - */ - +func AdaptStateDiff(contractDiffs []*spec.ContractDiff, classes []*spec.Class) *core.StateDiff { var ( declaredV0Classes []*felt.Felt declaredV1Classes = make(map[felt.Felt]*felt.Felt) @@ -38,25 +28,37 @@ func AdaptStateDiff(s *spec.StateDiff, classes []*spec.Class) *core.StateDiff { } } + var deployedContracts, replacedClasses []addrToClassHash // addr -> {key -> value, ...} storageDiffs := make(map[felt.Felt]map[felt.Felt]*felt.Felt) nonces := make(map[felt.Felt]*felt.Felt) - for _, diff := range s.ContractDiffs { + for _, diff := range contractDiffs { address := AdaptAddress(diff.Address) if diff.Nonce != nil { nonces[*address] = AdaptFelt(diff.Nonce) } storageDiffs[*address] = utils.ToMap(diff.Values, adaptStoredValue) + + // todo recheck this logic + addrToClsHash := addrToClassHash{ + addr: diff.Address, + classHash: diff.ClassHash, + } + if diff.GetIsReplaced() { + replacedClasses = append(replacedClasses, addrToClsHash) + } else { + deployedContracts = append(deployedContracts, addrToClsHash) + } } return &core.StateDiff{ StorageDiffs: storageDiffs, Nonces: nonces, - DeployedContracts: utils.ToMap(s.DeployedContracts, adaptAddrToClassHash), + DeployedContracts: utils.ToMap(deployedContracts, adaptAddrToClassHash), DeclaredV0Classes: declaredV0Classes, DeclaredV1Classes: declaredV1Classes, - ReplacedClasses: utils.ToMap(s.ReplacedClasses, adaptAddrToClassHash), + ReplacedClasses: utils.ToMap(replacedClasses, adaptAddrToClassHash), } } @@ -64,7 +66,12 @@ func adaptStoredValue(v *spec.ContractStoredValue) (felt.Felt, *felt.Felt) { return *AdaptFelt(v.Key), AdaptFelt(v.Value) } +type addrToClassHash struct { + addr *spec.Address + classHash *spec.Hash +} + // todo rename -func adaptAddrToClassHash(v *spec.StateDiff_ContractAddrToClassHash) (felt.Felt, *felt.Felt) { - return *AdaptAddress(v.ContractAddr), AdaptHash(v.ClassHash) +func adaptAddrToClassHash(v addrToClassHash) (felt.Felt, *felt.Felt) { + return *AdaptAddress(v.addr), AdaptHash(v.classHash) } diff --git a/p2p/starknet/client.go b/p2p/starknet/client.go index fb69e6bbbb..d65222365f 100644 --- a/p2p/starknet/client.go +++ b/p2p/starknet/client.go @@ -89,12 +89,12 @@ func requestAndReceiveStream[ReqT proto.Message, ResT proto.Message](ctx context }, nil } -func (c *Client) RequestCurrentBlockHeader( - ctx context.Context, req *spec.CurrentBlockHeaderRequest, -) (iter.Seq[*spec.BlockHeadersResponse], error) { - return requestAndReceiveStream[*spec.CurrentBlockHeaderRequest, *spec.BlockHeadersResponse](ctx, c.newStream, - CurrentBlockHeaderPID(c.network), req, c.log) -} +//func (c *Client) RequestCurrentBlockHeader( +// ctx context.Context, req *spec.CurrentBlockHeaderRequest, +//) (iter.Seq[*spec.BlockHeadersResponse], error) { +// return requestAndReceiveStream[*spec.CurrentBlockHeaderRequest, *spec.BlockHeadersResponse](ctx, c.newStream, +// CurrentBlockHeaderPID(c.network), req, c.log) +//} func (c *Client) RequestBlockHeaders( ctx context.Context, req *spec.BlockHeadersRequest, @@ -103,10 +103,10 @@ func (c *Client) RequestBlockHeaders( ctx, c.newStream, BlockHeadersPID(c.network), req, c.log) } -func (c *Client) RequestBlockBodies(ctx context.Context, req *spec.BlockBodiesRequest) (iter.Seq[*spec.BlockBodiesResponse], error) { - return requestAndReceiveStream[*spec.BlockBodiesRequest, *spec.BlockBodiesResponse]( - ctx, c.newStream, BlockBodiesPID(c.network), req, c.log) -} +//func (c *Client) RequestBlockBodies(ctx context.Context, req *spec.BlockBodiesRequest) (iter.Seq[*spec.BlockBodiesResponse], error) { +// return requestAndReceiveStream[*spec.BlockBodiesRequest, *spec.BlockBodiesResponse]( +// ctx, c.newStream, BlockBodiesPID(c.network), req, c.log) +//} func (c *Client) RequestEvents(ctx context.Context, req *spec.EventsRequest) (iter.Seq[*spec.EventsResponse], error) { return requestAndReceiveStream[*spec.EventsRequest, *spec.EventsResponse](ctx, c.newStream, EventsPID(c.network), req, c.log) diff --git a/p2p/starknet/handlers.go b/p2p/starknet/handlers.go index 1299739b35..942a7ab5fe 100644 --- a/p2p/starknet/handlers.go +++ b/p2p/starknet/handlers.go @@ -108,9 +108,9 @@ func (h *Handler) BlockHeadersHandler(stream network.Stream) { streamHandler[*spec.BlockHeadersRequest](h.ctx, &h.wg, stream, h.onBlockHeadersRequest, h.log) } -func (h *Handler) BlockBodiesHandler(stream network.Stream) { - streamHandler[*spec.BlockBodiesRequest](h.ctx, &h.wg, stream, h.onBlockBodiesRequest, h.log) -} +//func (h *Handler) BlockBodiesHandler(stream network.Stream) { +// streamHandler[*spec.BlockBodiesRequest](h.ctx, &h.wg, stream, h.onBlockBodiesRequest, h.log) +//} func (h *Handler) EventsHandler(stream network.Stream) { streamHandler[*spec.EventsRequest](h.ctx, &h.wg, stream, h.onEventsRequest, h.log) @@ -124,35 +124,31 @@ func (h *Handler) TransactionsHandler(stream network.Stream) { streamHandler[*spec.TransactionsRequest](h.ctx, &h.wg, stream, h.onTransactionsRequest, h.log) } -func (h *Handler) CurrentBlockHeaderHandler(stream network.Stream) { - streamHandler[*spec.CurrentBlockHeaderRequest](h.ctx, &h.wg, stream, h.onCurrentBlockHeaderRequest, h.log) -} - -func (h *Handler) onCurrentBlockHeaderRequest(*spec.CurrentBlockHeaderRequest) (iter.Seq[proto.Message], error) { - curHeight, err := h.bcReader.Height() - if err != nil { - return nil, err - } - - return h.onBlockHeadersRequest(&spec.BlockHeadersRequest{ - Iteration: &spec.Iteration{ - Start: &spec.Iteration_BlockNumber{ - BlockNumber: curHeight, - }, - Direction: spec.Iteration_Forward, - Limit: 1, - Step: 1, - }, - }) -} +//func (h *Handler) CurrentBlockHeaderHandler(stream network.Stream) { +// streamHandler[*spec.CurrentBlockHeaderRequest](h.ctx, &h.wg, stream, h.onCurrentBlockHeaderRequest, h.log) +//} + +//func (h *Handler) onCurrentBlockHeaderRequest(*spec.CurrentBlockHeaderRequest) (iter.Seq[proto.Message], error) { +// curHeight, err := h.bcReader.Height() +// if err != nil { +// return nil, err +// } +// +// return h.onBlockHeadersRequest(&spec.BlockHeadersRequest{ +// Iteration: &spec.Iteration{ +// Start: &spec.Iteration_BlockNumber{ +// BlockNumber: curHeight, +// }, +// Direction: spec.Iteration_Forward, +// Limit: 1, +// Step: 1, +// }, +// }) +//} func (h *Handler) onBlockHeadersRequest(req *spec.BlockHeadersRequest) (iter.Seq[proto.Message], error) { finMsg := &spec.BlockHeadersResponse{ - Part: []*spec.BlockHeadersResponsePart{ - { - HeaderMessage: &spec.BlockHeadersResponsePart_Fin{}, - }, - }, + HeaderMessage: &spec.BlockHeadersResponse_Fin{}, } return h.processIterationRequest(req.Iteration, finMsg, func(it blockDataAccessor) (proto.Message, error) { @@ -188,6 +184,7 @@ func (h *Handler) onBlockHeadersRequest(req *spec.BlockHeadersRequest) (iter.Seq }) } +/* func (h *Handler) onBlockBodiesRequest(req *spec.BlockBodiesRequest) (iter.Seq[proto.Message], error) { it, err := h.newIterator(req.Iteration) if err != nil { @@ -230,10 +227,11 @@ func (h *Handler) onBlockBodiesRequest(req *spec.BlockBodiesRequest) (iter.Seq[p yield(finMsg) }, nil } +*/ func (h *Handler) onEventsRequest(req *spec.EventsRequest) (iter.Seq[proto.Message], error) { finMsg := &spec.EventsResponse{ - Responses: &spec.EventsResponse_Fin{}, + EventMessage: &spec.EventsResponse_Fin{}, } return h.processIterationRequest(req.Iteration, finMsg, func(it blockDataAccessor) (proto.Message, error) { block, err := it.Block() diff --git a/p2p/sync.go b/p2p/sync.go index 9e9e72f880..e48c698f74 100644 --- a/p2p/sync.go +++ b/p2p/sync.go @@ -47,25 +47,26 @@ func newSyncService(bc *blockchain.Blockchain, h host.Host, n *utils.Network, lo } func (s *syncService) randomNodeHeight(ctx context.Context) (int, error) { - headersIt, err := s.client.RequestCurrentBlockHeader(ctx, &spec.CurrentBlockHeaderRequest{}) - if err != nil { - return 0, err - } - - var header *spec.BlockHeader - headersIt(func(res *spec.BlockHeadersResponse) bool { - for _, part := range res.GetPart() { - if _, ok := part.HeaderMessage.(*spec.BlockHeadersResponsePart_Header); ok { - header = part.GetHeader() - // found header - time to stop iterator - return false - } - } - - return true - }) - - return int(header.Number), nil + return 0, nil + //headersIt, err := s.client.RequestCurrentBlockHeader(ctx, &spec.CurrentBlockHeaderRequest{}) + //if err != nil { + // return 0, err + //} + // + //var header *spec.BlockHeader + //headersIt(func(res *spec.BlockHeadersResponse) bool { + // for _, part := range res.GetPart() { + // if _, ok := part.HeaderMessage.(*spec.BlockHeadersResponsePart_Header); ok { + // header = part.GetHeader() + // // found header - time to stop iterator + // return false + // } + // } + // + // return true + //}) + // + //return int(header.Number), nil } const retryDuration = 5 * time.Second @@ -378,7 +379,7 @@ func (s *syncService) adaptAndSanityCheckBlock(ctx context.Context, header *spec BlockHash: coreBlock.Hash, NewRoot: coreBlock.GlobalStateRoot, OldRoot: prevBlockRoot, - StateDiff: p2p2core.AdaptStateDiff(diff, classes), + StateDiff: p2p2core.AdaptStateDiff(nil, classes), } commitments, err := s.blockchain.SanityCheckNewHeight(coreBlock, stateUpdate, newClasses) @@ -442,10 +443,10 @@ func (s *syncService) genHeadersAndSigs(ctx context.Context, it *spec.Iteration) } type specBlockBody struct { - id *spec.BlockID - proof *spec.BlockProof - classes *spec.Classes - stateDiff *spec.StateDiff + id *spec.BlockID + // proof *spec.BlockProof + classes []*spec.Class + stateDiff []*spec.ContractDiff } func (s specBlockBody) blockNumber() uint64 { @@ -532,7 +533,7 @@ func (s *syncService) genReceipts(ctx context.Context, it *spec.Iteration) (<-ch select { case <-ctx.Done(): return false - case receiptsCh <- specReceipts{res.GetId(), res.GetReceipts()}: + // case receiptsCh <- specReceipts{res.GetId(), res.GetReceipts()}: } case *spec.ReceiptsResponse_Fin: return false @@ -565,13 +566,13 @@ func (s *syncService) genEvents(ctx context.Context, it *spec.Iteration) (<-chan defer close(eventsCh) eventsIt(func(res *spec.EventsResponse) bool { - switch res.Responses.(type) { - case *spec.EventsResponse_Events: + switch res.EventMessage.(type) { + case *spec.EventsResponse_Event: select { case <-ctx.Done(): return false - case eventsCh <- specEvents{res.GetId(), res.GetEvents()}: - return true + // case eventsCh <- specEvents{res.GetId(), res.GetEvents()}: + // return true } case *spec.EventsResponse_Fin: return false @@ -609,7 +610,7 @@ func (s *syncService) genTransactions(ctx context.Context, it *spec.Iteration) ( select { case <-ctx.Done(): return false - case txsCh <- specTransactions{res.GetId(), res.GetTransactions()}: + // case txsCh <- specTransactions{res.GetId(), res.GetTransactions()}: } case *spec.TransactionsResponse_Fin: return false From c75e18d15e0e3de8e43e555f1ebf5f88e6057b22 Mon Sep 17 00:00:00 2001 From: Kirill Date: Wed, 22 May 2024 14:46:33 +0400 Subject: [PATCH 04/18] New methods, updated structs --- adapters/core2p2p/block.go | 1 + adapters/core2p2p/state.go | 18 ++- p2p/p2p.go | 10 +- p2p/p2p_test.go | 2 +- p2p/starknet/block_bodies.go | 79 +++++---- p2p/starknet/client.go | 10 +- p2p/starknet/handlers.go | 254 +++++++++++++++++++++++------ p2p/starknet/ids.go | 22 ++- p2p/starknet/starknet_test.go | 2 +- p2p/sync.go | 294 ++++++++++++++++++++++++++-------- 10 files changed, 517 insertions(+), 175 deletions(-) diff --git a/adapters/core2p2p/block.go b/adapters/core2p2p/block.go index 7061b575e1..06eac6887b 100644 --- a/adapters/core2p2p/block.go +++ b/adapters/core2p2p/block.go @@ -47,6 +47,7 @@ func AdaptHeader(header *core.Header, commitments *core.BlockCommitments) *spec. }, ProtocolVersion: header.ProtocolVersion, GasPrice: AdaptFelt(header.GasPrice), + Signatures: utils.Map(header.Signatures, AdaptSignature), } } diff --git a/adapters/core2p2p/state.go b/adapters/core2p2p/state.go index e272239b1e..2d1456a1ef 100644 --- a/adapters/core2p2p/state.go +++ b/adapters/core2p2p/state.go @@ -6,14 +6,16 @@ import ( "github.com/NethermindEth/juno/utils" ) -//func AdaptStateDiff(addr, nonce *felt.Felt, diff map[felt.Felt]*felt.Felt) *spec.StateDiff_ContractDiff { -// return &spec.StateDiff_ContractDiff{ -// Address: AdaptAddress(addr), -// Nonce: AdaptFelt(nonce), -// ClassHash: nil, // This will need to be set if deployed_contracts and replaced_classes are removed from StateDiff -// Values: AdaptStorageDiff(diff), -// } -//} +func AdaptContractDiff(addr, nonce *felt.Felt, diff map[felt.Felt]*felt.Felt) *spec.ContractDiff { + return &spec.ContractDiff{ + Address: AdaptAddress(addr), + Nonce: AdaptFelt(nonce), + ClassHash: nil, // This will need to be set if deployed_contracts and replaced_classes are removed from StateDiff + IsReplaced: nil, + Values: AdaptStorageDiff(diff), + Domain: 0, + } +} func AdaptStorageDiff(diff map[felt.Felt]*felt.Felt) []*spec.ContractStoredValue { return utils.ToSlice(diff, func(key felt.Felt, value *felt.Felt) *spec.ContractStoredValue { diff --git a/p2p/p2p.go b/p2p/p2p.go index c1ef8153e6..d43bcb2175 100644 --- a/p2p/p2p.go +++ b/p2p/p2p.go @@ -220,13 +220,15 @@ func (s *Service) Run(ctx context.Context) error { } func (s *Service) setProtocolHandlers() { - s.SetProtocolHandler(starknet.BlockHeadersPID(s.network), s.handler.BlockHeadersHandler) - s.SetProtocolHandler(starknet.CurrentBlockHeaderPID(s.network), s.handler.CurrentBlockHeaderHandler) + s.SetProtocolHandler(starknet.HeadersPID(s.network), s.handler.HeadersHandler) + // s.SetProtocolHandler(starknet.CurrentBlockHeaderPID(s.network), s.handler.CurrentBlockHeaderHandler) s.SetProtocolHandler(starknet.ReceiptsPID(s.network), s.handler.ReceiptsHandler) - // todo discuss protocol id (should it be included in BlockHeadersPID) - s.SetProtocolHandler(starknet.BlockBodiesPID(s.network), s.handler.BlockBodiesHandler) + // todo discuss protocol id (should it be included in HeadersPID) + // s.SetProtocolHandler(starknet.BlockBodiesPID(s.network), s.handler.BlockBodiesHandler) s.SetProtocolHandler(starknet.EventsPID(s.network), s.handler.EventsHandler) s.SetProtocolHandler(starknet.TransactionsPID(s.network), s.handler.TransactionsHandler) + s.SetProtocolHandler(starknet.ClassesPID(s.network), s.handler.ClassesHandler) + s.SetProtocolHandler(starknet.StateDiffPID(s.network), s.handler.StateDiffHandler) } func (s *Service) callAndLogErr(f func() error, msg string) { diff --git a/p2p/p2p_test.go b/p2p/p2p_test.go index 5b536fa09a..e9d48634cd 100644 --- a/p2p/p2p_test.go +++ b/p2p/p2p_test.go @@ -72,7 +72,7 @@ func TestService(t *testing.T) { case evt := <-events: require.Equal(t, network.Connected, evt.Connectedness) case <-time.After(timeout): - require.True(t, false, "no events were emitted") + require.True(t, false, "no classes were emitted") } t.Run("gossip", func(t *testing.T) { diff --git a/p2p/starknet/block_bodies.go b/p2p/starknet/block_bodies.go index 2baa0761c7..7df0db763d 100644 --- a/p2p/starknet/block_bodies.go +++ b/p2p/starknet/block_bodies.go @@ -111,17 +111,20 @@ func (b *blockBodyIterator) classes() (proto.Message, bool) { classes = append(classes, core2p2p.AdaptClass(cls.Class)) } - res := &spec.BlockBodiesResponse{ - Id: b.blockID(), - BodyMessage: &spec.BlockBodiesResponse_Classes{ - Classes: &spec.Classes{ - Domain: 0, - Classes: classes, + /* + res := &spec.BlockBodiesResponse{ + Id: b.blockID(), + BodyMessage: &spec.BlockBodiesResponse_Classes{ + Classes: &spec.Classes{ + Domain: 0, + Classes: classes, + }, }, - }, - } + } - return res, true + */ + + return nil, true } type contractDiff struct { @@ -173,22 +176,26 @@ func (b *blockBodyIterator) diff() (proto.Message, bool) { } } - var contractDiffs []*spec.StateDiff_ContractDiff - for _, c := range modifiedContracts { - contractDiffs = append(contractDiffs, core2p2p.AdaptStateDiff(c.address, c.nonce, c.storageDiffs)) - } + /* + var contractDiffs []*spec.StateDiff_ContractDiff + for _, c := range modifiedContracts { + contractDiffs = append(contractDiffs, core2p2p.AdaptContractDiff(c.address, c.nonce, c.storageDiffs)) + } - return &spec.BlockBodiesResponse{ - Id: b.blockID(), - BodyMessage: &spec.BlockBodiesResponse_Diff{ - Diff: &spec.StateDiff{ - Domain: 0, - ContractDiffs: contractDiffs, - ReplacedClasses: utils.ToSlice(diff.ReplacedClasses, core2p2p.AdaptAddressClassHashPair), - DeployedContracts: utils.ToSlice(diff.DeployedContracts, core2p2p.AdaptAddressClassHashPair), + return &spec.BlockBodiesResponse{ + Id: b.blockID(), + BodyMessage: &spec.BlockBodiesResponse_Diff{ + Diff: &spec.StateDiff{ + Domain: 0, + ContractDiffs: contractDiffs, + ReplacedClasses: utils.ToSlice(diff.ReplacedClasses, core2p2p.AdaptAddressClassHashPair), + DeployedContracts: utils.ToSlice(diff.DeployedContracts, core2p2p.AdaptAddressClassHashPair), + }, }, - }, - }, true + }, true + */ + + return nil, true } func (b *blockBodyIterator) fin() (proto.Message, bool) { @@ -196,10 +203,11 @@ func (b *blockBodyIterator) fin() (proto.Message, bool) { if err := b.stateCloser(); err != nil { b.log.Errorw("Call to state closer failed", "err", err) } - return &spec.BlockBodiesResponse{ - Id: b.blockID(), - BodyMessage: &spec.BlockBodiesResponse_Fin{}, - }, true + //return &spec.BlockBodiesResponse{ + // Id: b.blockID(), + // BodyMessage: &spec.BlockBodiesResponse_Fin{}, + //}, true + return nil, true } func (b *blockBodyIterator) proof() (proto.Message, bool) { @@ -211,14 +219,15 @@ func (b *blockBodyIterator) proof() (proto.Message, bool) { return b.fin() } - return &spec.BlockBodiesResponse{ - Id: b.blockID(), - BodyMessage: &spec.BlockBodiesResponse_Proof{ - Proof: &spec.BlockProof{ - Proof: proof, - }, - }, - }, true + //return &spec.BlockBodiesResponse{ + // Id: b.blockID(), + // BodyMessage: &spec.BlockBodiesResponse_Proof{ + // Proof: &spec.BlockProof{ + // Proof: proof, + // }, + // }, + //}, true + return nil, true } func (b *blockBodyIterator) blockID() *spec.BlockID { diff --git a/p2p/starknet/client.go b/p2p/starknet/client.go index 0c82261331..99275b60e1 100644 --- a/p2p/starknet/client.go +++ b/p2p/starknet/client.go @@ -102,7 +102,7 @@ func (c *Client) RequestBlockHeaders( ctx context.Context, req *spec.BlockHeadersRequest, ) (iter.Seq[*spec.BlockHeadersResponse], error) { return requestAndReceiveStream[*spec.BlockHeadersRequest, *spec.BlockHeadersResponse]( - ctx, c.newStream, BlockHeadersPID(c.network), req, c.log) + ctx, c.newStream, HeadersPID(c.network), req, c.log) } //func (c *Client) RequestBlockBodies(ctx context.Context, req *spec.BlockBodiesRequest) (iter.Seq[*spec.BlockBodiesResponse], error) { @@ -114,6 +114,14 @@ func (c *Client) RequestEvents(ctx context.Context, req *spec.EventsRequest) (it return requestAndReceiveStream[*spec.EventsRequest, *spec.EventsResponse](ctx, c.newStream, EventsPID(c.network), req, c.log) } +func (c *Client) RequestClasses(ctx context.Context, req *spec.ClassesRequest) (iter.Seq[*spec.ClassesResponse], error) { + return requestAndReceiveStream[*spec.ClassesRequest, *spec.ClassesResponse](ctx, c.newStream, ClassesPID(c.network), req, c.log) +} + +func (c *Client) RequestStateDiffs(ctx context.Context, req *spec.StateDiffsRequest) (iter.Seq[*spec.StateDiffsResponse], error) { + return requestAndReceiveStream[*spec.StateDiffsRequest, *spec.StateDiffsResponse](ctx, c.newStream, StateDiffPID(c.network), req, c.log) +} + func (c *Client) RequestReceipts(ctx context.Context, req *spec.ReceiptsRequest) (iter.Seq[*spec.ReceiptsResponse], error) { return requestAndReceiveStream[*spec.ReceiptsRequest, *spec.ReceiptsResponse](ctx, c.newStream, ReceiptsPID(c.network), req, c.log) } diff --git a/p2p/starknet/handlers.go b/p2p/starknet/handlers.go index 2e3f470b0a..70b7b32ea8 100644 --- a/p2p/starknet/handlers.go +++ b/p2p/starknet/handlers.go @@ -7,6 +7,8 @@ import ( "fmt" "sync" + "github.com/NethermindEth/juno/core/felt" + "github.com/NethermindEth/juno/adapters/core2p2p" "github.com/NethermindEth/juno/adapters/p2p2core" "github.com/NethermindEth/juno/blockchain" @@ -104,8 +106,8 @@ func streamHandler[ReqT proto.Message](ctx context.Context, wg *sync.WaitGroup, }) } -func (h *Handler) BlockHeadersHandler(stream network.Stream) { - streamHandler[*spec.BlockHeadersRequest](h.ctx, &h.wg, stream, h.onBlockHeadersRequest, h.log) +func (h *Handler) HeadersHandler(stream network.Stream) { + streamHandler[*spec.BlockHeadersRequest](h.ctx, &h.wg, stream, h.onHeadersRequest, h.log) } //func (h *Handler) BlockBodiesHandler(stream network.Stream) { @@ -124,6 +126,14 @@ func (h *Handler) TransactionsHandler(stream network.Stream) { streamHandler[*spec.TransactionsRequest](h.ctx, &h.wg, stream, h.onTransactionsRequest, h.log) } +func (h *Handler) ClassesHandler(stream network.Stream) { + streamHandler[*spec.ClassesRequest](h.ctx, &h.wg, stream, h.onClassesRequest, h.log) +} + +func (h *Handler) StateDiffHandler(stream network.Stream) { + streamHandler[*spec.StateDiffsRequest](h.ctx, &h.wg, stream, h.onStateDiffRequest, h.log) +} + //func (h *Handler) CurrentBlockHeaderHandler(stream network.Stream) { // streamHandler[*spec.CurrentBlockHeaderRequest](h.ctx, &h.wg, stream, h.onCurrentBlockHeaderRequest, h.log) //} @@ -134,7 +144,7 @@ func (h *Handler) TransactionsHandler(stream network.Stream) { // return nil, err // } // -// return h.onBlockHeadersRequest(&spec.BlockHeadersRequest{ +// return h.onHeadersRequest(&spec.BlockHeadersRequest{ // Iteration: &spec.Iteration{ // Start: &spec.Iteration_BlockNumber{ // BlockNumber: curHeight, @@ -146,7 +156,7 @@ func (h *Handler) TransactionsHandler(stream network.Stream) { // }) //} -func (h *Handler) onBlockHeadersRequest(req *spec.BlockHeadersRequest) (iter.Seq[proto.Message], error) { +func (h *Handler) onHeadersRequest(req *spec.BlockHeadersRequest) (iter.Seq[proto.Message], error) { finMsg := &spec.BlockHeadersResponse{ HeaderMessage: &spec.BlockHeadersResponse_Fin{}, } @@ -165,20 +175,8 @@ func (h *Handler) onBlockHeadersRequest(req *spec.BlockHeadersRequest) (iter.Seq } return &spec.BlockHeadersResponse{ - Part: []*spec.BlockHeadersResponsePart{ - { - HeaderMessage: &spec.BlockHeadersResponsePart_Header{ - Header: core2p2p.AdaptHeader(header, commitments), - }, - }, - { - HeaderMessage: &spec.BlockHeadersResponsePart_Signatures{ - Signatures: &spec.Signatures{ - Block: core2p2p.AdaptBlockID(header), - Signatures: utils.Map(header.Signatures, core2p2p.AdaptSignature), - }, - }, - }, + HeaderMessage: &spec.BlockHeadersResponse_Header{ + Header: core2p2p.AdaptHeader(header, commitments), }, }, nil }) @@ -237,70 +235,189 @@ func (h *Handler) onEventsRequest(req *spec.EventsRequest) (iter.Seq[proto.Messa finMsg := &spec.EventsResponse{ EventMessage: &spec.EventsResponse_Fin{}, } - return h.processIterationRequest(req.Iteration, finMsg, func(it blockDataAccessor) (proto.Message, error) { + return h.processIterationRequestMulti(req.Iteration, finMsg, func(it blockDataAccessor) ([]proto.Message, error) { block, err := it.Block() if err != nil { return nil, err } - events := make([]*spec.Event, 0, len(block.Receipts)) + responses := make([]proto.Message, 0, len(block.Receipts)) for _, receipt := range block.Receipts { for _, event := range receipt.Events { - events = append(events, core2p2p.AdaptEvent(event, receipt.TransactionHash)) + responses = append(responses, &spec.EventsResponse{ + EventMessage: &spec.EventsResponse_Event{ + Event: core2p2p.AdaptEvent(event, receipt.TransactionHash), + }, + }) } } - return &spec.EventsResponse{ - Id: core2p2p.AdaptBlockID(block.Header), - Responses: &spec.EventsResponse_Events{ - Events: &spec.Events{ - Items: events, - }, - }, - }, nil + return responses, nil }) } func (h *Handler) onReceiptsRequest(req *spec.ReceiptsRequest) (iter.Seq[proto.Message], error) { - finMsg := &spec.ReceiptsResponse{Responses: &spec.ReceiptsResponse_Fin{}} - return h.processIterationRequest(req.Iteration, finMsg, func(it blockDataAccessor) (proto.Message, error) { + finMsg := &spec.ReceiptsResponse{ReceiptMessage: &spec.ReceiptsResponse_Fin{}} + return h.processIterationRequestMulti(req.Iteration, finMsg, func(it blockDataAccessor) ([]proto.Message, error) { block, err := it.Block() if err != nil { return nil, err } - receipts := make([]*spec.Receipt, len(block.Receipts)) - for i := 0; i < len(block.Receipts); i++ { - receipts[i] = core2p2p.AdaptReceipt(block.Receipts[i], block.Transactions[i]) + responses := make([]proto.Message, len(block.Receipts)) + for i, receipt := range block.Receipts { + responses[i] = &spec.ReceiptsResponse{ + ReceiptMessage: &spec.ReceiptsResponse_Receipt{ + Receipt: core2p2p.AdaptReceipt(receipt, block.Transactions[i]), + }, + } } - return &spec.ReceiptsResponse{ - Id: core2p2p.AdaptBlockID(block.Header), - Responses: &spec.ReceiptsResponse_Receipts{ - Receipts: &spec.Receipts{Items: receipts}, - }, - }, nil + return responses, nil }) } func (h *Handler) onTransactionsRequest(req *spec.TransactionsRequest) (iter.Seq[proto.Message], error) { finMsg := &spec.TransactionsResponse{ - Responses: &spec.TransactionsResponse_Fin{}, + TransactionMessage: &spec.TransactionsResponse_Fin{}, } - return h.processIterationRequest(req.Iteration, finMsg, func(it blockDataAccessor) (proto.Message, error) { + return h.processIterationRequestMulti(req.Iteration, finMsg, func(it blockDataAccessor) ([]proto.Message, error) { block, err := it.Block() if err != nil { return nil, err } - return &spec.TransactionsResponse{ - Id: core2p2p.AdaptBlockID(block.Header), - Responses: &spec.TransactionsResponse_Transactions{ - Transactions: &spec.Transactions{ - Items: utils.Map(block.Transactions, core2p2p.AdaptTransaction), + responses := make([]proto.Message, len(block.Transactions)) + for i, tx := range block.Transactions { + responses[i] = &spec.TransactionsResponse{ + TransactionMessage: &spec.TransactionsResponse_Transaction{ + Transaction: core2p2p.AdaptTransaction(tx), }, - }, - }, nil + } + } + + return responses, nil + }) +} + +func (h *Handler) onStateDiffRequest(req *spec.StateDiffsRequest) (iter.Seq[proto.Message], error) { + finMsg := &spec.StateDiffsResponse{ + StateDiffMessage: &spec.StateDiffsResponse_Fin{}, + } + return h.processIterationRequestMulti(req.Iteration, finMsg, func(it blockDataAccessor) ([]proto.Message, error) { + block, err := it.Block() + if err != nil { + return nil, err + } + blockNumber := block.Number + + stateUpdate, err := h.bcReader.StateUpdateByNumber(blockNumber) + if err != nil { + return nil, err + } + diff := stateUpdate.StateDiff + + modifiedContracts := make(map[felt.Felt]*contractDiff) + + initContractDiff := func(addr *felt.Felt) *contractDiff { + return &contractDiff{address: addr} + } + updateModifiedContracts := func(addr felt.Felt, f func(*contractDiff)) error { + cDiff, ok := modifiedContracts[addr] + if !ok { + cDiff = initContractDiff(&addr) + if err != nil { + return err + } + modifiedContracts[addr] = cDiff + } + + f(cDiff) + return nil + } + + for addr, n := range diff.Nonces { + err = updateModifiedContracts(addr, func(diff *contractDiff) { + diff.nonce = n + }) + if err != nil { + return nil, err + } + } + + for addr, sDiff := range diff.StorageDiffs { + err = updateModifiedContracts(addr, func(diff *contractDiff) { + diff.storageDiffs = sDiff + }) + if err != nil { + return nil, err + } + } + + var responses []proto.Message + for _, c := range modifiedContracts { + responses = append(responses, &spec.StateDiffsResponse{ + StateDiffMessage: &spec.StateDiffsResponse_ContractDiff{ + ContractDiff: core2p2p.AdaptContractDiff(c.address, c.nonce, c.storageDiffs), + }, + }) + } + + return responses, nil + }) +} + +func (h *Handler) onClassesRequest(req *spec.ClassesRequest) (iter.Seq[proto.Message], error) { + finMsg := &spec.ClassesResponse{ + ClassMessage: &spec.ClassesResponse_Fin{}, + } + return h.processIterationRequestMulti(req.Iteration, finMsg, func(it blockDataAccessor) ([]proto.Message, error) { + block, err := it.Block() + if err != nil { + return nil, err + } + blockNumber := block.Number + + stateUpdate, err := h.bcReader.StateUpdateByNumber(blockNumber) + if err != nil { + return nil, err + } + + stateReader, closer, err := h.bcReader.StateAtBlockNumber(blockNumber) + if err != nil { + return nil, err + } + defer closer() + + stateDiff := stateUpdate.StateDiff + + var responses []proto.Message + for _, hash := range stateDiff.DeclaredV0Classes { + cls, err := stateReader.Class(hash) + if err != nil { + return nil, err + } + + responses = append(responses, &spec.ClassesResponse{ + ClassMessage: &spec.ClassesResponse_Class{ + Class: core2p2p.AdaptClass(cls.Class), + }, + }) + } + for classHash := range stateDiff.DeclaredV1Classes { + cls, err := stateReader.Class(&classHash) + if err != nil { + return nil, err + } + + responses = append(responses, &spec.ClassesResponse{ + ClassMessage: &spec.ClassesResponse_Class{ + Class: core2p2p.AdaptClass(cls.Class), + }, + }) + } + + return responses, nil }) } @@ -353,6 +470,45 @@ func (h *Handler) processIterationRequest(iteration *spec.Iteration, finMsg prot }, nil } +type iterationProcessorMulti = func(it blockDataAccessor) ([]proto.Message, error) + +func (h *Handler) processIterationRequestMulti(iteration *spec.Iteration, finMsg proto.Message, + getMsg iterationProcessorMulti, +) (iter.Seq[proto.Message], error) { + it, err := h.newIterator(iteration) + if err != nil { + return nil, err + } + + type yieldFunc = func(proto.Message) bool + return func(yield yieldFunc) { + // while iterator is valid + for it.Valid() { + // pass it to handler function (some might be interested in header, others in entire block) + messages, err := getMsg(it) + if err != nil { + h.log.Errorw("Failed to generate data", "blockNumber", it.BlockNumber(), "err", err) + break + } + + for _, msg := range messages { + // push generated msg to caller + if !yield(msg) { + // if caller is not interested in remaining data (example: connection to a peer is closed) exit + // note that in this case we won't send finMsg + return + } + } + + it.Next() + } + + // either we iterated over whole sequence or reached break statement in loop above + // note that return value of yield is not checked because this is the last message anyway + yield(finMsg) + }, nil +} + func (h *Handler) newIterator(it *spec.Iteration) (*iterator, error) { forward := it.Direction == spec.Iteration_Forward // todo restrict limit max value ? diff --git a/p2p/starknet/ids.go b/p2p/starknet/ids.go index 93f0e24ca5..3656155631 100644 --- a/p2p/starknet/ids.go +++ b/p2p/starknet/ids.go @@ -5,27 +5,35 @@ import ( "github.com/libp2p/go-libp2p/core/protocol" ) -// Todo: consider merging this with BlockHeadersPID +// Todo: consider merging this with HeadersPID func CurrentBlockHeaderPID(n *utils.Network) protocol.ID { return n.ProtocolID() + "/current_header/0" } -func BlockHeadersPID(n *utils.Network) protocol.ID { - return n.ProtocolID() + "/block_headers/0" +func HeadersPID(n *utils.Network) protocol.ID { + return n.ProtocolID() + "/headers/0.1.0-rc.0" } func BlockBodiesPID(n *utils.Network) protocol.ID { - return n.ProtocolID() + "/block_bodies/0" + return n.ProtocolID() + "/block_bodies/0.1.0-rc.0" } func EventsPID(n *utils.Network) protocol.ID { - return n.ProtocolID() + "/events/0" + return n.ProtocolID() + "/events/0.1.0-rc.0" } func ReceiptsPID(n *utils.Network) protocol.ID { - return n.ProtocolID() + "/receipts/0" + return n.ProtocolID() + "/receipts/0.1.0-rc.0" } func TransactionsPID(n *utils.Network) protocol.ID { - return n.ProtocolID() + "/transactions/0" + return n.ProtocolID() + "/transactions/0.1.0-rc.0" +} + +func ClassesPID(n *utils.Network) protocol.ID { + return n.ProtocolID() + "/classes/0.1.0-rc.0" +} + +func StateDiffPID(n *utils.Network) protocol.ID { + return n.ProtocolID() + "/state_diffs/0.1.0-rc.0" } diff --git a/p2p/starknet/starknet_test.go b/p2p/starknet/starknet_test.go index d0f45c1b98..05d3b6dc67 100644 --- a/p2p/starknet/starknet_test.go +++ b/p2p/starknet/starknet_test.go @@ -25,7 +25,7 @@ package starknet_test // // handlerHost := mockNet.Host(handlerID) // handlerHost.SetStreamHandler(starknet.CurrentBlockHeaderPID(testNetwork), handler.CurrentBlockHeaderHandler) -// handlerHost.SetStreamHandler(starknet.BlockHeadersPID(&testNetwork), handler.BlockHeadersHandler) +// handlerHost.SetStreamHandler(starknet.HeadersPID(&testNetwork), handler.HeadersHandler) // handlerHost.SetStreamHandler(starknet.BlockBodiesPID(&testNetwork), handler.BlockBodiesHandler) // handlerHost.SetStreamHandler(starknet.EventsPID(&testNetwork), handler.EventsHandler) // handlerHost.SetStreamHandler(starknet.ReceiptsPID(&testNetwork), handler.ReceiptsHandler) diff --git a/p2p/sync.go b/p2p/sync.go index 8763dd3f7a..33c3544677 100644 --- a/p2p/sync.go +++ b/p2p/sync.go @@ -5,6 +5,8 @@ import ( "errors" "fmt" "math/rand" + "reflect" + "runtime/debug" "time" "github.com/NethermindEth/juno/adapters/p2p2core" @@ -47,7 +49,7 @@ func newSyncService(bc *blockchain.Blockchain, h host.Host, n *utils.Network, lo } func (s *syncService) randomNodeHeight(ctx context.Context) (int, error) { - return 0, nil + return 9000, nil //headersIt, err := s.client.RequestCurrentBlockHeader(ctx, &spec.CurrentBlockHeaderRequest{}) //if err != nil { // return 0, err @@ -86,7 +88,13 @@ func (s *syncService) start(ctx context.Context) { s.log.Debugw("Continuous iteration", "i", i) - iterCtx, cancelIteration := context.WithCancel(ctx) + iterCtx, cancel := context.WithCancel(ctx) + cancelIteration := func() { + fmt.Println("Called by:") + debug.PrintStack() + time.Sleep(time.Second * 4) + cancel() + } var err error randHeight, err = s.randomNodeHeight(iterCtx) @@ -121,8 +129,8 @@ func (s *syncService) start(ctx context.Context) { nextHeight+min(blockBehind, maxBlocks)) // todo change iteration to fetch several objects uint64(min(blockBehind, maxBlocks)) - commonIt := s.createIterator(uint64(nextHeight), 1) - headersAndSigsCh, err := s.genHeadersAndSigs(iterCtx, commonIt) + blockNumber := uint64(nextHeight) + headersAndSigsCh, err := s.genHeadersAndSigs(iterCtx, blockNumber) if err != nil { s.logError("Failed to get block headers parts", err) cancelIteration() @@ -139,29 +147,45 @@ func (s *syncService) start(ctx context.Context) { */ - txsCh, err := s.genTransactions(iterCtx, commonIt) + txsCh, err := s.genTransactions(iterCtx, blockNumber) if err != nil { s.logError("Failed to get transactions", err) cancelIteration() continue } - receiptsCh, err := s.genReceipts(iterCtx, commonIt) + receiptsCh, err := s.genReceipts(iterCtx, blockNumber) if err != nil { s.logError("Failed to get receipts", err) cancelIteration() continue } - eventsCh, err := s.genEvents(iterCtx, commonIt) + eventsCh, err := s.genEvents(iterCtx, blockNumber) + if err != nil { + s.logError("Failed to get classes", err) + cancelIteration() + continue + } + + classesCh, err := s.genClasses(iterCtx, blockNumber) if err != nil { - s.logError("Failed to get events", err) + s.logError("Failed to get classes", err) + cancelIteration() + continue + } + + stateDiffsCh, err := s.genStateDiffs(iterCtx, blockNumber) + if err != nil { + s.logError("Failed to get state diffs", err) cancelIteration() continue } blocksCh := pipeline.Bridge(iterCtx, s.processSpecBlockParts(iterCtx, uint64(nextHeight), pipeline.FanIn(iterCtx, pipeline.Stage(iterCtx, headersAndSigsCh, specBlockPartsFunc[specBlockHeaderAndSigs]), + pipeline.Stage(iterCtx, classesCh, specBlockPartsFunc[specClasses]), + pipeline.Stage(iterCtx, stateDiffsCh, specBlockPartsFunc[specContractDiffs]), // pipeline.Stage(iterCtx, blockBodiesCh, specBlockPartsFunc[specBlockBody]), pipeline.Stage(iterCtx, txsCh, specBlockPartsFunc[specTransactions]), pipeline.Stage(iterCtx, receiptsCh, specBlockPartsFunc[specReceipts]), @@ -192,7 +216,7 @@ func (s *syncService) start(ctx context.Context) { } } -func specBlockPartsFunc[T specBlockHeaderAndSigs | specBlockBody | specTransactions | specReceipts | specEvents](i T) specBlockParts { +func specBlockPartsFunc[T specBlockHeaderAndSigs | specBlockBody | specTransactions | specReceipts | specEvents | specClasses | specContractDiffs](i T) specBlockParts { return specBlockParts(i) } @@ -207,6 +231,8 @@ func (s *syncService) logError(msg string, err error) { } log.Errorw(msg, "err", err) + } else { + s.log.Debugw("Sync context canceled") } } @@ -230,9 +256,11 @@ func (s *syncService) processSpecBlockParts( specBlockHeadersAndSigsM := make(map[uint64]specBlockHeaderAndSigs) specBlockBodiesM := make(map[uint64]specBlockBody) + specClassesM := make(map[uint64]specClasses) specTransactionsM := make(map[uint64]specTransactions) specReceiptsM := make(map[uint64]specReceipts) specEventsM := make(map[uint64]specEvents) + specContractDiffsM := make(map[uint64]specContractDiffs) curBlockNum := startingBlockNum for part := range specBlockPartsCh { @@ -241,7 +269,7 @@ func (s *syncService) processSpecBlockParts( default: switch p := part.(type) { case specBlockHeaderAndSigs: - s.log.Debugw("Received Block Header and Signatures", "blockNumber", p.header.Number) + s.log.Debugw("Received Block Header and Signatures", "blockNumber", p.blockNumber()) if _, ok := specBlockHeadersAndSigsM[part.blockNumber()]; !ok { specBlockHeadersAndSigsM[part.blockNumber()] = p } @@ -251,28 +279,42 @@ func (s *syncService) processSpecBlockParts( specBlockBodiesM[part.blockNumber()] = p } case specTransactions: - s.log.Debugw("Received Transactions", "blockNumber", p.id.Number) + s.log.Debugw("Received Transactions", "blockNumber", p.blockNumber()) if _, ok := specTransactionsM[part.blockNumber()]; !ok { specTransactionsM[part.blockNumber()] = p } case specReceipts: - s.log.Debugw("Received Receipts", "blockNumber", p.id.Number) + s.log.Debugw("Received Receipts", "blockNumber", p.blockNumber()) if _, ok := specReceiptsM[part.blockNumber()]; !ok { specReceiptsM[part.blockNumber()] = p } case specEvents: - s.log.Debugw("Received Events", "blockNumber", p.id.Number) + s.log.Debugw("Received Events", "blockNumber", p.blockNumber()) if _, ok := specEventsM[part.blockNumber()]; !ok { specEventsM[part.blockNumber()] = p } + case specClasses: + s.log.Debugw("Received Classes", "blockNumber", p.blockNumber()) + if _, ok := specClassesM[part.blockNumber()]; !ok { + specClassesM[part.blockNumber()] = p + } + case specContractDiffs: + s.log.Debugw("Received Classes", "blockNumber", p.blockNumber()) + if _, ok := specContractDiffsM[part.blockNumber()]; !ok { + specContractDiffsM[part.blockNumber()] = p + } + default: + s.log.Warnw("Unsupported part type", "blockNumber", part.blockNumber(), "type", reflect.TypeOf(p)) } headerAndSig, ok1 := specBlockHeadersAndSigsM[curBlockNum] - body, ok2 := specBlockBodiesM[curBlockNum] + // body, ok2 := specBlockBodiesM[curBlockNum] txs, ok3 := specTransactionsM[curBlockNum] rs, ok4 := specReceiptsM[curBlockNum] es, ok5 := specEventsM[curBlockNum] - if ok1 && ok2 && ok3 && ok4 && ok5 { + cls, ok6 := specClassesM[curBlockNum] + diffs, ok7 := specContractDiffsM[curBlockNum] + if ok1 && ok3 && ok4 && ok5 && ok6 && ok7 { s.log.Debugw(fmt.Sprintf("----- Received all block parts from peers for block number %d-----", curBlockNum)) select { @@ -294,12 +336,8 @@ func (s *syncService) processSpecBlockParts( } } - _ = headerAndSig - _ = body.classes - _ = txs.txs - _ = es.events - orderedBlockBodiesCh <- s.adaptAndSanityCheckBlock(ctx, nil, body.stateDiff, - nil, nil, rs.receipts, nil, prevBlockRoot) + orderedBlockBodiesCh <- s.adaptAndSanityCheckBlock(ctx, headerAndSig.header, diffs.contractDiffs, + cls.classes, txs.txs, rs.receipts, es.events, prevBlockRoot) } if curBlockNum > 0 { @@ -317,8 +355,8 @@ func (s *syncService) processSpecBlockParts( return orderedBlockBodiesCh } -func (s *syncService) adaptAndSanityCheckBlock(ctx context.Context, header *spec.SignedBlockHeader, diff interface{}, - classes []*spec.Class, txs []*spec.Transaction, receipts *spec.Receipts, events []*spec.Event, prevBlockRoot *felt.Felt, +func (s *syncService) adaptAndSanityCheckBlock(ctx context.Context, header *spec.SignedBlockHeader, contractDiffs []*spec.ContractDiff, + classes []*spec.Class, txs []*spec.Transaction, receipts []*spec.Receipt, events []*spec.Event, prevBlockRoot *felt.Felt, ) <-chan blockBody { bodyCh := make(chan blockBody) go func() { @@ -342,7 +380,7 @@ func (s *syncService) adaptAndSanityCheckBlock(ctx context.Context, header *spec txHashEventsM[*txH] = append(txHashEventsM[*txH], p2p2core.AdaptEvent(event)) } - coreReceipts := utils.Map(receipts.GetItems(), p2p2core.AdaptReceipt) + coreReceipts := utils.Map(receipts, p2p2core.AdaptReceipt) coreReceipts = utils.Map(coreReceipts, func(r *core.TransactionReceipt) *core.TransactionReceipt { r.Events = txHashEventsM[*r.TransactionHash] return r @@ -380,7 +418,7 @@ func (s *syncService) adaptAndSanityCheckBlock(ctx context.Context, header *spec BlockHash: coreBlock.Hash, NewRoot: coreBlock.GlobalStateRoot, OldRoot: prevBlockRoot, - StateDiff: p2p2core.AdaptStateDiff(nil, classes), + StateDiff: p2p2core.AdaptStateDiff(contractDiffs, classes), } commitments, err := s.blockchain.SanityCheckNewHeight(coreBlock, stateUpdate, newClasses) @@ -411,7 +449,8 @@ func (s specBlockHeaderAndSigs) blockNumber() uint64 { return s.header.Number } -func (s *syncService) genHeadersAndSigs(ctx context.Context, it *spec.Iteration) (<-chan specBlockHeaderAndSigs, error) { +func (s *syncService) genHeadersAndSigs(ctx context.Context, blockNumber uint64) (<-chan specBlockHeaderAndSigs, error) { + it := s.createIteratorForBlock(blockNumber) headersIt, err := s.client.RequestBlockHeaders(ctx, &spec.BlockHeadersRequest{Iteration: it}) if err != nil { return nil, err @@ -428,6 +467,9 @@ func (s *syncService) genHeadersAndSigs(ctx context.Context, it *spec.Iteration) headerAndSig.header = v.Header case *spec.BlockHeadersResponse_Fin: return false + default: + s.log.Warnw("Unexpected HeaderMessage from getBlockHeaders", "v", v) + return false } select { @@ -509,16 +551,17 @@ func (s *syncService) genBlockBodies(ctx context.Context, it *spec.Iteration) (< */ type specReceipts struct { - id *spec.BlockID - receipts *spec.Receipts + number uint64 + receipts []*spec.Receipt } func (s specReceipts) blockNumber() uint64 { - return s.id.Number + return s.number } //nolint:dupl -func (s *syncService) genReceipts(ctx context.Context, it *spec.Iteration) (<-chan specReceipts, error) { +func (s *syncService) genReceipts(ctx context.Context, blockNumber uint64) (<-chan specReceipts, error) { + it := s.createIteratorForBlock(blockNumber) receiptsIt, err := s.client.RequestReceipts(ctx, &spec.ReceiptsRequest{Iteration: it}) if err != nil { return nil, err @@ -528,35 +571,134 @@ func (s *syncService) genReceipts(ctx context.Context, it *spec.Iteration) (<-ch go func() { defer close(receiptsCh) + var receipts []*spec.Receipt receiptsIt(func(res *spec.ReceiptsResponse) bool { - switch res.ReceiptMessage.(type) { + switch v := res.ReceiptMessage.(type) { case *spec.ReceiptsResponse_Receipt: - select { - case <-ctx.Done(): - return false - // case receiptsCh <- specReceipts{res.GetId(), res.GetReceipts()}: - } + receipts = append(receipts, v.Receipt) + return true case *spec.ReceiptsResponse_Fin: return false + default: + s.log.Warnw("Unexpected ReceiptMessage from getReceipts", "v", res.ReceiptMessage) + return false } - - return true }) + + select { + case <-ctx.Done(): + return + case receiptsCh <- specReceipts{ + number: blockNumber, + receipts: receipts, + }: + } }() return receiptsCh, nil } +type specClasses struct { + number uint64 + classes []*spec.Class +} + +func (s specClasses) blockNumber() uint64 { + return s.number +} + +func (s *syncService) genClasses(ctx context.Context, blockNumber uint64) (<-chan specClasses, error) { + it := s.createIteratorForBlock(blockNumber) + classesIt, err := s.client.RequestClasses(ctx, &spec.ClassesRequest{Iteration: it}) + if err != nil { + return nil, err + } + + classesCh := make(chan specClasses) + go func() { + defer close(classesCh) + + var classes []*spec.Class + classesIt(func(res *spec.ClassesResponse) bool { + switch v := res.ClassMessage.(type) { + case *spec.ClassesResponse_Class: + classes = append(classes, v.Class) + return true + case *spec.ClassesResponse_Fin: + return false + default: + s.log.Warnw("Unexpected ClassMessage from getClasses", "v", v) + return false + } + }) + + select { + case <-ctx.Done(): + case classesCh <- specClasses{ + number: blockNumber, + classes: classes, + }: + } + }() + return classesCh, nil +} + +type specContractDiffs struct { + number uint64 + contractDiffs []*spec.ContractDiff +} + +func (s specContractDiffs) blockNumber() uint64 { + return s.number +} + +func (s *syncService) genStateDiffs(ctx context.Context, blockNumber uint64) (<-chan specContractDiffs, error) { + it := s.createIteratorForBlock(blockNumber) + stateDiffsIt, err := s.client.RequestStateDiffs(ctx, &spec.StateDiffsRequest{Iteration: it}) + if err != nil { + return nil, err + } + + stateDiffsCh := make(chan specContractDiffs) + go func() { + defer close(stateDiffsCh) + + var contractDiffs []*spec.ContractDiff + stateDiffsIt(func(res *spec.StateDiffsResponse) bool { + switch v := res.StateDiffMessage.(type) { + case *spec.StateDiffsResponse_ContractDiff: + contractDiffs = append(contractDiffs, v.ContractDiff) + return true + case *spec.StateDiffsResponse_Fin: + return false + default: + s.log.Warnw("Unexpected ClassMessage from getStateDiffs", "v", v) + return false + } + }) + + select { + case <-ctx.Done(): + case stateDiffsCh <- specContractDiffs{ + number: blockNumber, + contractDiffs: contractDiffs, + }: + } + }() + return stateDiffsCh, nil +} + type specEvents struct { - id *spec.BlockID - events []spec.Event + number uint64 + events []*spec.Event } func (s specEvents) blockNumber() uint64 { - return s.id.Number + return s.number } -func (s *syncService) genEvents(ctx context.Context, it *spec.Iteration) (<-chan specEvents, error) { +func (s *syncService) genEvents(ctx context.Context, blockNumber uint64) (<-chan specEvents, error) { + it := s.createIteratorForBlock(blockNumber) eventsIt, err := s.client.RequestEvents(ctx, &spec.EventsRequest{Iteration: it}) if err != nil { return nil, err @@ -566,36 +708,43 @@ func (s *syncService) genEvents(ctx context.Context, it *spec.Iteration) (<-chan go func() { defer close(eventsCh) + var events []*spec.Event eventsIt(func(res *spec.EventsResponse) bool { - switch res.EventMessage.(type) { + switch v := res.EventMessage.(type) { case *spec.EventsResponse_Event: - select { - case <-ctx.Done(): - return false - // case eventsCh <- specEvents{res.GetId(), res.GetEvents()}: - // return true - } + events = append(events, v.Event) + return true case *spec.EventsResponse_Fin: return false + default: + s.log.Warnw("Unexpected EventMessage from getEvents", "v", v) + return false } - - return true }) + + select { + case <-ctx.Done(): + case eventsCh <- specEvents{ + number: blockNumber, + events: events, + }: + } }() return eventsCh, nil } type specTransactions struct { - id *spec.BlockID - txs []spec.Transaction + number uint64 + txs []*spec.Transaction } func (s specTransactions) blockNumber() uint64 { - return s.id.Number + return s.number } //nolint:dupl -func (s *syncService) genTransactions(ctx context.Context, it *spec.Iteration) (<-chan specTransactions, error) { +func (s *syncService) genTransactions(ctx context.Context, blockNumber uint64) (<-chan specTransactions, error) { + it := s.createIteratorForBlock(blockNumber) txsIt, err := s.client.RequestTransactions(ctx, &spec.TransactionsRequest{Iteration: it}) if err != nil { return nil, err @@ -605,20 +754,30 @@ func (s *syncService) genTransactions(ctx context.Context, it *spec.Iteration) ( go func() { defer close(txsCh) + var transactions []*spec.Transaction txsIt(func(res *spec.TransactionsResponse) bool { - switch res.TransactionMessage.(type) { + switch v := res.TransactionMessage.(type) { case *spec.TransactionsResponse_Transaction: - select { - case <-ctx.Done(): - return false - // case txsCh <- specTransactions{res.GetId(), res.GetTransactions()}: - } + transactions = append(transactions, res.GetTransaction()) + return true case *spec.TransactionsResponse_Fin: return false + default: + s.log.Warnw("Unexpected TransactionMessage from getTransactions", "v", v) + return false } - - return true }) + + s.log.Debugw("Transactions length", "len", len(transactions)) + spexTxs := specTransactions{ + number: blockNumber, + txs: transactions, + } + select { + case <-ctx.Done(): + return + case txsCh <- spexTxs: + } }() return txsCh, nil } @@ -663,14 +822,11 @@ func (s *syncService) removePeer(id peer.ID) { s.host.Peerstore().ClearAddrs(id) } -func (s *syncService) createIterator(start, limit uint64) *spec.Iteration { - if limit == 0 { - limit = 1 - } +func (s *syncService) createIteratorForBlock(blockNumber uint64) *spec.Iteration { return &spec.Iteration{ - Start: &spec.Iteration_BlockNumber{BlockNumber: start}, + Start: &spec.Iteration_BlockNumber{BlockNumber: blockNumber}, Direction: spec.Iteration_Forward, - Limit: limit, + Limit: 1, Step: 1, } } From ce575cb936f5271ce1e1f5ac077e96c78e04e66d Mon Sep 17 00:00:00 2001 From: Kirill Date: Wed, 22 May 2024 18:37:13 +0400 Subject: [PATCH 05/18] Debug commit --- Makefile | 5 +++-- blockchain/blockchain.go | 3 +++ core/state.go | 4 ++++ p2p/sync.go | 18 +++++++++++++----- 4 files changed, 23 insertions(+), 7 deletions(-) diff --git a/Makefile b/Makefile index 87cadb6cd3..bad250c611 100644 --- a/Makefile +++ b/Makefile @@ -87,7 +87,7 @@ clean: ## clean project builds help: ## show this help @grep -E '^[a-zA-Z_-]+:.*?## .*$$' $(MAKEFILE_LIST) | awk 'BEGIN {FS = ":.*?## "}; {printf "\033[36m%-30s\033[0m %s\n", $$1, $$2}' -feedernode: +feedernode: juno-cached ./build/juno \ --network=sepolia \ --log-level=debug \ @@ -98,7 +98,8 @@ feedernode: --p2p-private-key="5f6cdc3aebcc74af494df054876100368ef6126e3a33fa65b90c765b381ffc37a0a63bbeeefab0740f24a6a38dabb513b9233254ad0020c721c23e69bc820089" \ --metrics-port=9090 -node1: +node1: juno-cached + rm -rf ./p2p-dbs/node1/ && \ ./build/juno \ --network=sepolia \ --log-level=debug \ diff --git a/blockchain/blockchain.go b/blockchain/blockchain.go index 36d622991c..b3f23679a0 100644 --- a/blockchain/blockchain.go +++ b/blockchain/blockchain.go @@ -340,9 +340,12 @@ func (b *Blockchain) Store(block *core.Block, blockCommitments *core.BlockCommit if err := verifyBlock(txn, block); err != nil { return err } + fmt.Printf("StateUpdate old root is %v\n", stateUpdate.OldRoot) if err := core.NewState(txn).Update(block.Number, stateUpdate, newClasses); err != nil { + fmt.Println("Update error", err) return err } + fmt.Println("Trying to store") if err := StoreBlockHeader(txn, block.Header); err != nil { return err } diff --git a/core/state.go b/core/state.go index 97ea2163bf..5c74be0993 100644 --- a/core/state.go +++ b/core/state.go @@ -8,6 +8,8 @@ import ( "runtime" "sort" + "github.com/davecgh/go-spew/spew" + "github.com/NethermindEth/juno/core/crypto" "github.com/NethermindEth/juno/core/felt" "github.com/NethermindEth/juno/core/trie" @@ -181,6 +183,7 @@ func (s *State) globalTrie(bucket db.Bucket, newTrie trie.NewTrieFunc) (*trie.Tr } func (s *State) verifyStateUpdateRoot(root *felt.Felt) error { + fmt.Println("verifyStateUpdateRoot", root) currentRoot, err := s.Root() if err != nil { return err @@ -233,6 +236,7 @@ func (s *State) Update(blockNumber uint64, update *StateUpdate, declaredClasses return err } + spew.Dump(blockNumber, update.StateDiff) return s.verifyStateUpdateRoot(update.NewRoot) } diff --git a/p2p/sync.go b/p2p/sync.go index 33c3544677..11a5ff392c 100644 --- a/p2p/sync.go +++ b/p2p/sync.go @@ -6,7 +6,6 @@ import ( "fmt" "math/rand" "reflect" - "runtime/debug" "time" "github.com/NethermindEth/juno/adapters/p2p2core" @@ -90,8 +89,8 @@ func (s *syncService) start(ctx context.Context) { iterCtx, cancel := context.WithCancel(ctx) cancelIteration := func() { - fmt.Println("Called by:") - debug.PrintStack() + // fmt.Println("Called by:") + // debug.PrintStack() time.Sleep(time.Second * 4) cancel() } @@ -201,6 +200,16 @@ func (s *syncService) start(ctx context.Context) { } storeTimer := time.Now() + var str string + for k, v := range b.newClasses { + h, err := v.Hash() + if err != nil { + panic(err) + } + + str += fmt.Sprintf("key=%s, value=%s\n", k.String(), h) + } + fmt.Printf("Block %d stateUpdate: %v newClasses: %v\n", b.block.Number, b.stateUpdate.OldRoot, str) err = s.blockchain.Store(b.block, b.commitments, b.stateUpdate, b.newClasses) if err != nil { s.log.Errorw("Failed to Store Block", "number", b.block.Number, "err", err) @@ -324,8 +333,7 @@ func (s *syncService) processSpecBlockParts( if curBlockNum > 0 { // First check cache if the header is not present, then get it from the db. if oldHeader, ok := specBlockHeadersAndSigsM[curBlockNum-1]; ok { - _ = oldHeader - // prevBlockRoot = p2p2core.AdaptHash(oldHeader.header.State.Root) + prevBlockRoot = p2p2core.AdaptHash(oldHeader.header.State.Root) } else { oldHeader, err := s.blockchain.BlockHeaderByNumber(curBlockNum - 1) if err != nil { From e6ba7546a22097857767d7903b2416e4ee456dc8 Mon Sep 17 00:00:00 2001 From: Kirill Date: Wed, 22 May 2024 19:05:58 +0400 Subject: [PATCH 06/18] Restructure adapter, update debugging output --- adapters/core2p2p/state.go | 15 ++++----------- core/state.go | 3 ++- p2p/starknet/handlers.go | 16 +++++++++++++++- 3 files changed, 21 insertions(+), 13 deletions(-) diff --git a/adapters/core2p2p/state.go b/adapters/core2p2p/state.go index 2d1456a1ef..dedc55da96 100644 --- a/adapters/core2p2p/state.go +++ b/adapters/core2p2p/state.go @@ -6,13 +6,13 @@ import ( "github.com/NethermindEth/juno/utils" ) -func AdaptContractDiff(addr, nonce *felt.Felt, diff map[felt.Felt]*felt.Felt) *spec.ContractDiff { +func AdaptContractDiff(addr, nonce, classHash *felt.Felt, replaced *bool, storageDiff map[felt.Felt]*felt.Felt) *spec.ContractDiff { return &spec.ContractDiff{ Address: AdaptAddress(addr), Nonce: AdaptFelt(nonce), - ClassHash: nil, // This will need to be set if deployed_contracts and replaced_classes are removed from StateDiff - IsReplaced: nil, - Values: AdaptStorageDiff(diff), + ClassHash: AdaptHash(classHash), // This will need to be set if deployed_contracts and replaced_classes are removed from StateDiff + IsReplaced: replaced, + Values: AdaptStorageDiff(storageDiff), Domain: 0, } } @@ -25,10 +25,3 @@ func AdaptStorageDiff(diff map[felt.Felt]*felt.Felt) []*spec.ContractStoredValue } }) } - -//func AdaptAddressClassHashPair(address felt.Felt, classHash *felt.Felt) *spec.StateDiff_ContractAddrToClassHash { -// return &spec.StateDiff_ContractAddrToClassHash{ -// ContractAddr: AdaptAddress(&address), -// ClassHash: AdaptHash(classHash), -// } -//} diff --git a/core/state.go b/core/state.go index 5c74be0993..296ea2f3dc 100644 --- a/core/state.go +++ b/core/state.go @@ -205,6 +205,8 @@ func (s *State) Update(blockNumber uint64, update *StateUpdate, declaredClasses return err } + spew.Dump(blockNumber, update.StateDiff) + // register declared classes mentioned in stateDiff.deployedContracts and stateDiff.declaredClasses for cHash, class := range declaredClasses { if err = s.putClass(&cHash, class, blockNumber); err != nil { @@ -236,7 +238,6 @@ func (s *State) Update(blockNumber uint64, update *StateUpdate, declaredClasses return err } - spew.Dump(blockNumber, update.StateDiff) return s.verifyStateUpdateRoot(update.NewRoot) } diff --git a/p2p/starknet/handlers.go b/p2p/starknet/handlers.go index 70b7b32ea8..9d9f4bd4a9 100644 --- a/p2p/starknet/handlers.go +++ b/p2p/starknet/handlers.go @@ -356,9 +356,23 @@ func (h *Handler) onStateDiffRequest(req *spec.StateDiffsRequest) (iter.Seq[prot var responses []proto.Message for _, c := range modifiedContracts { + contractAddress := *c.address + + var ( + classHash *felt.Felt + replaced *bool + ) + if hash, ok := diff.DeployedContracts[contractAddress]; ok { + classHash = hash + replaced = utils.Ptr(false) + } else if hash, ok = diff.ReplacedClasses[contractAddress]; ok { + classHash = hash + replaced = utils.Ptr(true) + } + responses = append(responses, &spec.StateDiffsResponse{ StateDiffMessage: &spec.StateDiffsResponse_ContractDiff{ - ContractDiff: core2p2p.AdaptContractDiff(c.address, c.nonce, c.storageDiffs), + ContractDiff: core2p2p.AdaptContractDiff(c.address, c.nonce, classHash, replaced, c.storageDiffs), }, }) } From 77bb3060585d1ee19e717d8d16fd9c4d78b75923 Mon Sep 17 00:00:00 2001 From: Kirill Date: Wed, 22 May 2024 23:51:15 +0400 Subject: [PATCH 07/18] Working with final spec --- Makefile | 1 + adapters/core2p2p/block.go | 23 +- adapters/core2p2p/class.go | 16 +- adapters/core2p2p/felt.go | 11 + adapters/core2p2p/receipt.go | 20 +- adapters/core2p2p/state.go | 11 +- adapters/core2p2p/transaction.go | 78 +- adapters/p2p2core/block.go | 8 +- adapters/p2p2core/class.go | 58 +- adapters/p2p2core/felt.go | 5 + adapters/p2p2core/receipt.go | 10 +- adapters/p2p2core/state.go | 19 +- adapters/p2p2core/transaction.go | 58 +- blockchain/blockchain.go | 3 - core/state.go | 5 +- p2p/p2p.go | 2 +- p2p/starknet/block_bodies.go | 2 + p2p/starknet/client.go | 6 +- p2p/starknet/handlers.go | 55 +- p2p/starknet/ids.go | 10 +- p2p/starknet/p2p/proto/class.proto | 15 +- p2p/starknet/p2p/proto/common.proto | 35 +- p2p/starknet/p2p/proto/event.proto | 8 +- p2p/starknet/p2p/proto/header.proto | 46 +- p2p/starknet/p2p/proto/receipt.proto | 75 +- p2p/starknet/p2p/proto/state.proto | 21 +- p2p/starknet/p2p/proto/transaction.proto | 178 ++-- p2p/starknet/spec/class.pb.go | 225 ++--- p2p/starknet/spec/common.pb.go | 392 +++++--- p2p/starknet/spec/event.pb.go | 12 +- p2p/starknet/spec/header.pb.go | 322 ++++--- p2p/starknet/spec/receipt.pb.go | 608 +++++------- p2p/starknet/spec/state.pb.go | 241 +++-- p2p/starknet/spec/transaction.pb.go | 1124 ++++++++++++---------- p2p/sync.go | 157 ++- 35 files changed, 2137 insertions(+), 1723 deletions(-) diff --git a/Makefile b/Makefile index bad250c611..565fc53af3 100644 --- a/Makefile +++ b/Makefile @@ -99,6 +99,7 @@ feedernode: juno-cached --metrics-port=9090 node1: juno-cached +# todo remove rm before merge rm -rf ./p2p-dbs/node1/ && \ ./build/juno \ --network=sepolia \ diff --git a/adapters/core2p2p/block.go b/adapters/core2p2p/block.go index 06eac6887b..667b8056ec 100644 --- a/adapters/core2p2p/block.go +++ b/adapters/core2p2p/block.go @@ -28,26 +28,27 @@ func AdaptSignature(sig []*felt.Felt) *spec.ConsensusSignature { func AdaptHeader(header *core.Header, commitments *core.BlockCommitments) *spec.SignedBlockHeader { // todo revisit return &spec.SignedBlockHeader{ + BlockHash: AdaptHash(header.Hash), ParentHash: AdaptHash(header.ParentHash), Number: header.Number, Time: header.Timestamp, SequencerAddress: AdaptAddress(header.SequencerAddress), - Receipts: nil, // not defined yet - State: &spec.Patricia{ - Height: core.ContractStorageTrieHeight, - Root: AdaptHash(header.GlobalStateRoot), - }, - Transactions: &spec.Merkle{ - NLeaves: uint32(header.TransactionCount), + StateRoot: AdaptHash(header.GlobalStateRoot), + // todo state diff commitment + Transactions: &spec.Patricia{ + NLeaves: header.TransactionCount, Root: AdaptHash(commitments.TransactionCommitment), }, - Events: &spec.Merkle{ - NLeaves: uint32(header.EventCount), + Events: &spec.Patricia{ + NLeaves: header.EventCount, Root: AdaptHash(commitments.EventCommitment), }, + // todo fill receipts + Receipts: nil, ProtocolVersion: header.ProtocolVersion, - GasPrice: AdaptFelt(header.GasPrice), - Signatures: utils.Map(header.Signatures, AdaptSignature), + + GasPriceFri: AdaptUint128(header.GasPrice), + Signatures: utils.Map(header.Signatures, AdaptSignature), } } diff --git a/adapters/core2p2p/class.go b/adapters/core2p2p/class.go index d23adac275..6be2cd1645 100644 --- a/adapters/core2p2p/class.go +++ b/adapters/core2p2p/class.go @@ -1,7 +1,6 @@ package core2p2p import ( - "encoding/json" "fmt" "github.com/NethermindEth/juno/core" @@ -19,25 +18,19 @@ func AdaptClass(class core.Class) *spec.Class { return &spec.Class{ Class: &spec.Class_Cairo0{ Cairo0: &spec.Cairo0Class{ - Abi: v.Abi, + Abi: string(v.Abi), Externals: utils.Map(v.Externals, adaptEntryPoint), L1Handlers: utils.Map(v.L1Handlers, adaptEntryPoint), Constructors: utils.Map(v.Constructors, adaptEntryPoint), - Program: []byte(v.Program), + Program: v.Program, }, }, } case *core.Cairo1Class: - // Todo: Add compiled class struct to p2p spec. For now we will use json encoding - compiledBytes, err := json.Marshal(v.Compiled) - if err != nil { - panic(fmt.Errorf("unable to marshal compiled class hash to json: %v", err)) - } - return &spec.Class{ Class: &spec.Class_Cairo1{ Cairo1: &spec.Cairo1Class{ - Abi: []byte(v.Abi), + Abi: v.Abi, EntryPoints: &spec.Cairo1EntryPoints{ Externals: utils.Map(v.EntryPoints.External, adaptSierra), L1Handlers: utils.Map(v.EntryPoints.L1Handler, adaptSierra), @@ -45,7 +38,6 @@ func AdaptClass(class core.Class) *spec.Class { }, Program: utils.Map(v.Program, AdaptFelt), ContractClassVersion: v.SemanticVersion, - Compiled: compiledBytes, }, }, } @@ -64,6 +56,6 @@ func adaptSierra(e core.SierraEntryPoint) *spec.SierraEntryPoint { func adaptEntryPoint(e core.EntryPoint) *spec.EntryPoint { return &spec.EntryPoint{ Selector: AdaptFelt(e.Selector), - Offset: AdaptFelt(e.Offset), + Offset: e.Offset.Uint64(), } } diff --git a/adapters/core2p2p/felt.go b/adapters/core2p2p/felt.go index cfaa9ab396..150a9c4f85 100644 --- a/adapters/core2p2p/felt.go +++ b/adapters/core2p2p/felt.go @@ -45,3 +45,14 @@ func AdaptAddress(f *felt.Felt) *spec.Address { Elements: f.Marshal(), } } + +func AdaptUint128(f *felt.Felt) *spec.Uint128 { + // bits represents value in little endian byte order + // i.e. first is least significant byte + bits := f.Bits() + // todo what should we do with the rest of bytes? + return &spec.Uint128{ + Low: bits[0], + High: bits[1], + } +} diff --git a/adapters/core2p2p/receipt.go b/adapters/core2p2p/receipt.go index 225ed48186..73351b9962 100644 --- a/adapters/core2p2p/receipt.go +++ b/adapters/core2p2p/receipt.go @@ -62,12 +62,28 @@ func AdaptReceipt(r *core.TransactionReceipt, txn core.Transaction) *spec.Receip } func receiptCommon(r *core.TransactionReceipt) *spec.Receipt_Common { + var revertReason *string + if r.RevertReason != "" { + revertReason = &r.RevertReason + } + return &spec.Receipt_Common{ - TransactionHash: AdaptHash(r.TransactionHash), ActualFee: AdaptFelt(r.Fee), + PriceUnit: adaptPriceUnit(r.FeeUnit), MessagesSent: utils.Map(r.L2ToL1Message, AdaptMessageToL1), ExecutionResources: AdaptExecutionResources(r.ExecutionResources), - RevertReason: r.RevertReason, + RevertReason: revertReason, + } +} + +func adaptPriceUnit(unit core.FeeUnit) spec.PriceUnit { + switch unit { + case core.WEI: + return spec.PriceUnit_Wei + case core.STRK: + return spec.PriceUnit_Fri // todo double check + default: + panic("unreachable adaptPriceUnit") } } diff --git a/adapters/core2p2p/state.go b/adapters/core2p2p/state.go index dedc55da96..1b53db6a9c 100644 --- a/adapters/core2p2p/state.go +++ b/adapters/core2p2p/state.go @@ -8,12 +8,11 @@ import ( func AdaptContractDiff(addr, nonce, classHash *felt.Felt, replaced *bool, storageDiff map[felt.Felt]*felt.Felt) *spec.ContractDiff { return &spec.ContractDiff{ - Address: AdaptAddress(addr), - Nonce: AdaptFelt(nonce), - ClassHash: AdaptHash(classHash), // This will need to be set if deployed_contracts and replaced_classes are removed from StateDiff - IsReplaced: replaced, - Values: AdaptStorageDiff(storageDiff), - Domain: 0, + Address: AdaptAddress(addr), + Nonce: AdaptFelt(nonce), + ClassHash: AdaptHash(classHash), // This will need to be set if deployed_contracts and replaced_classes are removed from StateDiff + Values: AdaptStorageDiff(storageDiff), + Domain: 0, } } diff --git a/adapters/core2p2p/transaction.go b/adapters/core2p2p/transaction.go index 8323580809..4c2cbdca8a 100644 --- a/adapters/core2p2p/transaction.go +++ b/adapters/core2p2p/transaction.go @@ -3,6 +3,8 @@ package core2p2p import ( "fmt" + "github.com/NethermindEth/juno/utils" + "github.com/NethermindEth/juno/core" "github.com/NethermindEth/juno/core/felt" "github.com/NethermindEth/juno/p2p/starknet/spec" @@ -35,17 +37,16 @@ func AdaptTransaction(transaction core.Transaction) *spec.Transaction { case tx.Version.Is(3): specTx.Txn = &spec.Transaction_DeployAccountV3_{ DeployAccountV3: &spec.Transaction_DeployAccountV3{ - // MaxFee: AdaptFelt(tx.MaxFee), // todo support max_fee? - Signature: AdaptAccountSignature(tx.Signature()), - ClassHash: AdaptHash(tx.ClassHash), - Nonce: AdaptFelt(tx.Nonce), - AddressSalt: AdaptFelt(tx.ContractAddressSalt), - Calldata: AdaptFeltSlice(tx.ConstructorCallData), - ResourceBounds: adaptResourceBounds(tx.ResourceBounds), - Tip: AdaptFelt(new(felt.Felt).SetUint64(tx.Tip)), - // Paymaster: nil, todo support paymaster? - NonceDomain: fmt.Sprintf("%v", tx.NonceDAMode), - FeeDomain: fmt.Sprintf("%v", tx.FeeDAMode), + Signature: AdaptAccountSignature(tx.Signature()), + ClassHash: AdaptHash(tx.ClassHash), + Nonce: AdaptFelt(tx.Nonce), + AddressSalt: AdaptFelt(tx.ContractAddressSalt), + Calldata: AdaptFeltSlice(tx.ConstructorCallData), + ResourceBounds: adaptResourceBounds(tx.ResourceBounds), + Tip: tx.Tip, + PaymasterData: utils.Map(tx.PaymasterData, AdaptFelt), + NonceDataAvailabilityMode: adaptVolitionDomain(tx.NonceDAMode), + FeeDataAvailabilityMode: adaptVolitionDomain(tx.FeeDAMode), }, } default: @@ -80,23 +81,23 @@ func AdaptTransaction(transaction core.Transaction) *spec.Transaction { Signature: AdaptAccountSignature(tx.Signature()), ClassHash: AdaptHash(tx.ClassHash), Nonce: AdaptFelt(tx.Nonce), - CompiledClassHash: AdaptFelt(tx.CompiledClassHash), + CompiledClassHash: AdaptHash(tx.CompiledClassHash), }, } case tx.Version.Is(3): specTx.Txn = &spec.Transaction_DeclareV3_{ DeclareV3: &spec.Transaction_DeclareV3{ - Sender: AdaptAddress(tx.SenderAddress), - // MaxFee: AdaptFelt(tx.MaxFee), // todo support max_fee? - Signature: AdaptAccountSignature(tx.Signature()), - ClassHash: AdaptHash(tx.ClassHash), - Nonce: AdaptFelt(tx.Nonce), - CompiledClassHash: AdaptFelt(tx.CompiledClassHash), - ResourceBounds: adaptResourceBounds(tx.ResourceBounds), - Tip: AdaptFelt(new(felt.Felt).SetUint64(tx.Tip)), - // Paymaster: nil, // todo support paymaster? - NonceDomain: fmt.Sprintf("%v", tx.NonceDAMode), - FeeDomain: fmt.Sprintf("%v", tx.FeeDAMode), + Sender: AdaptAddress(tx.SenderAddress), + Signature: AdaptAccountSignature(tx.Signature()), + ClassHash: AdaptHash(tx.ClassHash), + Nonce: AdaptFelt(tx.Nonce), + CompiledClassHash: AdaptHash(tx.CompiledClassHash), + ResourceBounds: adaptResourceBounds(tx.ResourceBounds), + Tip: tx.Tip, + PaymasterData: utils.Map(tx.PaymasterData, AdaptFelt), + AccountDeploymentData: utils.Map(tx.AccountDeploymentData, AdaptFelt), + NonceDataAvailabilityMode: adaptVolitionDomain(tx.NonceDAMode), + FeeDataAvailabilityMode: adaptVolitionDomain(tx.FeeDAMode), }, } default: @@ -127,16 +128,16 @@ func AdaptTransaction(transaction core.Transaction) *spec.Transaction { case tx.Version.Is(3): specTx.Txn = &spec.Transaction_InvokeV3_{ InvokeV3: &spec.Transaction_InvokeV3{ - Sender: AdaptAddress(tx.SenderAddress), - // MaxFee: AdaptFelt(tx.MaxFee), // todo support max_fee? - Signature: AdaptAccountSignature(tx.Signature()), - Calldata: AdaptFeltSlice(tx.CallData), - Nonce: AdaptFelt(tx.Nonce), - ResourceBounds: adaptResourceBounds(tx.ResourceBounds), - Tip: AdaptFelt(new(felt.Felt).SetUint64(tx.Tip)), - // Paymaster: nil, // todo support paymaster? - NonceDomain: fmt.Sprintf("%v", tx.NonceDAMode), - FeeDomain: fmt.Sprintf("%v", tx.FeeDAMode), + Sender: AdaptAddress(tx.SenderAddress), + Signature: AdaptAccountSignature(tx.Signature()), + Calldata: AdaptFeltSlice(tx.CallData), + ResourceBounds: adaptResourceBounds(tx.ResourceBounds), + Tip: tx.Tip, + PaymasterData: utils.Map(tx.PaymasterData, AdaptFelt), + AccountDeploymentData: utils.Map(tx.AccountDeploymentData, AdaptFelt), + NonceDataAvailabilityMode: adaptVolitionDomain(tx.NonceDAMode), + FeeDataAvailabilityMode: adaptVolitionDomain(tx.FeeDAMode), + Nonce: AdaptFelt(tx.Nonce), }, } default: @@ -184,3 +185,14 @@ func adaptL1HandlerTransaction(tx *core.L1HandlerTransaction) *spec.Transaction_ }, } } + +func adaptVolitionDomain(mode core.DataAvailabilityMode) spec.VolitionDomain { + switch mode { + case core.DAModeL1: + return spec.VolitionDomain_L1 + case core.DAModeL2: + return spec.VolitionDomain_L2 + default: + panic("unreachable in adaptVolitionDomain") + } +} diff --git a/adapters/p2p2core/block.go b/adapters/p2p2core/block.go index b3b000415e..200c6c10d9 100644 --- a/adapters/p2p2core/block.go +++ b/adapters/p2p2core/block.go @@ -29,13 +29,13 @@ func AdaptBlockHeader(h *spec.SignedBlockHeader) core.Header { Hash: nil, // todo: add this when building the block ParentHash: AdaptHash(h.ParentHash), Number: h.Number, - GlobalStateRoot: AdaptHash(h.State.Root), + GlobalStateRoot: AdaptHash(h.StateRoot), SequencerAddress: AdaptAddress(h.SequencerAddress), - TransactionCount: uint64(h.Transactions.NLeaves), - EventCount: uint64(h.Events.NLeaves), + TransactionCount: h.Transactions.NLeaves, + EventCount: h.Events.NLeaves, Timestamp: h.Time, ProtocolVersion: h.ProtocolVersion, EventsBloom: nil, // Todo: add this in when building the block - GasPrice: AdaptFelt(h.GasPrice), + GasPrice: AdaptUint128(h.GasPriceFri), } } diff --git a/adapters/p2p2core/class.go b/adapters/p2p2core/class.go index bef52e82bc..f22d50929a 100644 --- a/adapters/p2p2core/class.go +++ b/adapters/p2p2core/class.go @@ -4,6 +4,11 @@ import ( "encoding/json" "fmt" + "github.com/NethermindEth/juno/adapters/sn2core" + + "github.com/NethermindEth/juno/core/felt" + "github.com/NethermindEth/juno/starknet" + "github.com/NethermindEth/juno/core" "github.com/NethermindEth/juno/core/crypto" "github.com/NethermindEth/juno/p2p/starknet/spec" @@ -19,7 +24,7 @@ func AdaptClass(class *spec.Class) core.Class { case *spec.Class_Cairo0: cairo0 := cls.Cairo0 return &core.Cairo0Class{ - Abi: cairo0.Abi, + Abi: json.RawMessage(cairo0.Abi), Externals: utils.Map(cairo0.Externals, adaptEntryPoint), L1Handlers: utils.Map(cairo0.L1Handlers, adaptEntryPoint), Constructors: utils.Map(cairo0.Constructors, adaptEntryPoint), @@ -27,20 +32,20 @@ func AdaptClass(class *spec.Class) core.Class { } case *spec.Class_Cairo1: cairo1 := cls.Cairo1 - abiHash, err := crypto.StarknetKeccak(cairo1.Abi) + abiHash, err := crypto.StarknetKeccak([]byte(cairo1.Abi)) if err != nil { panic(err) } - // Todo: remove once compiled class hash is added to p2p spec. - compiledC := new(core.CompiledClass) - if err := json.Unmarshal(cairo1.Compiled, compiledC); err != nil { - panic(fmt.Errorf("unable to unmarshal json compiled class: %v", err)) + program := utils.Map(cairo1.Program, AdaptFelt) + compiled, err := createCompiledClass(cairo1) + if err != nil { + fmt.Println("Version is ", cairo1.ContractClassVersion) + panic(err) } - program := utils.Map(cairo1.Program, AdaptFelt) return &core.Cairo1Class{ - Abi: string(cairo1.Abi), + Abi: cairo1.Abi, AbiHash: abiHash, EntryPoints: struct { Constructor []core.SierraEntryPoint @@ -54,7 +59,7 @@ func AdaptClass(class *spec.Class) core.Class { Program: program, ProgramHash: crypto.PoseidonArray(program...), SemanticVersion: cairo1.ContractClassVersion, - Compiled: compiledC, + Compiled: compiled, } default: panic(fmt.Errorf("unsupported class %T", cls)) @@ -71,6 +76,39 @@ func adaptSierra(e *spec.SierraEntryPoint) core.SierraEntryPoint { func adaptEntryPoint(e *spec.EntryPoint) core.EntryPoint { return core.EntryPoint{ Selector: AdaptFelt(e.Selector), - Offset: AdaptFelt(e.Offset), + Offset: new(felt.Felt).SetUint64(e.Offset), + } +} + +func createCompiledClass(cairo1 *spec.Cairo1Class) (*core.CompiledClass, error) { + if cairo1 == nil { + return nil, nil + } + + adapt := func(ep *spec.SierraEntryPoint) starknet.SierraEntryPoint { + return starknet.SierraEntryPoint{ + Index: ep.Index, + Selector: AdaptFelt(ep.Selector), + } } + ep := cairo1.EntryPoints + def := &starknet.SierraDefinition{ + Abi: cairo1.Abi, + EntryPoints: starknet.SierraEntryPoints{ + // WARNING: usage of utils.NonNilSlice is essential, otherwise compilation will finish with errors + // todo move NonNilSlice to Compile ? + Constructor: utils.Map(utils.NonNilSlice(ep.Constructors), adapt), + External: utils.Map(utils.NonNilSlice(ep.Externals), adapt), + L1Handler: utils.Map(utils.NonNilSlice(ep.L1Handlers), adapt), + }, + Program: utils.Map(cairo1.Program, AdaptFelt), + Version: cairo1.ContractClassVersion, + } + + compiledClass, err := starknet.Compile(def) + if err != nil { + return nil, err + } + + return sn2core.AdaptCompiledClass(compiledClass) } diff --git a/adapters/p2p2core/felt.go b/adapters/p2p2core/felt.go index 5e558f6433..62c5f64cd7 100644 --- a/adapters/p2p2core/felt.go +++ b/adapters/p2p2core/felt.go @@ -29,3 +29,8 @@ func adapt(v interface{ GetElements() []byte }) *felt.Felt { return new(felt.Felt).SetBytes(v.GetElements()) } + +func AdaptUint128(u *spec.Uint128) *felt.Felt { + // todo handle u128 + return &felt.Zero +} diff --git a/adapters/p2p2core/receipt.go b/adapters/p2p2core/receipt.go index 2dd583a616..6ef23cfb87 100644 --- a/adapters/p2p2core/receipt.go +++ b/adapters/p2p2core/receipt.go @@ -2,11 +2,13 @@ package p2p2core import ( "github.com/NethermindEth/juno/core" + "github.com/NethermindEth/juno/core/felt" "github.com/NethermindEth/juno/p2p/starknet/spec" "github.com/NethermindEth/juno/utils" ) -func AdaptReceipt(r *spec.Receipt) *core.TransactionReceipt { +// todo change type of txHash to spec +func AdaptReceipt(r *spec.Receipt, txHash *felt.Felt) *core.TransactionReceipt { var common *spec.Receipt_Common switch r.Type.(type) { @@ -28,9 +30,9 @@ func AdaptReceipt(r *spec.Receipt) *core.TransactionReceipt { ExecutionResources: adaptExecutionResources(common.ExecutionResources), L1ToL2Message: nil, L2ToL1Message: utils.Map(common.MessagesSent, adaptMessageToL1), - TransactionHash: AdaptHash(common.TransactionHash), - Reverted: common.RevertReason != "", // todo is it correct? - RevertReason: common.RevertReason, + TransactionHash: txHash, + Reverted: common.RevertReason != nil, // todo is it correct? + RevertReason: common.GetRevertReason(), } } diff --git a/adapters/p2p2core/state.go b/adapters/p2p2core/state.go index 636404c319..4bdbe9fa2a 100644 --- a/adapters/p2p2core/state.go +++ b/adapters/p2p2core/state.go @@ -41,14 +41,17 @@ func AdaptStateDiff(contractDiffs []*spec.ContractDiff, classes []*spec.Class) * storageDiffs[*address] = utils.ToMap(diff.Values, adaptStoredValue) // todo recheck this logic - addrToClsHash := addrToClassHash{ - addr: diff.Address, - classHash: diff.ClassHash, - } - if diff.GetIsReplaced() { - replacedClasses = append(replacedClasses, addrToClsHash) - } else { - deployedContracts = append(deployedContracts, addrToClsHash) + if diff.ClassHash != nil { + addrToClsHash := addrToClassHash{ + addr: diff.Address, + classHash: diff.ClassHash, + } + + if false { + replacedClasses = append(replacedClasses, addrToClsHash) + } else { + deployedContracts = append(deployedContracts, addrToClsHash) + } } } diff --git a/adapters/p2p2core/transaction.go b/adapters/p2p2core/transaction.go index 3a9cd53400..5abc8a0027 100644 --- a/adapters/p2p2core/transaction.go +++ b/adapters/p2p2core/transaction.go @@ -2,7 +2,6 @@ package p2p2core import ( "fmt" - "strconv" "github.com/NethermindEth/juno/core" "github.com/NethermindEth/juno/core/felt" @@ -64,7 +63,7 @@ func AdaptTransaction(t *spec.Transaction, network *utils.Network) core.Transact TransactionSignature: adaptAccountSignature(tx.Signature), Nonce: AdaptFelt(tx.Nonce), Version: txVersion(2), - CompiledClassHash: AdaptFelt(tx.CompiledClassHash), + CompiledClassHash: AdaptHash(tx.CompiledClassHash), } declareTx.TransactionHash = hash(declareTx) @@ -72,14 +71,14 @@ func AdaptTransaction(t *spec.Transaction, network *utils.Network) core.Transact case *spec.Transaction_DeclareV3_: tx := t.GetDeclareV3() - nDAMode, err := strconv.ParseUint(tx.GetNonceDomain(), 10, 32) + nDAMode, err := adaptVolitionDomain(tx.NonceDataAvailabilityMode) if err != nil { - panic(fmt.Sprintf("Failed to convert Nonce DA mode: %v to uint32", tx.GetNonceDomain())) + panic(fmt.Sprintf("Failed to convert Nonce DA mode: %v to uint32", tx.NonceDataAvailabilityMode)) } - fDAMode, err := strconv.ParseUint(tx.GetFeeDomain(), 10, 32) + fDAMode, err := adaptVolitionDomain(tx.FeeDataAvailabilityMode) if err != nil { - panic(fmt.Sprintf("Failed to convert Fee DA mode: %v to uint32", tx.GetFeeDomain())) + panic(fmt.Sprintf("Failed to convert Fee DA mode: %v to uint32", tx.FeeDataAvailabilityMode)) } declareTx := &core.DeclareTransaction{ @@ -89,16 +88,16 @@ func AdaptTransaction(t *spec.Transaction, network *utils.Network) core.Transact TransactionSignature: adaptAccountSignature(tx.Signature), Nonce: AdaptFelt(tx.Nonce), Version: txVersion(3), - CompiledClassHash: AdaptFelt(tx.CompiledClassHash), - Tip: AdaptFelt(tx.Tip).Uint64(), + CompiledClassHash: AdaptHash(tx.CompiledClassHash), + Tip: tx.Tip, ResourceBounds: map[core.Resource]core.ResourceBounds{ core.ResourceL1Gas: adaptResourceLimits(tx.ResourceBounds.L1Gas), core.ResourceL2Gas: adaptResourceLimits(tx.ResourceBounds.L2Gas), }, PaymasterData: nil, // Todo: P2P needs to change the pay master data to a list AccountDeploymentData: nil, // Todo: update p2p spec to include this - NonceDAMode: core.DataAvailabilityMode(nDAMode), - FeeDAMode: core.DataAvailabilityMode(fDAMode), + NonceDAMode: nDAMode, + FeeDAMode: fDAMode, } declareTx.TransactionHash = hash(declareTx) @@ -143,14 +142,14 @@ func AdaptTransaction(t *spec.Transaction, network *utils.Network) core.Transact case *spec.Transaction_DeployAccountV3_: tx := t.GetDeployAccountV3() - nDAMode, err := strconv.ParseUint(tx.GetNonceDomain(), 10, 32) + nDAMode, err := adaptVolitionDomain(tx.NonceDataAvailabilityMode) if err != nil { - panic(fmt.Sprintf("Failed to convert Nonce DA mode: %v to uint32", tx.GetNonceDomain())) + panic(fmt.Sprintf("Failed to convert Nonce DA mode: %v to uint32", tx.NonceDataAvailabilityMode)) } - fDAMode, err := strconv.ParseUint(tx.GetFeeDomain(), 10, 32) + fDAMode, err := adaptVolitionDomain(tx.FeeDataAvailabilityMode) if err != nil { - panic(fmt.Sprintf("Failed to convert Fee DA mode: %v to uint32", tx.GetFeeDomain())) + panic(fmt.Sprintf("Failed to convert Fee DA mode: %v to uint32", tx.FeeDataAvailabilityMode)) } addressSalt := AdaptFelt(tx.AddressSalt) @@ -167,14 +166,14 @@ func AdaptTransaction(t *spec.Transaction, network *utils.Network) core.Transact // MaxFee: AdaptFelt(tx.MaxFee), // todo support max_fee? TransactionSignature: adaptAccountSignature(tx.Signature), Nonce: AdaptFelt(tx.Nonce), - Tip: AdaptFelt(tx.Tip).Uint64(), + Tip: tx.Tip, ResourceBounds: map[core.Resource]core.ResourceBounds{ core.ResourceL1Gas: adaptResourceLimits(tx.ResourceBounds.L1Gas), core.ResourceL2Gas: adaptResourceLimits(tx.ResourceBounds.L2Gas), }, PaymasterData: nil, // Todo: P2P needs to change the pay master data to a list - NonceDAMode: core.DataAvailabilityMode(nDAMode), - FeeDAMode: core.DataAvailabilityMode(fDAMode), + NonceDAMode: nDAMode, + FeeDAMode: fDAMode, } deployAccTx.DeployTransaction.TransactionHash = hash(deployAccTx) @@ -212,14 +211,14 @@ func AdaptTransaction(t *spec.Transaction, network *utils.Network) core.Transact case *spec.Transaction_InvokeV3_: tx := t.GetInvokeV3() - nDAMode, err := strconv.ParseUint(tx.GetNonceDomain(), 10, 32) + nDAMode, err := adaptVolitionDomain(tx.NonceDataAvailabilityMode) if err != nil { - panic(fmt.Sprintf("Failed to convert Nonce DA mode: %v to uint32", tx.GetNonceDomain())) + panic(fmt.Sprintf("Failed to convert Nonce DA mode: %v to uint32", tx.NonceDataAvailabilityMode)) } - fDAMode, err := strconv.ParseUint(tx.GetFeeDomain(), 10, 32) + fDAMode, err := adaptVolitionDomain(tx.FeeDataAvailabilityMode) if err != nil { - panic(fmt.Sprintf("Failed to convert Fee DA mode: %v to uint32", tx.GetFeeDomain())) + panic(fmt.Sprintf("Failed to convert Fee DA mode: %v to uint32", tx.FeeDataAvailabilityMode)) } invTx := &core.InvokeTransaction{ @@ -231,14 +230,14 @@ func AdaptTransaction(t *spec.Transaction, network *utils.Network) core.Transact Nonce: AdaptFelt(tx.Nonce), SenderAddress: AdaptAddress(tx.Sender), EntryPointSelector: nil, - Tip: AdaptFelt(tx.Tip).Uint64(), + Tip: tx.Tip, ResourceBounds: map[core.Resource]core.ResourceBounds{ core.ResourceL1Gas: adaptResourceLimits(tx.ResourceBounds.L1Gas), core.ResourceL2Gas: adaptResourceLimits(tx.ResourceBounds.L2Gas), }, PaymasterData: nil, // Todo: P2P needs to change the pay master data to a list - NonceDAMode: core.DataAvailabilityMode(nDAMode), - FeeDAMode: core.DataAvailabilityMode(fDAMode), + NonceDAMode: nDAMode, + FeeDAMode: fDAMode, } invTx.TransactionHash = hash(invTx) @@ -274,3 +273,14 @@ func adaptAccountSignature(s *spec.AccountSignature) []*felt.Felt { func txVersion(v uint64) *core.TransactionVersion { return new(core.TransactionVersion).SetUint64(v) } + +func adaptVolitionDomain(v spec.VolitionDomain) (core.DataAvailabilityMode, error) { + switch v { + case spec.VolitionDomain_L1: + return core.DAModeL1, nil + case spec.VolitionDomain_L2: + return core.DAModeL2, nil + default: + return 0, fmt.Errorf("unknown volition domain %d", v) + } +} diff --git a/blockchain/blockchain.go b/blockchain/blockchain.go index b3f23679a0..36d622991c 100644 --- a/blockchain/blockchain.go +++ b/blockchain/blockchain.go @@ -340,12 +340,9 @@ func (b *Blockchain) Store(block *core.Block, blockCommitments *core.BlockCommit if err := verifyBlock(txn, block); err != nil { return err } - fmt.Printf("StateUpdate old root is %v\n", stateUpdate.OldRoot) if err := core.NewState(txn).Update(block.Number, stateUpdate, newClasses); err != nil { - fmt.Println("Update error", err) return err } - fmt.Println("Trying to store") if err := StoreBlockHeader(txn, block.Header); err != nil { return err } diff --git a/core/state.go b/core/state.go index 296ea2f3dc..7c77cdefed 100644 --- a/core/state.go +++ b/core/state.go @@ -8,8 +8,6 @@ import ( "runtime" "sort" - "github.com/davecgh/go-spew/spew" - "github.com/NethermindEth/juno/core/crypto" "github.com/NethermindEth/juno/core/felt" "github.com/NethermindEth/juno/core/trie" @@ -183,7 +181,6 @@ func (s *State) globalTrie(bucket db.Bucket, newTrie trie.NewTrieFunc) (*trie.Tr } func (s *State) verifyStateUpdateRoot(root *felt.Felt) error { - fmt.Println("verifyStateUpdateRoot", root) currentRoot, err := s.Root() if err != nil { return err @@ -205,7 +202,7 @@ func (s *State) Update(blockNumber uint64, update *StateUpdate, declaredClasses return err } - spew.Dump(blockNumber, update.StateDiff) + // spew.Dump(blockNumber, update.StateDiff) // register declared classes mentioned in stateDiff.deployedContracts and stateDiff.declaredClasses for cHash, class := range declaredClasses { diff --git a/p2p/p2p.go b/p2p/p2p.go index d43bcb2175..4df493d03b 100644 --- a/p2p/p2p.go +++ b/p2p/p2p.go @@ -222,7 +222,7 @@ func (s *Service) Run(ctx context.Context) error { func (s *Service) setProtocolHandlers() { s.SetProtocolHandler(starknet.HeadersPID(s.network), s.handler.HeadersHandler) // s.SetProtocolHandler(starknet.CurrentBlockHeaderPID(s.network), s.handler.CurrentBlockHeaderHandler) - s.SetProtocolHandler(starknet.ReceiptsPID(s.network), s.handler.ReceiptsHandler) + // s.SetProtocolHandler(starknet.ReceiptsPID(s.network), s.handler.ReceiptsHandler) // todo discuss protocol id (should it be included in HeadersPID) // s.SetProtocolHandler(starknet.BlockBodiesPID(s.network), s.handler.BlockBodiesHandler) s.SetProtocolHandler(starknet.EventsPID(s.network), s.handler.EventsHandler) diff --git a/p2p/starknet/block_bodies.go b/p2p/starknet/block_bodies.go index 7df0db763d..77a1c57582 100644 --- a/p2p/starknet/block_bodies.go +++ b/p2p/starknet/block_bodies.go @@ -131,6 +131,8 @@ type contractDiff struct { address *felt.Felt storageDiffs map[felt.Felt]*felt.Felt nonce *felt.Felt + classHash *felt.Felt // set only if contract deployed or replaced + replaced *bool // set only if contract deployed or replaced } func (b *blockBodyIterator) diff() (proto.Message, bool) { diff --git a/p2p/starknet/client.go b/p2p/starknet/client.go index 99275b60e1..ae6f902eca 100644 --- a/p2p/starknet/client.go +++ b/p2p/starknet/client.go @@ -122,9 +122,9 @@ func (c *Client) RequestStateDiffs(ctx context.Context, req *spec.StateDiffsRequ return requestAndReceiveStream[*spec.StateDiffsRequest, *spec.StateDiffsResponse](ctx, c.newStream, StateDiffPID(c.network), req, c.log) } -func (c *Client) RequestReceipts(ctx context.Context, req *spec.ReceiptsRequest) (iter.Seq[*spec.ReceiptsResponse], error) { - return requestAndReceiveStream[*spec.ReceiptsRequest, *spec.ReceiptsResponse](ctx, c.newStream, ReceiptsPID(c.network), req, c.log) -} +//func (c *Client) RequestReceipts(ctx context.Context, req *spec.ReceiptsRequest) (iter.Seq[*spec.ReceiptsResponse], error) { +// return requestAndReceiveStream[*spec.ReceiptsRequest, *spec.ReceiptsResponse](ctx, c.newStream, ReceiptsPID(c.network), req, c.log) +//} func (c *Client) RequestTransactions(ctx context.Context, req *spec.TransactionsRequest) (iter.Seq[*spec.TransactionsResponse], error) { return requestAndReceiveStream[*spec.TransactionsRequest, *spec.TransactionsResponse]( diff --git a/p2p/starknet/handlers.go b/p2p/starknet/handlers.go index 9d9f4bd4a9..886810cab9 100644 --- a/p2p/starknet/handlers.go +++ b/p2p/starknet/handlers.go @@ -118,9 +118,9 @@ func (h *Handler) EventsHandler(stream network.Stream) { streamHandler[*spec.EventsRequest](h.ctx, &h.wg, stream, h.onEventsRequest, h.log) } -func (h *Handler) ReceiptsHandler(stream network.Stream) { - streamHandler[*spec.ReceiptsRequest](h.ctx, &h.wg, stream, h.onReceiptsRequest, h.log) -} +//func (h *Handler) ReceiptsHandler(stream network.Stream) { +// streamHandler[*spec.ReceiptsRequest](h.ctx, &h.wg, stream, h.onReceiptsRequest, h.log) +//} func (h *Handler) TransactionsHandler(stream network.Stream) { streamHandler[*spec.TransactionsRequest](h.ctx, &h.wg, stream, h.onTransactionsRequest, h.log) @@ -256,6 +256,7 @@ func (h *Handler) onEventsRequest(req *spec.EventsRequest) (iter.Seq[proto.Messa }) } +/* func (h *Handler) onReceiptsRequest(req *spec.ReceiptsRequest) (iter.Seq[proto.Message], error) { finMsg := &spec.ReceiptsResponse{ReceiptMessage: &spec.ReceiptsResponse_Fin{}} return h.processIterationRequestMulti(req.Iteration, finMsg, func(it blockDataAccessor) ([]proto.Message, error) { @@ -276,6 +277,7 @@ func (h *Handler) onReceiptsRequest(req *spec.ReceiptsRequest) (iter.Seq[proto.M return responses, nil }) } +*/ func (h *Handler) onTransactionsRequest(req *spec.TransactionsRequest) (iter.Seq[proto.Message], error) { finMsg := &spec.TransactionsResponse{ @@ -289,9 +291,14 @@ func (h *Handler) onTransactionsRequest(req *spec.TransactionsRequest) (iter.Seq responses := make([]proto.Message, len(block.Transactions)) for i, tx := range block.Transactions { + receipt := block.Receipts[i] + responses[i] = &spec.TransactionsResponse{ - TransactionMessage: &spec.TransactionsResponse_Transaction{ - Transaction: core2p2p.AdaptTransaction(tx), + TransactionMessage: &spec.TransactionsResponse_TransactionWithReceipt{ + TransactionWithReceipt: &spec.TransactionWithReceipt{ + Transaction: core2p2p.AdaptTransaction(tx), + Receipt: core2p2p.AdaptReceipt(receipt, tx), + }, }, } } @@ -354,25 +361,33 @@ func (h *Handler) onStateDiffRequest(req *spec.StateDiffsRequest) (iter.Seq[prot } } - var responses []proto.Message - for _, c := range modifiedContracts { - contractAddress := *c.address - - var ( - classHash *felt.Felt - replaced *bool - ) - if hash, ok := diff.DeployedContracts[contractAddress]; ok { - classHash = hash - replaced = utils.Ptr(false) - } else if hash, ok = diff.ReplacedClasses[contractAddress]; ok { - classHash = hash - replaced = utils.Ptr(true) + for addr, classHash := range diff.DeployedContracts { + classHashCopy := classHash + err = updateModifiedContracts(addr, func(diff *contractDiff) { + diff.classHash = classHashCopy + diff.replaced = utils.Ptr(false) + }) + if err != nil { + return nil, err } + } + for addr, classHash := range diff.ReplacedClasses { + classHashCopy := classHash + err = updateModifiedContracts(addr, func(diff *contractDiff) { + diff.classHash = classHashCopy + diff.replaced = utils.Ptr(true) + }) + if err != nil { + return nil, err + } + } + + var responses []proto.Message + for _, c := range modifiedContracts { responses = append(responses, &spec.StateDiffsResponse{ StateDiffMessage: &spec.StateDiffsResponse_ContractDiff{ - ContractDiff: core2p2p.AdaptContractDiff(c.address, c.nonce, classHash, replaced, c.storageDiffs), + ContractDiff: core2p2p.AdaptContractDiff(c.address, c.nonce, c.classHash, c.replaced, c.storageDiffs), }, }) } diff --git a/p2p/starknet/ids.go b/p2p/starknet/ids.go index 3656155631..abf17d3a72 100644 --- a/p2p/starknet/ids.go +++ b/p2p/starknet/ids.go @@ -14,17 +14,13 @@ func HeadersPID(n *utils.Network) protocol.ID { return n.ProtocolID() + "/headers/0.1.0-rc.0" } -func BlockBodiesPID(n *utils.Network) protocol.ID { - return n.ProtocolID() + "/block_bodies/0.1.0-rc.0" -} - func EventsPID(n *utils.Network) protocol.ID { return n.ProtocolID() + "/events/0.1.0-rc.0" } -func ReceiptsPID(n *utils.Network) protocol.ID { - return n.ProtocolID() + "/receipts/0.1.0-rc.0" -} +//func ReceiptsPID(n *utils.Network) protocol.ID { +// return n.ProtocolID() + "/receipts/0.1.0-rc.0" +//} func TransactionsPID(n *utils.Network) protocol.ID { return n.ProtocolID() + "/transactions/0.1.0-rc.0" diff --git a/p2p/starknet/p2p/proto/class.proto b/p2p/starknet/p2p/proto/class.proto index 9db01b34b9..d3cb20d163 100644 --- a/p2p/starknet/p2p/proto/class.proto +++ b/p2p/starknet/p2p/proto/class.proto @@ -6,15 +6,16 @@ option go_package = "github.com/NethermindEth/juno/p2p/starknet/spec"; message EntryPoint { Felt252 selector = 1; - Felt252 offset = 2; + uint64 offset = 2; } message Cairo0Class { - bytes abi = 1; + string abi = 1; repeated EntryPoint externals = 2; repeated EntryPoint l1_handlers = 3; repeated EntryPoint constructors = 4; - bytes program = 5; + // Compressed in base64 representation. + string program = 5; } message SierraEntryPoint { @@ -29,24 +30,18 @@ message Cairo1EntryPoints { } message Cairo1Class { - bytes abi = 1; + string abi = 1; Cairo1EntryPoints entry_points = 2; repeated Felt252 program = 3; string contract_class_version = 4; - bytes compiled = 5; } -// is it better to separate the definition from the hashes? (will need to repeate the hashes -// for the definitions stream) -// or, make the definitions optional? maybe it is enough to know only that a class exists, not its definition -// which may be fetched lazily later. message Class { oneof class { Cairo0Class cairo0 = 1; Cairo1Class cairo1 = 2; } uint32 domain = 3; - Hash class_hash = 4; } message ClassesRequest { diff --git a/p2p/starknet/p2p/proto/common.proto b/p2p/starknet/p2p/proto/common.proto index f11d0aa20f..6e83439716 100644 --- a/p2p/starknet/p2p/proto/common.proto +++ b/p2p/starknet/p2p/proto/common.proto @@ -22,25 +22,40 @@ message PeerID { bytes id = 1; } +message Uint128 { + uint64 low = 1; + uint64 high = 2; +} + message ConsensusSignature { Felt252 r = 1; Felt252 s = 2; } -message Merkle { - uint32 n_leaves = 1; // needed to know the height, so as to how many nodes to expect in a proof. +message Patricia { + uint64 n_leaves = 1; // needed to know the height, so as to how many nodes to expect in a proof. // and also when receiving all leaves, how many to expect - Hash root = 2; + Hash root = 2; } -message Patricia { - uint32 height = 1; - Hash root = 2; +message StateDiffCommitment { + uint64 state_diff_length = 1; + Hash root = 2; } message BlockID { uint64 number = 1; - Hash header = 2; + Hash header = 2; +} + +enum L1DataAvailabilityMode { + Calldata = 0; + Blob = 1; +} + +enum VolitionDomain { + L1 = 0; + L2 = 1; } message Iteration { @@ -50,11 +65,11 @@ message Iteration { } oneof start { uint64 block_number = 1; - Hash header = 2; + Hash header = 2; } Direction direction = 3; - uint64 limit = 4; - uint64 step = 5; // to allow interleaving from several nodes + uint64 limit = 4; + uint64 step = 5; // to allow interleaving from several nodes // bool interleave = 6; // return results in any order of blocks, per block the messages should still be in the order specified } diff --git a/p2p/starknet/p2p/proto/event.proto b/p2p/starknet/p2p/proto/event.proto index ef3dedf8f2..832008064a 100644 --- a/p2p/starknet/p2p/proto/event.proto +++ b/p2p/starknet/p2p/proto/event.proto @@ -5,9 +5,9 @@ option go_package = "github.com/NethermindEth/juno/p2p/starknet/spec"; message Event { Hash transaction_hash = 1; - Felt252 from_address = 2; - repeated Felt252 keys = 3; - repeated Felt252 data = 4; + Felt252 from_address = 3; // looks like mistake? + repeated Felt252 keys = 4; + repeated Felt252 data = 5; } message EventsRequest { @@ -18,6 +18,6 @@ message EventsRequest { message EventsResponse { oneof event_message { Event event = 1; - Fin fin = 2; // Fin is sent after the peer sent all the data or when it encountered a block that it doesn't have its events. + Fin fin = 2; // Fin is sent after the peer sent all the data or when it encountered a block that it doesn't have its events. } } \ No newline at end of file diff --git a/p2p/starknet/p2p/proto/header.proto b/p2p/starknet/p2p/proto/header.proto index 4efe2041d2..12d765ad9f 100644 --- a/p2p/starknet/p2p/proto/header.proto +++ b/p2p/starknet/p2p/proto/header.proto @@ -6,26 +6,26 @@ option go_package = "github.com/NethermindEth/juno/p2p/starknet/spec"; // Note: commitments may change to be for the previous blocks like comet/tendermint // hash of block header sent to L1 message SignedBlockHeader { - Hash block_hash = 1; // For the structure of the block hash, see https://docs.starknet.io/documentation/architecture_and_concepts/Network_Architecture/header/#block_hash - Hash parent_hash = 2; - uint64 number = 3; - uint64 time = 4; // Encoded in Unix time. - Address sequencer_address = 5; - Hash state_diff_commitment = 6; // The state diff commitment returned by the Starknet Feeder Gateway. - // For more info, see https://community.starknet.io/t/introducing-p2p-authentication-and-mismatch-resolution-in-v0-12-2/97993 - Patricia state = 7; // hash of contract and class patricia tries. Same as in L1. Later more trees will be included - // The following merkles can be built on the fly while sequencing/validating txs. - 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; - uint64 num_storage_diffs = 13; - uint64 num_nonce_updates = 14; - uint64 num_declared_classes = 15; // Includes both Cairo 0 and Cairo 1. - uint64 num_deployed_contracts = 16; // This includes the replaced classes too. + Hash block_hash = 1; // For the structure of the block hash, see https://docs.starknet.io/documentation/architecture_and_concepts/Network_Architecture/header/#block_hash + Hash parent_hash = 2; + uint64 number = 3; // This can be deduced from context. We can consider removing this field. + uint64 time = 4; // Encoded in Unix time. + Address sequencer_address = 5; + Hash state_root = 6; // Patricia root of contract and class patricia tries. Each of those tries are of height 251. Same as in L1. Later more trees will be included + StateDiffCommitment state_diff_commitment = 7; // The state diff commitment returned by the Starknet Feeder Gateway + // For more info, see https://community.starknet.io/t/introducing-p2p-authentication-and-mismatch-resolution-in-v0-12-2/97993 + // The leaves contain a hash of the transaction hash and transaction signature. + Patricia transactions = 8; // By order of execution. TBD: required? the client can execute (powerful machine) and match state diff + Patricia events = 9; // By order of issuance. TBD: in receipts? + Hash receipts = 10; // By order of issuance. This is a patricia root. No need for length because it's the same length as transactions. + string protocol_version = 11; // Starknet version + Uint128 gas_price_fri = 12; + Uint128 gas_price_wei = 13; + Uint128 data_gas_price_fri = 14; + Uint128 data_gas_price_wei = 15; + L1DataAvailabilityMode l1_data_availability_mode = 16; // for now, we assume a small consensus, so this fits in 1M. Else, these will be repeated and extracted from this message. - repeated ConsensusSignature signatures = 17; + repeated ConsensusSignature signatures = 17; // can be more explicit here about the signature structure as this is not part of account abstraction } @@ -33,7 +33,7 @@ message SignedBlockHeader { // for a fraction of peers, also send the GetBlockHeaders response (as if they asked for it for this block) message NewBlock { oneof maybe_full { - BlockID id = 1; + BlockID id = 1; BlockHeadersResponse header = 2; } } @@ -47,6 +47,10 @@ message BlockHeadersRequest { message BlockHeadersResponse { oneof header_message { SignedBlockHeader header = 1; - Fin fin = 2; // Fin is sent after the peer sent all the data or when it encountered a block that it doesn't have its header. + Fin fin = 2; // Fin is sent after the peer sent all the data or when it encountered a block that it doesn't have its header. } +} + +message BlockProof { + repeated bytes proof = 1; } \ No newline at end of file diff --git a/p2p/starknet/p2p/proto/receipt.proto b/p2p/starknet/p2p/proto/receipt.proto index 76a898897c..ffadabedc2 100644 --- a/p2p/starknet/p2p/proto/receipt.proto +++ b/p2p/starknet/p2p/proto/receipt.proto @@ -4,9 +4,14 @@ import "p2p/proto/common.proto"; option go_package = "github.com/NethermindEth/juno/p2p/starknet/spec"; message MessageToL1 { - Felt252 from_address = 1; - repeated Felt252 payload = 2; - EthereumAddress to_address = 3; + Felt252 from_address = 2; + repeated Felt252 payload = 3; + EthereumAddress to_address = 4; +} + +enum PriceUnit { + Wei = 0; + Fri = 1; } message EthereumAddress { @@ -16,27 +21,29 @@ message EthereumAddress { message Receipt { message ExecutionResources { message BuiltinCounter { - uint32 bitwise = 1; - uint32 ecdsa = 2; - uint32 ec_op = 3; - uint32 pedersen = 4; + uint32 bitwise = 1; + uint32 ecdsa = 2; + uint32 ec_op = 3; + uint32 pedersen = 4; uint32 range_check = 5; - uint32 poseidon = 6; - uint32 keccak = 7; - uint32 output = 8; + uint32 poseidon = 6; + uint32 keccak = 7; + uint32 output = 8; } - BuiltinCounter builtins = 1; - uint32 steps = 2; - uint32 memory_holes = 3; + BuiltinCounter builtins = 1; + uint32 steps = 2; + uint32 memory_holes = 3; + Felt252 l1_gas = 4; + Felt252 l1_data_gas = 5; } message Common { - Hash transaction_hash = 1; - Felt252 actual_fee = 2; - repeated MessageToL1 messages_sent = 3; - ExecutionResources execution_resources = 4; - string revert_reason = 5; + Felt252 actual_fee = 2; + PriceUnit price_unit = 3; + repeated MessageToL1 messages_sent = 4; + ExecutionResources execution_resources = 5; + optional string revert_reason = 6; } @@ -45,8 +52,8 @@ message Receipt { } message L1Handler { - Common common = 1; - Hash msg_hash = 2; + Common common = 1; + Hash msg_hash = 2; } message Declare { @@ -59,31 +66,15 @@ message Receipt { } message DeployAccount { - Common common = 1; + Common common = 1; Felt252 contract_address = 2; } oneof type { - Invoke invoke = 1; - L1Handler l1_handler = 2; - Declare declare = 3; - Deploy deprecated_deploy = 4; - DeployAccount deploy_account = 5; - } -} - -message ReceiptsRequest { - Iteration iteration = 1; -} - -message Receipts { - repeated Receipt items = 2; -} - -// Responses are sent ordered by the order given in the request. -message ReceiptsResponse { - oneof receipt_message { - Receipt receipt = 1; - Fin fin = 2; // Fin is sent after the peer sent all the data or when it encountered a block that it doesn't have its receipts. + Invoke invoke = 1; + L1Handler l1_handler = 2; + Declare declare = 3; + Deploy deprecated_deploy = 4; + DeployAccount deploy_account = 5; } } \ No newline at end of file diff --git a/p2p/starknet/p2p/proto/state.proto b/p2p/starknet/p2p/proto/state.proto index a7834e6e6c..79f33fcafe 100644 --- a/p2p/starknet/p2p/proto/state.proto +++ b/p2p/starknet/p2p/proto/state.proto @@ -10,12 +10,16 @@ message ContractStoredValue { } message ContractDiff { - Address address = 1; - optional Felt252 nonce = 2; // Present only if the nonce was updated - optional Hash class_hash = 3; // Present only if the contract was deployed or replaced in this block. - optional bool is_replaced = 4; // Present only if the contract was deployed or replaced, in order to determine whether the contract was deployed or replaced. - repeated ContractStoredValue values = 5; - uint32 domain = 6; // volition state domain + Address address = 1; + optional Felt252 nonce = 2; // Present only if the nonce was updated + optional Hash class_hash = 3; // Present only if the contract was deployed or replaced in this block. + repeated ContractStoredValue values = 4; + VolitionDomain domain = 5; +} + +message DeclaredClass { + Hash class_hash = 1; + optional Hash compiled_class_hash = 2; // Present only if the class is Cairo1 } message StateDiffsRequest { @@ -26,7 +30,8 @@ message StateDiffsRequest { message StateDiffsResponse { // All of the messages related to a block need to be sent before a message from the next block is sent. oneof state_diff_message { - ContractDiff contract_diff = 1; // Multiple contract diffs for the same contract may appear continuously if the diff is too large. - Fin fin = 2; // Fin is sent after the peer sent all the data or when it encountered a block that it doesn't have its state diff. + ContractDiff contract_diff = 1; // Multiple contract diffs for the same contract may appear continuously if the diff is too large or if it's more convenient. + DeclaredClass declared_class = 2; + Fin fin = 3; // Fin is sent after the peer sent all the data or when it encountered a block that it doesn't have its state diff. } } \ No newline at end of file diff --git a/p2p/starknet/p2p/proto/transaction.proto b/p2p/starknet/p2p/proto/transaction.proto index 249c3b5a85..4736d78f6f 100644 --- a/p2p/starknet/p2p/proto/transaction.proto +++ b/p2p/starknet/p2p/proto/transaction.proto @@ -1,10 +1,11 @@ syntax = "proto3"; import "p2p/proto/common.proto"; +import "p2p/proto/receipt.proto"; option go_package = "github.com/NethermindEth/juno/p2p/starknet/spec"; message ResourceLimits { - Felt252 max_amount = 1; + Felt252 max_amount = 1; Felt252 max_price_per_unit = 2; } @@ -17,128 +18,134 @@ message AccountSignature { repeated Felt252 parts = 1; } +// This is a transaction that is already accepted in a block. Once we have a mempool, we will define +// a separate message for BroadcastedTransaction. message Transaction { message DeclareV0 { - Address sender = 1; - Felt252 max_fee = 2; - AccountSignature signature = 3; - Hash class_hash = 4; + Address sender = 1; + Felt252 max_fee = 2; + AccountSignature signature = 3; + Hash class_hash = 4; } message DeclareV1 { - Address sender = 1; - Felt252 max_fee = 2; - AccountSignature signature = 3; - Hash class_hash = 4; - Felt252 nonce = 5; + Address sender = 1; + Felt252 max_fee = 2; + AccountSignature signature = 3; + Hash class_hash = 4; + Felt252 nonce = 5; } message DeclareV2 { - Address sender = 1; - Felt252 max_fee = 2; - AccountSignature signature = 3; - Hash class_hash = 4; - Felt252 nonce = 5; - Felt252 compiled_class_hash = 6; + Address sender = 1; + Felt252 max_fee = 2; + AccountSignature signature = 3; + Hash class_hash = 4; + Felt252 nonce = 5; + Hash compiled_class_hash = 6; } // see https://external.integration.starknet.io/feeder_gateway/get_transaction?transactionHash=0x41d1f5206ef58a443e7d3d1ca073171ec25fa75313394318fc83a074a6631c3 message DeclareV3 { - Address sender = 1; - AccountSignature signature = 2; - Hash class_hash = 3; - Felt252 nonce = 4; - Felt252 compiled_class_hash = 5; - ResourceBounds resource_bounds = 6; - Felt252 tip = 7; - Address paymaster_data = 8; - Address account_deployment_data = 9; - string nonce_domain = 10; // rename to nonce_data_availability_mode ? - string fee_domain = 11; // rename to fee_data_availability_mode ? + Address sender = 1; + AccountSignature signature = 2; + Hash class_hash = 3; + Felt252 nonce = 4; + Hash compiled_class_hash = 5; + ResourceBounds resource_bounds = 6; + uint64 tip = 7; + repeated Felt252 paymaster_data = 8; + repeated Felt252 account_deployment_data = 9; + VolitionDomain nonce_data_availability_mode = 10; + VolitionDomain fee_data_availability_mode = 11; } message Deploy { - Hash class_hash = 1; - Felt252 address_salt = 2; + Hash class_hash = 1; + Felt252 address_salt = 2; repeated Felt252 calldata = 3; - uint32 version = 4; + uint32 version = 4; } message DeployAccountV1 { - Felt252 max_fee = 1; - AccountSignature signature = 2; - Hash class_hash = 3; - Felt252 nonce = 4; - Felt252 address_salt = 5; - repeated Felt252 calldata = 6; + Felt252 max_fee = 1; + AccountSignature signature = 2; + Hash class_hash = 3; + Felt252 nonce = 4; + Felt252 address_salt = 5; + repeated Felt252 calldata = 6; } // see https://external.integration.starknet.io/feeder_gateway/get_transaction?transactionHash=0x29fd7881f14380842414cdfdd8d6c0b1f2174f8916edcfeb1ede1eb26ac3ef0 message DeployAccountV3 { - AccountSignature signature = 1; - Hash class_hash = 2; - Felt252 nonce = 3; - Felt252 address_salt = 4; - repeated Felt252 calldata = 5; - ResourceBounds resource_bounds = 6; - Felt252 tip = 7; - Address paymaster_data = 8; - string nonce_domain = 9; // rename to nonce_data_availability_mode ? - string fee_domain = 10; // rename to fee_data_availability_mode ? + AccountSignature signature = 1; + Hash class_hash = 2; + Felt252 nonce = 3; + Felt252 address_salt = 4; + repeated Felt252 calldata = 5; + ResourceBounds resource_bounds = 6; + uint64 tip = 7; + repeated Felt252 paymaster_data = 8; + VolitionDomain nonce_data_availability_mode = 9; + VolitionDomain fee_data_availability_mode = 10; } message InvokeV0 { - Felt252 max_fee = 1; - AccountSignature signature = 2; - Address address = 3; - Felt252 entry_point_selector = 4; - repeated Felt252 calldata = 5; + Felt252 max_fee = 1; + AccountSignature signature = 2; + Address address = 3; + Felt252 entry_point_selector = 4; + repeated Felt252 calldata = 5; } message InvokeV1 { - Address sender = 1; - Felt252 max_fee = 2; - AccountSignature signature = 3; - repeated Felt252 calldata = 4; - Felt252 nonce = 5; + Address sender = 1; + Felt252 max_fee = 2; + AccountSignature signature = 3; + repeated Felt252 calldata = 4; + Felt252 nonce = 5; } // see https://external.integration.starknet.io/feeder_gateway/get_transaction?transactionHash=0x41906f1c314cca5f43170ea75d3b1904196a10101190d2b12a41cc61cfd17c message InvokeV3 { - Address sender = 1; - AccountSignature signature = 2; - repeated Felt252 calldata = 3; - ResourceBounds resource_bounds = 4; - Felt252 tip = 5; - Address paymaster_data = 6; - Address account_deployment_data = 7; - string nonce_domain = 8; // rename to nonce_data_availability_mode ? - string fee_domain = 9; // rename to fee_data_availability_mode ? - Felt252 nonce = 10; + Address sender = 1; + AccountSignature signature = 2; + repeated Felt252 calldata = 3; + ResourceBounds resource_bounds = 4; + uint64 tip = 5; + repeated Felt252 paymaster_data = 6; + repeated Felt252 account_deployment_data = 7; + VolitionDomain nonce_data_availability_mode = 8; + VolitionDomain fee_data_availability_mode = 9; + Felt252 nonce = 10; } message L1HandlerV0 { - Felt252 nonce = 1; - Address address = 2; - Felt252 entry_point_selector = 3; - repeated Felt252 calldata = 4; + Felt252 nonce = 1; + Address address = 2; + Felt252 entry_point_selector = 3; + repeated Felt252 calldata = 4; } oneof txn { - DeclareV0 declare_v0 = 1; - DeclareV1 declare_v1 = 2; - DeclareV2 declare_v2 = 3; - DeclareV3 declare_v3 = 4; - Deploy deploy = 5; + DeclareV0 declare_v0 = 1; + DeclareV1 declare_v1 = 2; + DeclareV2 declare_v2 = 3; + DeclareV3 declare_v3 = 4; + Deploy deploy = 5; DeployAccountV1 deploy_account_v1 = 6; DeployAccountV3 deploy_account_v3 = 7; - InvokeV0 invoke_v0 = 8; - InvokeV1 invoke_v1 = 9; - InvokeV3 invoke_v3 = 10; - L1HandlerV0 l1_handler = 11; + InvokeV0 invoke_v0 = 8; + InvokeV1 invoke_v1 = 9; + InvokeV3 invoke_v3 = 10; + L1HandlerV0 l1_handler = 11; } - Hash transaction_hash = 12; +} + +message TransactionWithReceipt { + Transaction transaction = 1; + Receipt receipt = 2; } // TBD: can support a flag to return tx hashes only, good for standalone mempool to remove them, @@ -147,10 +154,15 @@ message TransactionsRequest { Iteration iteration = 1; } -// Responses are sent ordered by the order given in the request. +// Responses are sent ordered by the order given in the request. The order inside each block is +// according to the execution order. message TransactionsResponse { oneof transaction_message { - Transaction transaction = 1; - Fin fin = 2; // Fin is sent after the peer sent all the data or when it encountered a block that it doesn't have its transactions. + TransactionWithReceipt transaction_with_receipt = 1; + Fin fin = 2; // Fin is sent after the peer sent all the data or when it encountered a block that it doesn't have its transactions. } +} + +message Transactions { + repeated Transaction transactions = 1; } \ No newline at end of file diff --git a/p2p/starknet/spec/class.pb.go b/p2p/starknet/spec/class.pb.go index e282f638c3..a9aaf29c00 100644 --- a/p2p/starknet/spec/class.pb.go +++ b/p2p/starknet/spec/class.pb.go @@ -27,7 +27,7 @@ type EntryPoint struct { unknownFields protoimpl.UnknownFields Selector *Felt252 `protobuf:"bytes,1,opt,name=selector,proto3" json:"selector,omitempty"` - Offset *Felt252 `protobuf:"bytes,2,opt,name=offset,proto3" json:"offset,omitempty"` + Offset uint64 `protobuf:"varint,2,opt,name=offset,proto3" json:"offset,omitempty"` } func (x *EntryPoint) Reset() { @@ -69,11 +69,11 @@ func (x *EntryPoint) GetSelector() *Felt252 { return nil } -func (x *EntryPoint) GetOffset() *Felt252 { +func (x *EntryPoint) GetOffset() uint64 { if x != nil { return x.Offset } - return nil + return 0 } type Cairo0Class struct { @@ -81,11 +81,12 @@ type Cairo0Class struct { sizeCache protoimpl.SizeCache unknownFields protoimpl.UnknownFields - Abi []byte `protobuf:"bytes,1,opt,name=abi,proto3" json:"abi,omitempty"` + Abi string `protobuf:"bytes,1,opt,name=abi,proto3" json:"abi,omitempty"` Externals []*EntryPoint `protobuf:"bytes,2,rep,name=externals,proto3" json:"externals,omitempty"` L1Handlers []*EntryPoint `protobuf:"bytes,3,rep,name=l1_handlers,json=l1Handlers,proto3" json:"l1_handlers,omitempty"` Constructors []*EntryPoint `protobuf:"bytes,4,rep,name=constructors,proto3" json:"constructors,omitempty"` - Program []byte `protobuf:"bytes,5,opt,name=program,proto3" json:"program,omitempty"` + // Compressed in base64 representation. + Program string `protobuf:"bytes,5,opt,name=program,proto3" json:"program,omitempty"` } func (x *Cairo0Class) Reset() { @@ -120,11 +121,11 @@ func (*Cairo0Class) Descriptor() ([]byte, []int) { return file_p2p_proto_class_proto_rawDescGZIP(), []int{1} } -func (x *Cairo0Class) GetAbi() []byte { +func (x *Cairo0Class) GetAbi() string { if x != nil { return x.Abi } - return nil + return "" } func (x *Cairo0Class) GetExternals() []*EntryPoint { @@ -148,11 +149,11 @@ func (x *Cairo0Class) GetConstructors() []*EntryPoint { return nil } -func (x *Cairo0Class) GetProgram() []byte { +func (x *Cairo0Class) GetProgram() string { if x != nil { return x.Program } - return nil + return "" } type SierraEntryPoint struct { @@ -278,11 +279,10 @@ type Cairo1Class struct { sizeCache protoimpl.SizeCache unknownFields protoimpl.UnknownFields - Abi []byte `protobuf:"bytes,1,opt,name=abi,proto3" json:"abi,omitempty"` + Abi string `protobuf:"bytes,1,opt,name=abi,proto3" json:"abi,omitempty"` EntryPoints *Cairo1EntryPoints `protobuf:"bytes,2,opt,name=entry_points,json=entryPoints,proto3" json:"entry_points,omitempty"` Program []*Felt252 `protobuf:"bytes,3,rep,name=program,proto3" json:"program,omitempty"` ContractClassVersion string `protobuf:"bytes,4,opt,name=contract_class_version,json=contractClassVersion,proto3" json:"contract_class_version,omitempty"` - Compiled []byte `protobuf:"bytes,5,opt,name=compiled,proto3" json:"compiled,omitempty"` } func (x *Cairo1Class) Reset() { @@ -317,11 +317,11 @@ func (*Cairo1Class) Descriptor() ([]byte, []int) { return file_p2p_proto_class_proto_rawDescGZIP(), []int{4} } -func (x *Cairo1Class) GetAbi() []byte { +func (x *Cairo1Class) GetAbi() string { if x != nil { return x.Abi } - return nil + return "" } func (x *Cairo1Class) GetEntryPoints() *Cairo1EntryPoints { @@ -345,17 +345,6 @@ func (x *Cairo1Class) GetContractClassVersion() string { return "" } -func (x *Cairo1Class) GetCompiled() []byte { - if x != nil { - return x.Compiled - } - return nil -} - -// is it better to separate the definition from the hashes? (will need to repeate the hashes -// for the definitions stream) -// or, make the definitions optional? maybe it is enough to know only that a class exists, not its definition -// which may be fetched lazily later. type Class struct { state protoimpl.MessageState sizeCache protoimpl.SizeCache @@ -365,9 +354,8 @@ type Class struct { // // *Class_Cairo0 // *Class_Cairo1 - Class isClass_Class `protobuf_oneof:"class"` - Domain uint32 `protobuf:"varint,3,opt,name=domain,proto3" json:"domain,omitempty"` - ClassHash *Hash `protobuf:"bytes,4,opt,name=class_hash,json=classHash,proto3" json:"class_hash,omitempty"` + Class isClass_Class `protobuf_oneof:"class"` + Domain uint32 `protobuf:"varint,3,opt,name=domain,proto3" json:"domain,omitempty"` } func (x *Class) Reset() { @@ -430,13 +418,6 @@ func (x *Class) GetDomain() uint32 { return 0 } -func (x *Class) GetClassHash() *Hash { - if x != nil { - return x.ClassHash - } - return nil -} - type isClass_Class interface { isClass_Class() } @@ -588,77 +569,72 @@ var file_p2p_proto_class_proto_rawDesc = []byte{ 0x0a, 0x15, 0x70, 0x32, 0x70, 0x2f, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2f, 0x63, 0x6c, 0x61, 0x73, 0x73, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x1a, 0x16, 0x70, 0x32, 0x70, 0x2f, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2f, 0x63, 0x6f, 0x6d, 0x6d, 0x6f, 0x6e, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x22, - 0x54, 0x0a, 0x0a, 0x45, 0x6e, 0x74, 0x72, 0x79, 0x50, 0x6f, 0x69, 0x6e, 0x74, 0x12, 0x24, 0x0a, + 0x4a, 0x0a, 0x0a, 0x45, 0x6e, 0x74, 0x72, 0x79, 0x50, 0x6f, 0x69, 0x6e, 0x74, 0x12, 0x24, 0x0a, 0x08, 0x73, 0x65, 0x6c, 0x65, 0x63, 0x74, 0x6f, 0x72, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x08, 0x2e, 0x46, 0x65, 0x6c, 0x74, 0x32, 0x35, 0x32, 0x52, 0x08, 0x73, 0x65, 0x6c, 0x65, 0x63, - 0x74, 0x6f, 0x72, 0x12, 0x20, 0x0a, 0x06, 0x6f, 0x66, 0x66, 0x73, 0x65, 0x74, 0x18, 0x02, 0x20, - 0x01, 0x28, 0x0b, 0x32, 0x08, 0x2e, 0x46, 0x65, 0x6c, 0x74, 0x32, 0x35, 0x32, 0x52, 0x06, 0x6f, - 0x66, 0x66, 0x73, 0x65, 0x74, 0x22, 0xc3, 0x01, 0x0a, 0x0b, 0x43, 0x61, 0x69, 0x72, 0x6f, 0x30, - 0x43, 0x6c, 0x61, 0x73, 0x73, 0x12, 0x10, 0x0a, 0x03, 0x61, 0x62, 0x69, 0x18, 0x01, 0x20, 0x01, - 0x28, 0x0c, 0x52, 0x03, 0x61, 0x62, 0x69, 0x12, 0x29, 0x0a, 0x09, 0x65, 0x78, 0x74, 0x65, 0x72, - 0x6e, 0x61, 0x6c, 0x73, 0x18, 0x02, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x0b, 0x2e, 0x45, 0x6e, 0x74, - 0x72, 0x79, 0x50, 0x6f, 0x69, 0x6e, 0x74, 0x52, 0x09, 0x65, 0x78, 0x74, 0x65, 0x72, 0x6e, 0x61, - 0x6c, 0x73, 0x12, 0x2c, 0x0a, 0x0b, 0x6c, 0x31, 0x5f, 0x68, 0x61, 0x6e, 0x64, 0x6c, 0x65, 0x72, - 0x73, 0x18, 0x03, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x0b, 0x2e, 0x45, 0x6e, 0x74, 0x72, 0x79, 0x50, - 0x6f, 0x69, 0x6e, 0x74, 0x52, 0x0a, 0x6c, 0x31, 0x48, 0x61, 0x6e, 0x64, 0x6c, 0x65, 0x72, 0x73, - 0x12, 0x2f, 0x0a, 0x0c, 0x63, 0x6f, 0x6e, 0x73, 0x74, 0x72, 0x75, 0x63, 0x74, 0x6f, 0x72, 0x73, - 0x18, 0x04, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x0b, 0x2e, 0x45, 0x6e, 0x74, 0x72, 0x79, 0x50, 0x6f, - 0x69, 0x6e, 0x74, 0x52, 0x0c, 0x63, 0x6f, 0x6e, 0x73, 0x74, 0x72, 0x75, 0x63, 0x74, 0x6f, 0x72, - 0x73, 0x12, 0x18, 0x0a, 0x07, 0x70, 0x72, 0x6f, 0x67, 0x72, 0x61, 0x6d, 0x18, 0x05, 0x20, 0x01, - 0x28, 0x0c, 0x52, 0x07, 0x70, 0x72, 0x6f, 0x67, 0x72, 0x61, 0x6d, 0x22, 0x4e, 0x0a, 0x10, 0x53, - 0x69, 0x65, 0x72, 0x72, 0x61, 0x45, 0x6e, 0x74, 0x72, 0x79, 0x50, 0x6f, 0x69, 0x6e, 0x74, 0x12, - 0x14, 0x0a, 0x05, 0x69, 0x6e, 0x64, 0x65, 0x78, 0x18, 0x01, 0x20, 0x01, 0x28, 0x04, 0x52, 0x05, - 0x69, 0x6e, 0x64, 0x65, 0x78, 0x12, 0x24, 0x0a, 0x08, 0x73, 0x65, 0x6c, 0x65, 0x63, 0x74, 0x6f, - 0x72, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x08, 0x2e, 0x46, 0x65, 0x6c, 0x74, 0x32, 0x35, - 0x32, 0x52, 0x08, 0x73, 0x65, 0x6c, 0x65, 0x63, 0x74, 0x6f, 0x72, 0x22, 0xaf, 0x01, 0x0a, 0x11, - 0x43, 0x61, 0x69, 0x72, 0x6f, 0x31, 0x45, 0x6e, 0x74, 0x72, 0x79, 0x50, 0x6f, 0x69, 0x6e, 0x74, - 0x73, 0x12, 0x2f, 0x0a, 0x09, 0x65, 0x78, 0x74, 0x65, 0x72, 0x6e, 0x61, 0x6c, 0x73, 0x18, 0x01, - 0x20, 0x03, 0x28, 0x0b, 0x32, 0x11, 0x2e, 0x53, 0x69, 0x65, 0x72, 0x72, 0x61, 0x45, 0x6e, 0x74, - 0x72, 0x79, 0x50, 0x6f, 0x69, 0x6e, 0x74, 0x52, 0x09, 0x65, 0x78, 0x74, 0x65, 0x72, 0x6e, 0x61, - 0x6c, 0x73, 0x12, 0x32, 0x0a, 0x0b, 0x6c, 0x31, 0x5f, 0x68, 0x61, 0x6e, 0x64, 0x6c, 0x65, 0x72, - 0x73, 0x18, 0x02, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x11, 0x2e, 0x53, 0x69, 0x65, 0x72, 0x72, 0x61, + 0x74, 0x6f, 0x72, 0x12, 0x16, 0x0a, 0x06, 0x6f, 0x66, 0x66, 0x73, 0x65, 0x74, 0x18, 0x02, 0x20, + 0x01, 0x28, 0x04, 0x52, 0x06, 0x6f, 0x66, 0x66, 0x73, 0x65, 0x74, 0x22, 0xc3, 0x01, 0x0a, 0x0b, + 0x43, 0x61, 0x69, 0x72, 0x6f, 0x30, 0x43, 0x6c, 0x61, 0x73, 0x73, 0x12, 0x10, 0x0a, 0x03, 0x61, + 0x62, 0x69, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x03, 0x61, 0x62, 0x69, 0x12, 0x29, 0x0a, + 0x09, 0x65, 0x78, 0x74, 0x65, 0x72, 0x6e, 0x61, 0x6c, 0x73, 0x18, 0x02, 0x20, 0x03, 0x28, 0x0b, + 0x32, 0x0b, 0x2e, 0x45, 0x6e, 0x74, 0x72, 0x79, 0x50, 0x6f, 0x69, 0x6e, 0x74, 0x52, 0x09, 0x65, + 0x78, 0x74, 0x65, 0x72, 0x6e, 0x61, 0x6c, 0x73, 0x12, 0x2c, 0x0a, 0x0b, 0x6c, 0x31, 0x5f, 0x68, + 0x61, 0x6e, 0x64, 0x6c, 0x65, 0x72, 0x73, 0x18, 0x03, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x0b, 0x2e, 0x45, 0x6e, 0x74, 0x72, 0x79, 0x50, 0x6f, 0x69, 0x6e, 0x74, 0x52, 0x0a, 0x6c, 0x31, 0x48, 0x61, - 0x6e, 0x64, 0x6c, 0x65, 0x72, 0x73, 0x12, 0x35, 0x0a, 0x0c, 0x63, 0x6f, 0x6e, 0x73, 0x74, 0x72, - 0x75, 0x63, 0x74, 0x6f, 0x72, 0x73, 0x18, 0x03, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x11, 0x2e, 0x53, - 0x69, 0x65, 0x72, 0x72, 0x61, 0x45, 0x6e, 0x74, 0x72, 0x79, 0x50, 0x6f, 0x69, 0x6e, 0x74, 0x52, - 0x0c, 0x63, 0x6f, 0x6e, 0x73, 0x74, 0x72, 0x75, 0x63, 0x74, 0x6f, 0x72, 0x73, 0x22, 0xcc, 0x01, - 0x0a, 0x0b, 0x43, 0x61, 0x69, 0x72, 0x6f, 0x31, 0x43, 0x6c, 0x61, 0x73, 0x73, 0x12, 0x10, 0x0a, - 0x03, 0x61, 0x62, 0x69, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0c, 0x52, 0x03, 0x61, 0x62, 0x69, 0x12, - 0x35, 0x0a, 0x0c, 0x65, 0x6e, 0x74, 0x72, 0x79, 0x5f, 0x70, 0x6f, 0x69, 0x6e, 0x74, 0x73, 0x18, - 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x12, 0x2e, 0x43, 0x61, 0x69, 0x72, 0x6f, 0x31, 0x45, 0x6e, - 0x74, 0x72, 0x79, 0x50, 0x6f, 0x69, 0x6e, 0x74, 0x73, 0x52, 0x0b, 0x65, 0x6e, 0x74, 0x72, 0x79, - 0x50, 0x6f, 0x69, 0x6e, 0x74, 0x73, 0x12, 0x22, 0x0a, 0x07, 0x70, 0x72, 0x6f, 0x67, 0x72, 0x61, - 0x6d, 0x18, 0x03, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x08, 0x2e, 0x46, 0x65, 0x6c, 0x74, 0x32, 0x35, - 0x32, 0x52, 0x07, 0x70, 0x72, 0x6f, 0x67, 0x72, 0x61, 0x6d, 0x12, 0x34, 0x0a, 0x16, 0x63, 0x6f, - 0x6e, 0x74, 0x72, 0x61, 0x63, 0x74, 0x5f, 0x63, 0x6c, 0x61, 0x73, 0x73, 0x5f, 0x76, 0x65, 0x72, - 0x73, 0x69, 0x6f, 0x6e, 0x18, 0x04, 0x20, 0x01, 0x28, 0x09, 0x52, 0x14, 0x63, 0x6f, 0x6e, 0x74, - 0x72, 0x61, 0x63, 0x74, 0x43, 0x6c, 0x61, 0x73, 0x73, 0x56, 0x65, 0x72, 0x73, 0x69, 0x6f, 0x6e, - 0x12, 0x1a, 0x0a, 0x08, 0x63, 0x6f, 0x6d, 0x70, 0x69, 0x6c, 0x65, 0x64, 0x18, 0x05, 0x20, 0x01, - 0x28, 0x0c, 0x52, 0x08, 0x63, 0x6f, 0x6d, 0x70, 0x69, 0x6c, 0x65, 0x64, 0x22, 0x9e, 0x01, 0x0a, - 0x05, 0x43, 0x6c, 0x61, 0x73, 0x73, 0x12, 0x26, 0x0a, 0x06, 0x63, 0x61, 0x69, 0x72, 0x6f, 0x30, - 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x0c, 0x2e, 0x43, 0x61, 0x69, 0x72, 0x6f, 0x30, 0x43, - 0x6c, 0x61, 0x73, 0x73, 0x48, 0x00, 0x52, 0x06, 0x63, 0x61, 0x69, 0x72, 0x6f, 0x30, 0x12, 0x26, - 0x0a, 0x06, 0x63, 0x61, 0x69, 0x72, 0x6f, 0x31, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x0c, - 0x2e, 0x43, 0x61, 0x69, 0x72, 0x6f, 0x31, 0x43, 0x6c, 0x61, 0x73, 0x73, 0x48, 0x00, 0x52, 0x06, - 0x63, 0x61, 0x69, 0x72, 0x6f, 0x31, 0x12, 0x16, 0x0a, 0x06, 0x64, 0x6f, 0x6d, 0x61, 0x69, 0x6e, - 0x18, 0x03, 0x20, 0x01, 0x28, 0x0d, 0x52, 0x06, 0x64, 0x6f, 0x6d, 0x61, 0x69, 0x6e, 0x12, 0x24, - 0x0a, 0x0a, 0x63, 0x6c, 0x61, 0x73, 0x73, 0x5f, 0x68, 0x61, 0x73, 0x68, 0x18, 0x04, 0x20, 0x01, - 0x28, 0x0b, 0x32, 0x05, 0x2e, 0x48, 0x61, 0x73, 0x68, 0x52, 0x09, 0x63, 0x6c, 0x61, 0x73, 0x73, - 0x48, 0x61, 0x73, 0x68, 0x42, 0x07, 0x0a, 0x05, 0x63, 0x6c, 0x61, 0x73, 0x73, 0x22, 0x3a, 0x0a, - 0x0e, 0x43, 0x6c, 0x61, 0x73, 0x73, 0x65, 0x73, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, - 0x28, 0x0a, 0x09, 0x69, 0x74, 0x65, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x18, 0x01, 0x20, 0x01, - 0x28, 0x0b, 0x32, 0x0a, 0x2e, 0x49, 0x74, 0x65, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x52, 0x09, - 0x69, 0x74, 0x65, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x22, 0x5c, 0x0a, 0x0f, 0x43, 0x6c, 0x61, - 0x73, 0x73, 0x65, 0x73, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x1e, 0x0a, 0x05, - 0x63, 0x6c, 0x61, 0x73, 0x73, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x06, 0x2e, 0x43, 0x6c, - 0x61, 0x73, 0x73, 0x48, 0x00, 0x52, 0x05, 0x63, 0x6c, 0x61, 0x73, 0x73, 0x12, 0x18, 0x0a, 0x03, - 0x66, 0x69, 0x6e, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x04, 0x2e, 0x46, 0x69, 0x6e, 0x48, - 0x00, 0x52, 0x03, 0x66, 0x69, 0x6e, 0x42, 0x0f, 0x0a, 0x0d, 0x63, 0x6c, 0x61, 0x73, 0x73, 0x5f, - 0x6d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x42, 0x31, 0x5a, 0x2f, 0x67, 0x69, 0x74, 0x68, 0x75, - 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x4e, 0x65, 0x74, 0x68, 0x65, 0x72, 0x6d, 0x69, 0x6e, 0x64, - 0x45, 0x74, 0x68, 0x2f, 0x6a, 0x75, 0x6e, 0x6f, 0x2f, 0x70, 0x32, 0x70, 0x2f, 0x73, 0x74, 0x61, - 0x72, 0x6b, 0x6e, 0x65, 0x74, 0x2f, 0x73, 0x70, 0x65, 0x63, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, - 0x6f, 0x33, + 0x6e, 0x64, 0x6c, 0x65, 0x72, 0x73, 0x12, 0x2f, 0x0a, 0x0c, 0x63, 0x6f, 0x6e, 0x73, 0x74, 0x72, + 0x75, 0x63, 0x74, 0x6f, 0x72, 0x73, 0x18, 0x04, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x0b, 0x2e, 0x45, + 0x6e, 0x74, 0x72, 0x79, 0x50, 0x6f, 0x69, 0x6e, 0x74, 0x52, 0x0c, 0x63, 0x6f, 0x6e, 0x73, 0x74, + 0x72, 0x75, 0x63, 0x74, 0x6f, 0x72, 0x73, 0x12, 0x18, 0x0a, 0x07, 0x70, 0x72, 0x6f, 0x67, 0x72, + 0x61, 0x6d, 0x18, 0x05, 0x20, 0x01, 0x28, 0x09, 0x52, 0x07, 0x70, 0x72, 0x6f, 0x67, 0x72, 0x61, + 0x6d, 0x22, 0x4e, 0x0a, 0x10, 0x53, 0x69, 0x65, 0x72, 0x72, 0x61, 0x45, 0x6e, 0x74, 0x72, 0x79, + 0x50, 0x6f, 0x69, 0x6e, 0x74, 0x12, 0x14, 0x0a, 0x05, 0x69, 0x6e, 0x64, 0x65, 0x78, 0x18, 0x01, + 0x20, 0x01, 0x28, 0x04, 0x52, 0x05, 0x69, 0x6e, 0x64, 0x65, 0x78, 0x12, 0x24, 0x0a, 0x08, 0x73, + 0x65, 0x6c, 0x65, 0x63, 0x74, 0x6f, 0x72, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x08, 0x2e, + 0x46, 0x65, 0x6c, 0x74, 0x32, 0x35, 0x32, 0x52, 0x08, 0x73, 0x65, 0x6c, 0x65, 0x63, 0x74, 0x6f, + 0x72, 0x22, 0xaf, 0x01, 0x0a, 0x11, 0x43, 0x61, 0x69, 0x72, 0x6f, 0x31, 0x45, 0x6e, 0x74, 0x72, + 0x79, 0x50, 0x6f, 0x69, 0x6e, 0x74, 0x73, 0x12, 0x2f, 0x0a, 0x09, 0x65, 0x78, 0x74, 0x65, 0x72, + 0x6e, 0x61, 0x6c, 0x73, 0x18, 0x01, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x11, 0x2e, 0x53, 0x69, 0x65, + 0x72, 0x72, 0x61, 0x45, 0x6e, 0x74, 0x72, 0x79, 0x50, 0x6f, 0x69, 0x6e, 0x74, 0x52, 0x09, 0x65, + 0x78, 0x74, 0x65, 0x72, 0x6e, 0x61, 0x6c, 0x73, 0x12, 0x32, 0x0a, 0x0b, 0x6c, 0x31, 0x5f, 0x68, + 0x61, 0x6e, 0x64, 0x6c, 0x65, 0x72, 0x73, 0x18, 0x02, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x11, 0x2e, + 0x53, 0x69, 0x65, 0x72, 0x72, 0x61, 0x45, 0x6e, 0x74, 0x72, 0x79, 0x50, 0x6f, 0x69, 0x6e, 0x74, + 0x52, 0x0a, 0x6c, 0x31, 0x48, 0x61, 0x6e, 0x64, 0x6c, 0x65, 0x72, 0x73, 0x12, 0x35, 0x0a, 0x0c, + 0x63, 0x6f, 0x6e, 0x73, 0x74, 0x72, 0x75, 0x63, 0x74, 0x6f, 0x72, 0x73, 0x18, 0x03, 0x20, 0x03, + 0x28, 0x0b, 0x32, 0x11, 0x2e, 0x53, 0x69, 0x65, 0x72, 0x72, 0x61, 0x45, 0x6e, 0x74, 0x72, 0x79, + 0x50, 0x6f, 0x69, 0x6e, 0x74, 0x52, 0x0c, 0x63, 0x6f, 0x6e, 0x73, 0x74, 0x72, 0x75, 0x63, 0x74, + 0x6f, 0x72, 0x73, 0x22, 0xb0, 0x01, 0x0a, 0x0b, 0x43, 0x61, 0x69, 0x72, 0x6f, 0x31, 0x43, 0x6c, + 0x61, 0x73, 0x73, 0x12, 0x10, 0x0a, 0x03, 0x61, 0x62, 0x69, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, + 0x52, 0x03, 0x61, 0x62, 0x69, 0x12, 0x35, 0x0a, 0x0c, 0x65, 0x6e, 0x74, 0x72, 0x79, 0x5f, 0x70, + 0x6f, 0x69, 0x6e, 0x74, 0x73, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x12, 0x2e, 0x43, 0x61, + 0x69, 0x72, 0x6f, 0x31, 0x45, 0x6e, 0x74, 0x72, 0x79, 0x50, 0x6f, 0x69, 0x6e, 0x74, 0x73, 0x52, + 0x0b, 0x65, 0x6e, 0x74, 0x72, 0x79, 0x50, 0x6f, 0x69, 0x6e, 0x74, 0x73, 0x12, 0x22, 0x0a, 0x07, + 0x70, 0x72, 0x6f, 0x67, 0x72, 0x61, 0x6d, 0x18, 0x03, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x08, 0x2e, + 0x46, 0x65, 0x6c, 0x74, 0x32, 0x35, 0x32, 0x52, 0x07, 0x70, 0x72, 0x6f, 0x67, 0x72, 0x61, 0x6d, + 0x12, 0x34, 0x0a, 0x16, 0x63, 0x6f, 0x6e, 0x74, 0x72, 0x61, 0x63, 0x74, 0x5f, 0x63, 0x6c, 0x61, + 0x73, 0x73, 0x5f, 0x76, 0x65, 0x72, 0x73, 0x69, 0x6f, 0x6e, 0x18, 0x04, 0x20, 0x01, 0x28, 0x09, + 0x52, 0x14, 0x63, 0x6f, 0x6e, 0x74, 0x72, 0x61, 0x63, 0x74, 0x43, 0x6c, 0x61, 0x73, 0x73, 0x56, + 0x65, 0x72, 0x73, 0x69, 0x6f, 0x6e, 0x22, 0x78, 0x0a, 0x05, 0x43, 0x6c, 0x61, 0x73, 0x73, 0x12, + 0x26, 0x0a, 0x06, 0x63, 0x61, 0x69, 0x72, 0x6f, 0x30, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, + 0x0c, 0x2e, 0x43, 0x61, 0x69, 0x72, 0x6f, 0x30, 0x43, 0x6c, 0x61, 0x73, 0x73, 0x48, 0x00, 0x52, + 0x06, 0x63, 0x61, 0x69, 0x72, 0x6f, 0x30, 0x12, 0x26, 0x0a, 0x06, 0x63, 0x61, 0x69, 0x72, 0x6f, + 0x31, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x0c, 0x2e, 0x43, 0x61, 0x69, 0x72, 0x6f, 0x31, + 0x43, 0x6c, 0x61, 0x73, 0x73, 0x48, 0x00, 0x52, 0x06, 0x63, 0x61, 0x69, 0x72, 0x6f, 0x31, 0x12, + 0x16, 0x0a, 0x06, 0x64, 0x6f, 0x6d, 0x61, 0x69, 0x6e, 0x18, 0x03, 0x20, 0x01, 0x28, 0x0d, 0x52, + 0x06, 0x64, 0x6f, 0x6d, 0x61, 0x69, 0x6e, 0x42, 0x07, 0x0a, 0x05, 0x63, 0x6c, 0x61, 0x73, 0x73, + 0x22, 0x3a, 0x0a, 0x0e, 0x43, 0x6c, 0x61, 0x73, 0x73, 0x65, 0x73, 0x52, 0x65, 0x71, 0x75, 0x65, + 0x73, 0x74, 0x12, 0x28, 0x0a, 0x09, 0x69, 0x74, 0x65, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x18, + 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x0a, 0x2e, 0x49, 0x74, 0x65, 0x72, 0x61, 0x74, 0x69, 0x6f, + 0x6e, 0x52, 0x09, 0x69, 0x74, 0x65, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x22, 0x5c, 0x0a, 0x0f, + 0x43, 0x6c, 0x61, 0x73, 0x73, 0x65, 0x73, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, + 0x1e, 0x0a, 0x05, 0x63, 0x6c, 0x61, 0x73, 0x73, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x06, + 0x2e, 0x43, 0x6c, 0x61, 0x73, 0x73, 0x48, 0x00, 0x52, 0x05, 0x63, 0x6c, 0x61, 0x73, 0x73, 0x12, + 0x18, 0x0a, 0x03, 0x66, 0x69, 0x6e, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x04, 0x2e, 0x46, + 0x69, 0x6e, 0x48, 0x00, 0x52, 0x03, 0x66, 0x69, 0x6e, 0x42, 0x0f, 0x0a, 0x0d, 0x63, 0x6c, 0x61, + 0x73, 0x73, 0x5f, 0x6d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x42, 0x31, 0x5a, 0x2f, 0x67, 0x69, + 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x4e, 0x65, 0x74, 0x68, 0x65, 0x72, 0x6d, + 0x69, 0x6e, 0x64, 0x45, 0x74, 0x68, 0x2f, 0x6a, 0x75, 0x6e, 0x6f, 0x2f, 0x70, 0x32, 0x70, 0x2f, + 0x73, 0x74, 0x61, 0x72, 0x6b, 0x6e, 0x65, 0x74, 0x2f, 0x73, 0x70, 0x65, 0x63, 0x62, 0x06, 0x70, + 0x72, 0x6f, 0x74, 0x6f, 0x33, } var ( @@ -685,34 +661,31 @@ var ( (*ClassesRequest)(nil), // 6: ClassesRequest (*ClassesResponse)(nil), // 7: ClassesResponse (*Felt252)(nil), // 8: Felt252 - (*Hash)(nil), // 9: Hash - (*Iteration)(nil), // 10: Iteration - (*Fin)(nil), // 11: Fin + (*Iteration)(nil), // 9: Iteration + (*Fin)(nil), // 10: Fin } ) var file_p2p_proto_class_proto_depIdxs = []int32{ 8, // 0: EntryPoint.selector:type_name -> Felt252 - 8, // 1: EntryPoint.offset:type_name -> Felt252 - 0, // 2: Cairo0Class.externals:type_name -> EntryPoint - 0, // 3: Cairo0Class.l1_handlers:type_name -> EntryPoint - 0, // 4: Cairo0Class.constructors:type_name -> EntryPoint - 8, // 5: SierraEntryPoint.selector:type_name -> Felt252 - 2, // 6: Cairo1EntryPoints.externals:type_name -> SierraEntryPoint - 2, // 7: Cairo1EntryPoints.l1_handlers:type_name -> SierraEntryPoint - 2, // 8: Cairo1EntryPoints.constructors:type_name -> SierraEntryPoint - 3, // 9: Cairo1Class.entry_points:type_name -> Cairo1EntryPoints - 8, // 10: Cairo1Class.program:type_name -> Felt252 - 1, // 11: Class.cairo0:type_name -> Cairo0Class - 4, // 12: Class.cairo1:type_name -> Cairo1Class - 9, // 13: Class.class_hash:type_name -> Hash - 10, // 14: ClassesRequest.iteration:type_name -> Iteration - 5, // 15: ClassesResponse.class:type_name -> Class - 11, // 16: ClassesResponse.fin:type_name -> Fin - 17, // [17:17] is the sub-list for method output_type - 17, // [17:17] is the sub-list for method input_type - 17, // [17:17] is the sub-list for extension type_name - 17, // [17:17] is the sub-list for extension extendee - 0, // [0:17] is the sub-list for field type_name + 0, // 1: Cairo0Class.externals:type_name -> EntryPoint + 0, // 2: Cairo0Class.l1_handlers:type_name -> EntryPoint + 0, // 3: Cairo0Class.constructors:type_name -> EntryPoint + 8, // 4: SierraEntryPoint.selector:type_name -> Felt252 + 2, // 5: Cairo1EntryPoints.externals:type_name -> SierraEntryPoint + 2, // 6: Cairo1EntryPoints.l1_handlers:type_name -> SierraEntryPoint + 2, // 7: Cairo1EntryPoints.constructors:type_name -> SierraEntryPoint + 3, // 8: Cairo1Class.entry_points:type_name -> Cairo1EntryPoints + 8, // 9: Cairo1Class.program:type_name -> Felt252 + 1, // 10: Class.cairo0:type_name -> Cairo0Class + 4, // 11: Class.cairo1:type_name -> Cairo1Class + 9, // 12: ClassesRequest.iteration:type_name -> Iteration + 5, // 13: ClassesResponse.class:type_name -> Class + 10, // 14: ClassesResponse.fin:type_name -> Fin + 15, // [15:15] is the sub-list for method output_type + 15, // [15:15] is the sub-list for method input_type + 15, // [15:15] is the sub-list for extension type_name + 15, // [15:15] is the sub-list for extension extendee + 0, // [0:15] is the sub-list for field type_name } func init() { file_p2p_proto_class_proto_init() } diff --git a/p2p/starknet/spec/common.pb.go b/p2p/starknet/spec/common.pb.go index 72f4c74437..78be23ee1f 100644 --- a/p2p/starknet/spec/common.pb.go +++ b/p2p/starknet/spec/common.pb.go @@ -21,6 +21,98 @@ const ( _ = protoimpl.EnforceVersion(protoimpl.MaxVersion - 20) ) +type L1DataAvailabilityMode int32 + +const ( + L1DataAvailabilityMode_Calldata L1DataAvailabilityMode = 0 + L1DataAvailabilityMode_Blob L1DataAvailabilityMode = 1 +) + +// Enum value maps for L1DataAvailabilityMode. +var ( + L1DataAvailabilityMode_name = map[int32]string{ + 0: "Calldata", + 1: "Blob", + } + L1DataAvailabilityMode_value = map[string]int32{ + "Calldata": 0, + "Blob": 1, + } +) + +func (x L1DataAvailabilityMode) Enum() *L1DataAvailabilityMode { + p := new(L1DataAvailabilityMode) + *p = x + return p +} + +func (x L1DataAvailabilityMode) String() string { + return protoimpl.X.EnumStringOf(x.Descriptor(), protoreflect.EnumNumber(x)) +} + +func (L1DataAvailabilityMode) Descriptor() protoreflect.EnumDescriptor { + return file_p2p_proto_common_proto_enumTypes[0].Descriptor() +} + +func (L1DataAvailabilityMode) Type() protoreflect.EnumType { + return &file_p2p_proto_common_proto_enumTypes[0] +} + +func (x L1DataAvailabilityMode) Number() protoreflect.EnumNumber { + return protoreflect.EnumNumber(x) +} + +// Deprecated: Use L1DataAvailabilityMode.Descriptor instead. +func (L1DataAvailabilityMode) EnumDescriptor() ([]byte, []int) { + return file_p2p_proto_common_proto_rawDescGZIP(), []int{0} +} + +type VolitionDomain int32 + +const ( + VolitionDomain_L1 VolitionDomain = 0 + VolitionDomain_L2 VolitionDomain = 1 +) + +// Enum value maps for VolitionDomain. +var ( + VolitionDomain_name = map[int32]string{ + 0: "L1", + 1: "L2", + } + VolitionDomain_value = map[string]int32{ + "L1": 0, + "L2": 1, + } +) + +func (x VolitionDomain) Enum() *VolitionDomain { + p := new(VolitionDomain) + *p = x + return p +} + +func (x VolitionDomain) String() string { + return protoimpl.X.EnumStringOf(x.Descriptor(), protoreflect.EnumNumber(x)) +} + +func (VolitionDomain) Descriptor() protoreflect.EnumDescriptor { + return file_p2p_proto_common_proto_enumTypes[1].Descriptor() +} + +func (VolitionDomain) Type() protoreflect.EnumType { + return &file_p2p_proto_common_proto_enumTypes[1] +} + +func (x VolitionDomain) Number() protoreflect.EnumNumber { + return protoreflect.EnumNumber(x) +} + +// Deprecated: Use VolitionDomain.Descriptor instead. +func (VolitionDomain) EnumDescriptor() ([]byte, []int) { + return file_p2p_proto_common_proto_rawDescGZIP(), []int{1} +} + type Iteration_Direction int32 const ( @@ -51,11 +143,11 @@ func (x Iteration_Direction) String() string { } func (Iteration_Direction) Descriptor() protoreflect.EnumDescriptor { - return file_p2p_proto_common_proto_enumTypes[0].Descriptor() + return file_p2p_proto_common_proto_enumTypes[2].Descriptor() } func (Iteration_Direction) Type() protoreflect.EnumType { - return &file_p2p_proto_common_proto_enumTypes[0] + return &file_p2p_proto_common_proto_enumTypes[2] } func (x Iteration_Direction) Number() protoreflect.EnumNumber { @@ -64,7 +156,7 @@ func (x Iteration_Direction) Number() protoreflect.EnumNumber { // Deprecated: Use Iteration_Direction.Descriptor instead. func (Iteration_Direction) EnumDescriptor() ([]byte, []int) { - return file_p2p_proto_common_proto_rawDescGZIP(), []int{9, 0} + return file_p2p_proto_common_proto_rawDescGZIP(), []int{10, 0} } type Felt252 struct { @@ -302,6 +394,61 @@ func (x *PeerID) GetId() []byte { return nil } +type Uint128 struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Low uint64 `protobuf:"varint,1,opt,name=low,proto3" json:"low,omitempty"` + High uint64 `protobuf:"varint,2,opt,name=high,proto3" json:"high,omitempty"` +} + +func (x *Uint128) Reset() { + *x = Uint128{} + if protoimpl.UnsafeEnabled { + mi := &file_p2p_proto_common_proto_msgTypes[5] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *Uint128) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*Uint128) ProtoMessage() {} + +func (x *Uint128) ProtoReflect() protoreflect.Message { + mi := &file_p2p_proto_common_proto_msgTypes[5] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use Uint128.ProtoReflect.Descriptor instead. +func (*Uint128) Descriptor() ([]byte, []int) { + return file_p2p_proto_common_proto_rawDescGZIP(), []int{5} +} + +func (x *Uint128) GetLow() uint64 { + if x != nil { + return x.Low + } + return 0 +} + +func (x *Uint128) GetHigh() uint64 { + if x != nil { + return x.High + } + return 0 +} + type ConsensusSignature struct { state protoimpl.MessageState sizeCache protoimpl.SizeCache @@ -314,7 +461,7 @@ type ConsensusSignature struct { func (x *ConsensusSignature) Reset() { *x = ConsensusSignature{} if protoimpl.UnsafeEnabled { - mi := &file_p2p_proto_common_proto_msgTypes[5] + mi := &file_p2p_proto_common_proto_msgTypes[6] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -327,7 +474,7 @@ func (x *ConsensusSignature) String() string { func (*ConsensusSignature) ProtoMessage() {} func (x *ConsensusSignature) ProtoReflect() protoreflect.Message { - mi := &file_p2p_proto_common_proto_msgTypes[5] + mi := &file_p2p_proto_common_proto_msgTypes[6] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -340,7 +487,7 @@ func (x *ConsensusSignature) ProtoReflect() protoreflect.Message { // Deprecated: Use ConsensusSignature.ProtoReflect.Descriptor instead. func (*ConsensusSignature) Descriptor() ([]byte, []int) { - return file_p2p_proto_common_proto_rawDescGZIP(), []int{5} + return file_p2p_proto_common_proto_rawDescGZIP(), []int{6} } func (x *ConsensusSignature) GetR() *Felt252 { @@ -357,33 +504,33 @@ func (x *ConsensusSignature) GetS() *Felt252 { return nil } -type Merkle struct { +type Patricia struct { state protoimpl.MessageState sizeCache protoimpl.SizeCache unknownFields protoimpl.UnknownFields - NLeaves uint32 `protobuf:"varint,1,opt,name=n_leaves,json=nLeaves,proto3" json:"n_leaves,omitempty"` // needed to know the height, so as to how many nodes to expect in a proof. + NLeaves uint64 `protobuf:"varint,1,opt,name=n_leaves,json=nLeaves,proto3" json:"n_leaves,omitempty"` // needed to know the height, so as to how many nodes to expect in a proof. // and also when receiving all leaves, how many to expect Root *Hash `protobuf:"bytes,2,opt,name=root,proto3" json:"root,omitempty"` } -func (x *Merkle) Reset() { - *x = Merkle{} +func (x *Patricia) Reset() { + *x = Patricia{} if protoimpl.UnsafeEnabled { - mi := &file_p2p_proto_common_proto_msgTypes[6] + mi := &file_p2p_proto_common_proto_msgTypes[7] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } } -func (x *Merkle) String() string { +func (x *Patricia) String() string { return protoimpl.X.MessageStringOf(x) } -func (*Merkle) ProtoMessage() {} +func (*Patricia) ProtoMessage() {} -func (x *Merkle) ProtoReflect() protoreflect.Message { - mi := &file_p2p_proto_common_proto_msgTypes[6] +func (x *Patricia) ProtoReflect() protoreflect.Message { + mi := &file_p2p_proto_common_proto_msgTypes[7] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -394,51 +541,51 @@ func (x *Merkle) ProtoReflect() protoreflect.Message { return mi.MessageOf(x) } -// Deprecated: Use Merkle.ProtoReflect.Descriptor instead. -func (*Merkle) Descriptor() ([]byte, []int) { - return file_p2p_proto_common_proto_rawDescGZIP(), []int{6} +// Deprecated: Use Patricia.ProtoReflect.Descriptor instead. +func (*Patricia) Descriptor() ([]byte, []int) { + return file_p2p_proto_common_proto_rawDescGZIP(), []int{7} } -func (x *Merkle) GetNLeaves() uint32 { +func (x *Patricia) GetNLeaves() uint64 { if x != nil { return x.NLeaves } return 0 } -func (x *Merkle) GetRoot() *Hash { +func (x *Patricia) GetRoot() *Hash { if x != nil { return x.Root } return nil } -type Patricia struct { +type StateDiffCommitment struct { state protoimpl.MessageState sizeCache protoimpl.SizeCache unknownFields protoimpl.UnknownFields - Height uint32 `protobuf:"varint,1,opt,name=height,proto3" json:"height,omitempty"` - Root *Hash `protobuf:"bytes,2,opt,name=root,proto3" json:"root,omitempty"` + StateDiffLength uint64 `protobuf:"varint,1,opt,name=state_diff_length,json=stateDiffLength,proto3" json:"state_diff_length,omitempty"` + Root *Hash `protobuf:"bytes,2,opt,name=root,proto3" json:"root,omitempty"` } -func (x *Patricia) Reset() { - *x = Patricia{} +func (x *StateDiffCommitment) Reset() { + *x = StateDiffCommitment{} if protoimpl.UnsafeEnabled { - mi := &file_p2p_proto_common_proto_msgTypes[7] + mi := &file_p2p_proto_common_proto_msgTypes[8] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } } -func (x *Patricia) String() string { +func (x *StateDiffCommitment) String() string { return protoimpl.X.MessageStringOf(x) } -func (*Patricia) ProtoMessage() {} +func (*StateDiffCommitment) ProtoMessage() {} -func (x *Patricia) ProtoReflect() protoreflect.Message { - mi := &file_p2p_proto_common_proto_msgTypes[7] +func (x *StateDiffCommitment) ProtoReflect() protoreflect.Message { + mi := &file_p2p_proto_common_proto_msgTypes[8] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -449,19 +596,19 @@ func (x *Patricia) ProtoReflect() protoreflect.Message { return mi.MessageOf(x) } -// Deprecated: Use Patricia.ProtoReflect.Descriptor instead. -func (*Patricia) Descriptor() ([]byte, []int) { - return file_p2p_proto_common_proto_rawDescGZIP(), []int{7} +// Deprecated: Use StateDiffCommitment.ProtoReflect.Descriptor instead. +func (*StateDiffCommitment) Descriptor() ([]byte, []int) { + return file_p2p_proto_common_proto_rawDescGZIP(), []int{8} } -func (x *Patricia) GetHeight() uint32 { +func (x *StateDiffCommitment) GetStateDiffLength() uint64 { if x != nil { - return x.Height + return x.StateDiffLength } return 0 } -func (x *Patricia) GetRoot() *Hash { +func (x *StateDiffCommitment) GetRoot() *Hash { if x != nil { return x.Root } @@ -480,7 +627,7 @@ type BlockID struct { func (x *BlockID) Reset() { *x = BlockID{} if protoimpl.UnsafeEnabled { - mi := &file_p2p_proto_common_proto_msgTypes[8] + mi := &file_p2p_proto_common_proto_msgTypes[9] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -493,7 +640,7 @@ func (x *BlockID) String() string { func (*BlockID) ProtoMessage() {} func (x *BlockID) ProtoReflect() protoreflect.Message { - mi := &file_p2p_proto_common_proto_msgTypes[8] + mi := &file_p2p_proto_common_proto_msgTypes[9] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -506,7 +653,7 @@ func (x *BlockID) ProtoReflect() protoreflect.Message { // Deprecated: Use BlockID.ProtoReflect.Descriptor instead. func (*BlockID) Descriptor() ([]byte, []int) { - return file_p2p_proto_common_proto_rawDescGZIP(), []int{8} + return file_p2p_proto_common_proto_rawDescGZIP(), []int{9} } func (x *BlockID) GetNumber() uint64 { @@ -541,7 +688,7 @@ type Iteration struct { func (x *Iteration) Reset() { *x = Iteration{} if protoimpl.UnsafeEnabled { - mi := &file_p2p_proto_common_proto_msgTypes[9] + mi := &file_p2p_proto_common_proto_msgTypes[10] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -554,7 +701,7 @@ func (x *Iteration) String() string { func (*Iteration) ProtoMessage() {} func (x *Iteration) ProtoReflect() protoreflect.Message { - mi := &file_p2p_proto_common_proto_msgTypes[9] + mi := &file_p2p_proto_common_proto_msgTypes[10] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -567,7 +714,7 @@ func (x *Iteration) ProtoReflect() protoreflect.Message { // Deprecated: Use Iteration.ProtoReflect.Descriptor instead. func (*Iteration) Descriptor() ([]byte, []int) { - return file_p2p_proto_common_proto_rawDescGZIP(), []int{9} + return file_p2p_proto_common_proto_rawDescGZIP(), []int{10} } func (m *Iteration) GetStart() isIteration_Start { @@ -639,7 +786,7 @@ type Fin struct { func (x *Fin) Reset() { *x = Fin{} if protoimpl.UnsafeEnabled { - mi := &file_p2p_proto_common_proto_msgTypes[10] + mi := &file_p2p_proto_common_proto_msgTypes[11] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -652,7 +799,7 @@ func (x *Fin) String() string { func (*Fin) ProtoMessage() {} func (x *Fin) ProtoReflect() protoreflect.Message { - mi := &file_p2p_proto_common_proto_msgTypes[10] + mi := &file_p2p_proto_common_proto_msgTypes[11] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -665,7 +812,7 @@ func (x *Fin) ProtoReflect() protoreflect.Message { // Deprecated: Use Fin.ProtoReflect.Descriptor instead. func (*Fin) Descriptor() ([]byte, []int) { - return file_p2p_proto_common_proto_rawDescGZIP(), []int{10} + return file_p2p_proto_common_proto_rawDescGZIP(), []int{11} } var File_p2p_proto_common_proto protoreflect.FileDescriptor @@ -683,42 +830,52 @@ var file_p2p_proto_common_proto_rawDesc = []byte{ 0x64, 0x72, 0x65, 0x73, 0x73, 0x12, 0x1a, 0x0a, 0x08, 0x65, 0x6c, 0x65, 0x6d, 0x65, 0x6e, 0x74, 0x73, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0c, 0x52, 0x08, 0x65, 0x6c, 0x65, 0x6d, 0x65, 0x6e, 0x74, 0x73, 0x22, 0x18, 0x0a, 0x06, 0x50, 0x65, 0x65, 0x72, 0x49, 0x44, 0x12, 0x0e, 0x0a, 0x02, 0x69, - 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0c, 0x52, 0x02, 0x69, 0x64, 0x22, 0x44, 0x0a, 0x12, 0x43, - 0x6f, 0x6e, 0x73, 0x65, 0x6e, 0x73, 0x75, 0x73, 0x53, 0x69, 0x67, 0x6e, 0x61, 0x74, 0x75, 0x72, - 0x65, 0x12, 0x16, 0x0a, 0x01, 0x72, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x08, 0x2e, 0x46, - 0x65, 0x6c, 0x74, 0x32, 0x35, 0x32, 0x52, 0x01, 0x72, 0x12, 0x16, 0x0a, 0x01, 0x73, 0x18, 0x02, - 0x20, 0x01, 0x28, 0x0b, 0x32, 0x08, 0x2e, 0x46, 0x65, 0x6c, 0x74, 0x32, 0x35, 0x32, 0x52, 0x01, - 0x73, 0x22, 0x3e, 0x0a, 0x06, 0x4d, 0x65, 0x72, 0x6b, 0x6c, 0x65, 0x12, 0x19, 0x0a, 0x08, 0x6e, - 0x5f, 0x6c, 0x65, 0x61, 0x76, 0x65, 0x73, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0d, 0x52, 0x07, 0x6e, - 0x4c, 0x65, 0x61, 0x76, 0x65, 0x73, 0x12, 0x19, 0x0a, 0x04, 0x72, 0x6f, 0x6f, 0x74, 0x18, 0x02, - 0x20, 0x01, 0x28, 0x0b, 0x32, 0x05, 0x2e, 0x48, 0x61, 0x73, 0x68, 0x52, 0x04, 0x72, 0x6f, 0x6f, - 0x74, 0x22, 0x3d, 0x0a, 0x08, 0x50, 0x61, 0x74, 0x72, 0x69, 0x63, 0x69, 0x61, 0x12, 0x16, 0x0a, - 0x06, 0x68, 0x65, 0x69, 0x67, 0x68, 0x74, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0d, 0x52, 0x06, 0x68, - 0x65, 0x69, 0x67, 0x68, 0x74, 0x12, 0x19, 0x0a, 0x04, 0x72, 0x6f, 0x6f, 0x74, 0x18, 0x02, 0x20, - 0x01, 0x28, 0x0b, 0x32, 0x05, 0x2e, 0x48, 0x61, 0x73, 0x68, 0x52, 0x04, 0x72, 0x6f, 0x6f, 0x74, - 0x22, 0x40, 0x0a, 0x07, 0x42, 0x6c, 0x6f, 0x63, 0x6b, 0x49, 0x44, 0x12, 0x16, 0x0a, 0x06, 0x6e, - 0x75, 0x6d, 0x62, 0x65, 0x72, 0x18, 0x01, 0x20, 0x01, 0x28, 0x04, 0x52, 0x06, 0x6e, 0x75, 0x6d, - 0x62, 0x65, 0x72, 0x12, 0x1d, 0x0a, 0x06, 0x68, 0x65, 0x61, 0x64, 0x65, 0x72, 0x18, 0x02, 0x20, - 0x01, 0x28, 0x0b, 0x32, 0x05, 0x2e, 0x48, 0x61, 0x73, 0x68, 0x52, 0x06, 0x68, 0x65, 0x61, 0x64, - 0x65, 0x72, 0x22, 0xe0, 0x01, 0x0a, 0x09, 0x49, 0x74, 0x65, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, - 0x12, 0x23, 0x0a, 0x0c, 0x62, 0x6c, 0x6f, 0x63, 0x6b, 0x5f, 0x6e, 0x75, 0x6d, 0x62, 0x65, 0x72, - 0x18, 0x01, 0x20, 0x01, 0x28, 0x04, 0x48, 0x00, 0x52, 0x0b, 0x62, 0x6c, 0x6f, 0x63, 0x6b, 0x4e, - 0x75, 0x6d, 0x62, 0x65, 0x72, 0x12, 0x1f, 0x0a, 0x06, 0x68, 0x65, 0x61, 0x64, 0x65, 0x72, 0x18, - 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x05, 0x2e, 0x48, 0x61, 0x73, 0x68, 0x48, 0x00, 0x52, 0x06, - 0x68, 0x65, 0x61, 0x64, 0x65, 0x72, 0x12, 0x32, 0x0a, 0x09, 0x64, 0x69, 0x72, 0x65, 0x63, 0x74, - 0x69, 0x6f, 0x6e, 0x18, 0x03, 0x20, 0x01, 0x28, 0x0e, 0x32, 0x14, 0x2e, 0x49, 0x74, 0x65, 0x72, - 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x2e, 0x44, 0x69, 0x72, 0x65, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x52, - 0x09, 0x64, 0x69, 0x72, 0x65, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x12, 0x14, 0x0a, 0x05, 0x6c, 0x69, - 0x6d, 0x69, 0x74, 0x18, 0x04, 0x20, 0x01, 0x28, 0x04, 0x52, 0x05, 0x6c, 0x69, 0x6d, 0x69, 0x74, - 0x12, 0x12, 0x0a, 0x04, 0x73, 0x74, 0x65, 0x70, 0x18, 0x05, 0x20, 0x01, 0x28, 0x04, 0x52, 0x04, - 0x73, 0x74, 0x65, 0x70, 0x22, 0x26, 0x0a, 0x09, 0x44, 0x69, 0x72, 0x65, 0x63, 0x74, 0x69, 0x6f, - 0x6e, 0x12, 0x0b, 0x0a, 0x07, 0x46, 0x6f, 0x72, 0x77, 0x61, 0x72, 0x64, 0x10, 0x00, 0x12, 0x0c, - 0x0a, 0x08, 0x42, 0x61, 0x63, 0x6b, 0x77, 0x61, 0x72, 0x64, 0x10, 0x01, 0x42, 0x07, 0x0a, 0x05, - 0x73, 0x74, 0x61, 0x72, 0x74, 0x22, 0x05, 0x0a, 0x03, 0x46, 0x69, 0x6e, 0x42, 0x31, 0x5a, 0x2f, - 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x4e, 0x65, 0x74, 0x68, 0x65, - 0x72, 0x6d, 0x69, 0x6e, 0x64, 0x45, 0x74, 0x68, 0x2f, 0x6a, 0x75, 0x6e, 0x6f, 0x2f, 0x70, 0x32, - 0x70, 0x2f, 0x73, 0x74, 0x61, 0x72, 0x6b, 0x6e, 0x65, 0x74, 0x2f, 0x73, 0x70, 0x65, 0x63, 0x62, - 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, + 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0c, 0x52, 0x02, 0x69, 0x64, 0x22, 0x2f, 0x0a, 0x07, 0x55, + 0x69, 0x6e, 0x74, 0x31, 0x32, 0x38, 0x12, 0x10, 0x0a, 0x03, 0x6c, 0x6f, 0x77, 0x18, 0x01, 0x20, + 0x01, 0x28, 0x04, 0x52, 0x03, 0x6c, 0x6f, 0x77, 0x12, 0x12, 0x0a, 0x04, 0x68, 0x69, 0x67, 0x68, + 0x18, 0x02, 0x20, 0x01, 0x28, 0x04, 0x52, 0x04, 0x68, 0x69, 0x67, 0x68, 0x22, 0x44, 0x0a, 0x12, + 0x43, 0x6f, 0x6e, 0x73, 0x65, 0x6e, 0x73, 0x75, 0x73, 0x53, 0x69, 0x67, 0x6e, 0x61, 0x74, 0x75, + 0x72, 0x65, 0x12, 0x16, 0x0a, 0x01, 0x72, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x08, 0x2e, + 0x46, 0x65, 0x6c, 0x74, 0x32, 0x35, 0x32, 0x52, 0x01, 0x72, 0x12, 0x16, 0x0a, 0x01, 0x73, 0x18, + 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x08, 0x2e, 0x46, 0x65, 0x6c, 0x74, 0x32, 0x35, 0x32, 0x52, + 0x01, 0x73, 0x22, 0x40, 0x0a, 0x08, 0x50, 0x61, 0x74, 0x72, 0x69, 0x63, 0x69, 0x61, 0x12, 0x19, + 0x0a, 0x08, 0x6e, 0x5f, 0x6c, 0x65, 0x61, 0x76, 0x65, 0x73, 0x18, 0x01, 0x20, 0x01, 0x28, 0x04, + 0x52, 0x07, 0x6e, 0x4c, 0x65, 0x61, 0x76, 0x65, 0x73, 0x12, 0x19, 0x0a, 0x04, 0x72, 0x6f, 0x6f, + 0x74, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x05, 0x2e, 0x48, 0x61, 0x73, 0x68, 0x52, 0x04, + 0x72, 0x6f, 0x6f, 0x74, 0x22, 0x5c, 0x0a, 0x13, 0x53, 0x74, 0x61, 0x74, 0x65, 0x44, 0x69, 0x66, + 0x66, 0x43, 0x6f, 0x6d, 0x6d, 0x69, 0x74, 0x6d, 0x65, 0x6e, 0x74, 0x12, 0x2a, 0x0a, 0x11, 0x73, + 0x74, 0x61, 0x74, 0x65, 0x5f, 0x64, 0x69, 0x66, 0x66, 0x5f, 0x6c, 0x65, 0x6e, 0x67, 0x74, 0x68, + 0x18, 0x01, 0x20, 0x01, 0x28, 0x04, 0x52, 0x0f, 0x73, 0x74, 0x61, 0x74, 0x65, 0x44, 0x69, 0x66, + 0x66, 0x4c, 0x65, 0x6e, 0x67, 0x74, 0x68, 0x12, 0x19, 0x0a, 0x04, 0x72, 0x6f, 0x6f, 0x74, 0x18, + 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x05, 0x2e, 0x48, 0x61, 0x73, 0x68, 0x52, 0x04, 0x72, 0x6f, + 0x6f, 0x74, 0x22, 0x40, 0x0a, 0x07, 0x42, 0x6c, 0x6f, 0x63, 0x6b, 0x49, 0x44, 0x12, 0x16, 0x0a, + 0x06, 0x6e, 0x75, 0x6d, 0x62, 0x65, 0x72, 0x18, 0x01, 0x20, 0x01, 0x28, 0x04, 0x52, 0x06, 0x6e, + 0x75, 0x6d, 0x62, 0x65, 0x72, 0x12, 0x1d, 0x0a, 0x06, 0x68, 0x65, 0x61, 0x64, 0x65, 0x72, 0x18, + 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x05, 0x2e, 0x48, 0x61, 0x73, 0x68, 0x52, 0x06, 0x68, 0x65, + 0x61, 0x64, 0x65, 0x72, 0x22, 0xe0, 0x01, 0x0a, 0x09, 0x49, 0x74, 0x65, 0x72, 0x61, 0x74, 0x69, + 0x6f, 0x6e, 0x12, 0x23, 0x0a, 0x0c, 0x62, 0x6c, 0x6f, 0x63, 0x6b, 0x5f, 0x6e, 0x75, 0x6d, 0x62, + 0x65, 0x72, 0x18, 0x01, 0x20, 0x01, 0x28, 0x04, 0x48, 0x00, 0x52, 0x0b, 0x62, 0x6c, 0x6f, 0x63, + 0x6b, 0x4e, 0x75, 0x6d, 0x62, 0x65, 0x72, 0x12, 0x1f, 0x0a, 0x06, 0x68, 0x65, 0x61, 0x64, 0x65, + 0x72, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x05, 0x2e, 0x48, 0x61, 0x73, 0x68, 0x48, 0x00, + 0x52, 0x06, 0x68, 0x65, 0x61, 0x64, 0x65, 0x72, 0x12, 0x32, 0x0a, 0x09, 0x64, 0x69, 0x72, 0x65, + 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x18, 0x03, 0x20, 0x01, 0x28, 0x0e, 0x32, 0x14, 0x2e, 0x49, 0x74, + 0x65, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x2e, 0x44, 0x69, 0x72, 0x65, 0x63, 0x74, 0x69, 0x6f, + 0x6e, 0x52, 0x09, 0x64, 0x69, 0x72, 0x65, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x12, 0x14, 0x0a, 0x05, + 0x6c, 0x69, 0x6d, 0x69, 0x74, 0x18, 0x04, 0x20, 0x01, 0x28, 0x04, 0x52, 0x05, 0x6c, 0x69, 0x6d, + 0x69, 0x74, 0x12, 0x12, 0x0a, 0x04, 0x73, 0x74, 0x65, 0x70, 0x18, 0x05, 0x20, 0x01, 0x28, 0x04, + 0x52, 0x04, 0x73, 0x74, 0x65, 0x70, 0x22, 0x26, 0x0a, 0x09, 0x44, 0x69, 0x72, 0x65, 0x63, 0x74, + 0x69, 0x6f, 0x6e, 0x12, 0x0b, 0x0a, 0x07, 0x46, 0x6f, 0x72, 0x77, 0x61, 0x72, 0x64, 0x10, 0x00, + 0x12, 0x0c, 0x0a, 0x08, 0x42, 0x61, 0x63, 0x6b, 0x77, 0x61, 0x72, 0x64, 0x10, 0x01, 0x42, 0x07, + 0x0a, 0x05, 0x73, 0x74, 0x61, 0x72, 0x74, 0x22, 0x05, 0x0a, 0x03, 0x46, 0x69, 0x6e, 0x2a, 0x30, + 0x0a, 0x16, 0x4c, 0x31, 0x44, 0x61, 0x74, 0x61, 0x41, 0x76, 0x61, 0x69, 0x6c, 0x61, 0x62, 0x69, + 0x6c, 0x69, 0x74, 0x79, 0x4d, 0x6f, 0x64, 0x65, 0x12, 0x0c, 0x0a, 0x08, 0x43, 0x61, 0x6c, 0x6c, + 0x64, 0x61, 0x74, 0x61, 0x10, 0x00, 0x12, 0x08, 0x0a, 0x04, 0x42, 0x6c, 0x6f, 0x62, 0x10, 0x01, + 0x2a, 0x20, 0x0a, 0x0e, 0x56, 0x6f, 0x6c, 0x69, 0x74, 0x69, 0x6f, 0x6e, 0x44, 0x6f, 0x6d, 0x61, + 0x69, 0x6e, 0x12, 0x06, 0x0a, 0x02, 0x4c, 0x31, 0x10, 0x00, 0x12, 0x06, 0x0a, 0x02, 0x4c, 0x32, + 0x10, 0x01, 0x42, 0x31, 0x5a, 0x2f, 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d, + 0x2f, 0x4e, 0x65, 0x74, 0x68, 0x65, 0x72, 0x6d, 0x69, 0x6e, 0x64, 0x45, 0x74, 0x68, 0x2f, 0x6a, + 0x75, 0x6e, 0x6f, 0x2f, 0x70, 0x32, 0x70, 0x2f, 0x73, 0x74, 0x61, 0x72, 0x6b, 0x6e, 0x65, 0x74, + 0x2f, 0x73, 0x70, 0x65, 0x63, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, } var ( @@ -734,32 +891,35 @@ func file_p2p_proto_common_proto_rawDescGZIP() []byte { } var ( - file_p2p_proto_common_proto_enumTypes = make([]protoimpl.EnumInfo, 1) - file_p2p_proto_common_proto_msgTypes = make([]protoimpl.MessageInfo, 11) + file_p2p_proto_common_proto_enumTypes = make([]protoimpl.EnumInfo, 3) + file_p2p_proto_common_proto_msgTypes = make([]protoimpl.MessageInfo, 12) file_p2p_proto_common_proto_goTypes = []interface{}{ - (Iteration_Direction)(0), // 0: Iteration.Direction - (*Felt252)(nil), // 1: Felt252 - (*Hash)(nil), // 2: Hash - (*Hashes)(nil), // 3: Hashes - (*Address)(nil), // 4: Address - (*PeerID)(nil), // 5: PeerID - (*ConsensusSignature)(nil), // 6: ConsensusSignature - (*Merkle)(nil), // 7: Merkle - (*Patricia)(nil), // 8: Patricia - (*BlockID)(nil), // 9: BlockID - (*Iteration)(nil), // 10: Iteration - (*Fin)(nil), // 11: Fin + (L1DataAvailabilityMode)(0), // 0: L1DataAvailabilityMode + (VolitionDomain)(0), // 1: VolitionDomain + (Iteration_Direction)(0), // 2: Iteration.Direction + (*Felt252)(nil), // 3: Felt252 + (*Hash)(nil), // 4: Hash + (*Hashes)(nil), // 5: Hashes + (*Address)(nil), // 6: Address + (*PeerID)(nil), // 7: PeerID + (*Uint128)(nil), // 8: Uint128 + (*ConsensusSignature)(nil), // 9: ConsensusSignature + (*Patricia)(nil), // 10: Patricia + (*StateDiffCommitment)(nil), // 11: StateDiffCommitment + (*BlockID)(nil), // 12: BlockID + (*Iteration)(nil), // 13: Iteration + (*Fin)(nil), // 14: Fin } ) var file_p2p_proto_common_proto_depIdxs = []int32{ - 2, // 0: Hashes.items:type_name -> Hash - 1, // 1: ConsensusSignature.r:type_name -> Felt252 - 1, // 2: ConsensusSignature.s:type_name -> Felt252 - 2, // 3: Merkle.root:type_name -> Hash - 2, // 4: Patricia.root:type_name -> Hash - 2, // 5: BlockID.header:type_name -> Hash - 2, // 6: Iteration.header:type_name -> Hash - 0, // 7: Iteration.direction:type_name -> Iteration.Direction + 4, // 0: Hashes.items:type_name -> Hash + 3, // 1: ConsensusSignature.r:type_name -> Felt252 + 3, // 2: ConsensusSignature.s:type_name -> Felt252 + 4, // 3: Patricia.root:type_name -> Hash + 4, // 4: StateDiffCommitment.root:type_name -> Hash + 4, // 5: BlockID.header:type_name -> Hash + 4, // 6: Iteration.header:type_name -> Hash + 2, // 7: Iteration.direction:type_name -> Iteration.Direction 8, // [8:8] is the sub-list for method output_type 8, // [8:8] is the sub-list for method input_type 8, // [8:8] is the sub-list for extension type_name @@ -834,7 +994,7 @@ func file_p2p_proto_common_proto_init() { } } file_p2p_proto_common_proto_msgTypes[5].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*ConsensusSignature); i { + switch v := v.(*Uint128); i { case 0: return &v.state case 1: @@ -846,7 +1006,7 @@ func file_p2p_proto_common_proto_init() { } } file_p2p_proto_common_proto_msgTypes[6].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*Merkle); i { + switch v := v.(*ConsensusSignature); i { case 0: return &v.state case 1: @@ -870,7 +1030,7 @@ func file_p2p_proto_common_proto_init() { } } file_p2p_proto_common_proto_msgTypes[8].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*BlockID); i { + switch v := v.(*StateDiffCommitment); i { case 0: return &v.state case 1: @@ -882,7 +1042,7 @@ func file_p2p_proto_common_proto_init() { } } file_p2p_proto_common_proto_msgTypes[9].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*Iteration); i { + switch v := v.(*BlockID); i { case 0: return &v.state case 1: @@ -894,6 +1054,18 @@ func file_p2p_proto_common_proto_init() { } } file_p2p_proto_common_proto_msgTypes[10].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*Iteration); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_p2p_proto_common_proto_msgTypes[11].Exporter = func(v interface{}, i int) interface{} { switch v := v.(*Fin); i { case 0: return &v.state @@ -906,7 +1078,7 @@ func file_p2p_proto_common_proto_init() { } } } - file_p2p_proto_common_proto_msgTypes[9].OneofWrappers = []interface{}{ + file_p2p_proto_common_proto_msgTypes[10].OneofWrappers = []interface{}{ (*Iteration_BlockNumber)(nil), (*Iteration_Header)(nil), } @@ -915,8 +1087,8 @@ func file_p2p_proto_common_proto_init() { File: protoimpl.DescBuilder{ GoPackagePath: reflect.TypeOf(x{}).PkgPath(), RawDescriptor: file_p2p_proto_common_proto_rawDesc, - NumEnums: 1, - NumMessages: 11, + NumEnums: 3, + NumMessages: 12, NumExtensions: 0, NumServices: 0, }, diff --git a/p2p/starknet/spec/event.pb.go b/p2p/starknet/spec/event.pb.go index 14135b14e2..0475603f66 100644 --- a/p2p/starknet/spec/event.pb.go +++ b/p2p/starknet/spec/event.pb.go @@ -27,9 +27,9 @@ type Event struct { unknownFields protoimpl.UnknownFields TransactionHash *Hash `protobuf:"bytes,1,opt,name=transaction_hash,json=transactionHash,proto3" json:"transaction_hash,omitempty"` - FromAddress *Felt252 `protobuf:"bytes,2,opt,name=from_address,json=fromAddress,proto3" json:"from_address,omitempty"` - Keys []*Felt252 `protobuf:"bytes,3,rep,name=keys,proto3" json:"keys,omitempty"` - Data []*Felt252 `protobuf:"bytes,4,rep,name=data,proto3" json:"data,omitempty"` + FromAddress *Felt252 `protobuf:"bytes,3,opt,name=from_address,json=fromAddress,proto3" json:"from_address,omitempty"` // looks like mistake? + Keys []*Felt252 `protobuf:"bytes,4,rep,name=keys,proto3" json:"keys,omitempty"` + Data []*Felt252 `protobuf:"bytes,5,rep,name=data,proto3" json:"data,omitempty"` } func (x *Event) Reset() { @@ -231,11 +231,11 @@ var file_p2p_proto_event_proto_rawDesc = []byte{ 0x6e, 0x73, 0x61, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x5f, 0x68, 0x61, 0x73, 0x68, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x05, 0x2e, 0x48, 0x61, 0x73, 0x68, 0x52, 0x0f, 0x74, 0x72, 0x61, 0x6e, 0x73, 0x61, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x48, 0x61, 0x73, 0x68, 0x12, 0x2b, 0x0a, 0x0c, 0x66, - 0x72, 0x6f, 0x6d, 0x5f, 0x61, 0x64, 0x64, 0x72, 0x65, 0x73, 0x73, 0x18, 0x02, 0x20, 0x01, 0x28, + 0x72, 0x6f, 0x6d, 0x5f, 0x61, 0x64, 0x64, 0x72, 0x65, 0x73, 0x73, 0x18, 0x03, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x08, 0x2e, 0x46, 0x65, 0x6c, 0x74, 0x32, 0x35, 0x32, 0x52, 0x0b, 0x66, 0x72, 0x6f, 0x6d, 0x41, 0x64, 0x64, 0x72, 0x65, 0x73, 0x73, 0x12, 0x1c, 0x0a, 0x04, 0x6b, 0x65, 0x79, 0x73, - 0x18, 0x03, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x08, 0x2e, 0x46, 0x65, 0x6c, 0x74, 0x32, 0x35, 0x32, - 0x52, 0x04, 0x6b, 0x65, 0x79, 0x73, 0x12, 0x1c, 0x0a, 0x04, 0x64, 0x61, 0x74, 0x61, 0x18, 0x04, + 0x18, 0x04, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x08, 0x2e, 0x46, 0x65, 0x6c, 0x74, 0x32, 0x35, 0x32, + 0x52, 0x04, 0x6b, 0x65, 0x79, 0x73, 0x12, 0x1c, 0x0a, 0x04, 0x64, 0x61, 0x74, 0x61, 0x18, 0x05, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x08, 0x2e, 0x46, 0x65, 0x6c, 0x74, 0x32, 0x35, 0x32, 0x52, 0x04, 0x64, 0x61, 0x74, 0x61, 0x22, 0x39, 0x0a, 0x0d, 0x45, 0x76, 0x65, 0x6e, 0x74, 0x73, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x28, 0x0a, 0x09, 0x69, 0x74, 0x65, 0x72, 0x61, 0x74, 0x69, diff --git a/p2p/starknet/spec/header.pb.go b/p2p/starknet/spec/header.pb.go index ca7d1ec186..36ad83289e 100644 --- a/p2p/starknet/spec/header.pb.go +++ b/p2p/starknet/spec/header.pb.go @@ -28,24 +28,24 @@ type SignedBlockHeader struct { sizeCache protoimpl.SizeCache unknownFields protoimpl.UnknownFields - BlockHash *Hash `protobuf:"bytes,1,opt,name=block_hash,json=blockHash,proto3" json:"block_hash,omitempty"` // For the structure of the block hash, see https://docs.starknet.io/documentation/architecture_and_concepts/Network_Architecture/header/#block_hash - ParentHash *Hash `protobuf:"bytes,2,opt,name=parent_hash,json=parentHash,proto3" json:"parent_hash,omitempty"` - Number uint64 `protobuf:"varint,3,opt,name=number,proto3" json:"number,omitempty"` - Time uint64 `protobuf:"varint,4,opt,name=time,proto3" json:"time,omitempty"` // Encoded in Unix time. - SequencerAddress *Address `protobuf:"bytes,5,opt,name=sequencer_address,json=sequencerAddress,proto3" json:"sequencer_address,omitempty"` - StateDiffCommitment *Hash `protobuf:"bytes,6,opt,name=state_diff_commitment,json=stateDiffCommitment,proto3" json:"state_diff_commitment,omitempty"` // The state diff commitment returned by the Starknet Feeder Gateway. + BlockHash *Hash `protobuf:"bytes,1,opt,name=block_hash,json=blockHash,proto3" json:"block_hash,omitempty"` // For the structure of the block hash, see https://docs.starknet.io/documentation/architecture_and_concepts/Network_Architecture/header/#block_hash + ParentHash *Hash `protobuf:"bytes,2,opt,name=parent_hash,json=parentHash,proto3" json:"parent_hash,omitempty"` + Number uint64 `protobuf:"varint,3,opt,name=number,proto3" json:"number,omitempty"` // This can be deduced from context. We can consider removing this field. + Time uint64 `protobuf:"varint,4,opt,name=time,proto3" json:"time,omitempty"` // Encoded in Unix time. + SequencerAddress *Address `protobuf:"bytes,5,opt,name=sequencer_address,json=sequencerAddress,proto3" json:"sequencer_address,omitempty"` + StateRoot *Hash `protobuf:"bytes,6,opt,name=state_root,json=stateRoot,proto3" json:"state_root,omitempty"` // Patricia root of contract and class patricia tries. Each of those tries are of height 251. Same as in L1. Later more trees will be included + StateDiffCommitment *StateDiffCommitment `protobuf:"bytes,7,opt,name=state_diff_commitment,json=stateDiffCommitment,proto3" json:"state_diff_commitment,omitempty"` // The state diff commitment returned by the Starknet Feeder Gateway // For more info, see https://community.starknet.io/t/introducing-p2p-authentication-and-mismatch-resolution-in-v0-12-2/97993 - State *Patricia `protobuf:"bytes,7,opt,name=state,proto3" json:"state,omitempty"` // hash of contract and class patricia tries. Same as in L1. Later more trees will be included - // The following merkles can be built on the fly while sequencing/validating txs. - Transactions *Merkle `protobuf:"bytes,8,opt,name=transactions,proto3" json:"transactions,omitempty"` // By order of execution. TBD: required? the client can execute (powerful machine) and match state diff - Events *Merkle `protobuf:"bytes,9,opt,name=events,proto3" json:"events,omitempty"` // By order of issuance. TBD: in receipts? - Receipts *Merkle `protobuf:"bytes,10,opt,name=receipts,proto3" json:"receipts,omitempty"` // By order of issuance. - ProtocolVersion string `protobuf:"bytes,11,opt,name=protocol_version,json=protocolVersion,proto3" json:"protocol_version,omitempty"` // Starknet version - GasPrice *Felt252 `protobuf:"bytes,12,opt,name=gas_price,json=gasPrice,proto3" json:"gas_price,omitempty"` - NumStorageDiffs uint64 `protobuf:"varint,13,opt,name=num_storage_diffs,json=numStorageDiffs,proto3" json:"num_storage_diffs,omitempty"` - NumNonceUpdates uint64 `protobuf:"varint,14,opt,name=num_nonce_updates,json=numNonceUpdates,proto3" json:"num_nonce_updates,omitempty"` - NumDeclaredClasses uint64 `protobuf:"varint,15,opt,name=num_declared_classes,json=numDeclaredClasses,proto3" json:"num_declared_classes,omitempty"` // Includes both Cairo 0 and Cairo 1. - NumDeployedContracts uint64 `protobuf:"varint,16,opt,name=num_deployed_contracts,json=numDeployedContracts,proto3" json:"num_deployed_contracts,omitempty"` // This includes the replaced classes too. + // The leaves contain a hash of the transaction hash and transaction signature. + Transactions *Patricia `protobuf:"bytes,8,opt,name=transactions,proto3" json:"transactions,omitempty"` // By order of execution. TBD: required? the client can execute (powerful machine) and match state diff + Events *Patricia `protobuf:"bytes,9,opt,name=events,proto3" json:"events,omitempty"` // By order of issuance. TBD: in receipts? + Receipts *Hash `protobuf:"bytes,10,opt,name=receipts,proto3" json:"receipts,omitempty"` // By order of issuance. This is a patricia root. No need for length because it's the same length as transactions. + ProtocolVersion string `protobuf:"bytes,11,opt,name=protocol_version,json=protocolVersion,proto3" json:"protocol_version,omitempty"` // Starknet version + GasPriceFri *Uint128 `protobuf:"bytes,12,opt,name=gas_price_fri,json=gasPriceFri,proto3" json:"gas_price_fri,omitempty"` + GasPriceWei *Uint128 `protobuf:"bytes,13,opt,name=gas_price_wei,json=gasPriceWei,proto3" json:"gas_price_wei,omitempty"` + DataGasPriceFri *Uint128 `protobuf:"bytes,14,opt,name=data_gas_price_fri,json=dataGasPriceFri,proto3" json:"data_gas_price_fri,omitempty"` + DataGasPriceWei *Uint128 `protobuf:"bytes,15,opt,name=data_gas_price_wei,json=dataGasPriceWei,proto3" json:"data_gas_price_wei,omitempty"` + L1DataAvailabilityMode L1DataAvailabilityMode `protobuf:"varint,16,opt,name=l1_data_availability_mode,json=l1DataAvailabilityMode,proto3,enum=L1DataAvailabilityMode" json:"l1_data_availability_mode,omitempty"` // for now, we assume a small consensus, so this fits in 1M. Else, these will be repeated and extracted from this message. Signatures []*ConsensusSignature `protobuf:"bytes,17,rep,name=signatures,proto3" json:"signatures,omitempty"` // can be more explicit here about the signature structure as this is not part of account abstraction } @@ -117,35 +117,35 @@ func (x *SignedBlockHeader) GetSequencerAddress() *Address { return nil } -func (x *SignedBlockHeader) GetStateDiffCommitment() *Hash { +func (x *SignedBlockHeader) GetStateRoot() *Hash { if x != nil { - return x.StateDiffCommitment + return x.StateRoot } return nil } -func (x *SignedBlockHeader) GetState() *Patricia { +func (x *SignedBlockHeader) GetStateDiffCommitment() *StateDiffCommitment { if x != nil { - return x.State + return x.StateDiffCommitment } return nil } -func (x *SignedBlockHeader) GetTransactions() *Merkle { +func (x *SignedBlockHeader) GetTransactions() *Patricia { if x != nil { return x.Transactions } return nil } -func (x *SignedBlockHeader) GetEvents() *Merkle { +func (x *SignedBlockHeader) GetEvents() *Patricia { if x != nil { return x.Events } return nil } -func (x *SignedBlockHeader) GetReceipts() *Merkle { +func (x *SignedBlockHeader) GetReceipts() *Hash { if x != nil { return x.Receipts } @@ -159,39 +159,39 @@ func (x *SignedBlockHeader) GetProtocolVersion() string { return "" } -func (x *SignedBlockHeader) GetGasPrice() *Felt252 { +func (x *SignedBlockHeader) GetGasPriceFri() *Uint128 { if x != nil { - return x.GasPrice + return x.GasPriceFri } return nil } -func (x *SignedBlockHeader) GetNumStorageDiffs() uint64 { +func (x *SignedBlockHeader) GetGasPriceWei() *Uint128 { if x != nil { - return x.NumStorageDiffs + return x.GasPriceWei } - return 0 + return nil } -func (x *SignedBlockHeader) GetNumNonceUpdates() uint64 { +func (x *SignedBlockHeader) GetDataGasPriceFri() *Uint128 { if x != nil { - return x.NumNonceUpdates + return x.DataGasPriceFri } - return 0 + return nil } -func (x *SignedBlockHeader) GetNumDeclaredClasses() uint64 { +func (x *SignedBlockHeader) GetDataGasPriceWei() *Uint128 { if x != nil { - return x.NumDeclaredClasses + return x.DataGasPriceWei } - return 0 + return nil } -func (x *SignedBlockHeader) GetNumDeployedContracts() uint64 { +func (x *SignedBlockHeader) GetL1DataAvailabilityMode() L1DataAvailabilityMode { if x != nil { - return x.NumDeployedContracts + return x.L1DataAvailabilityMode } - return 0 + return L1DataAvailabilityMode_Calldata } func (x *SignedBlockHeader) GetSignatures() []*ConsensusSignature { @@ -413,13 +413,60 @@ func (*BlockHeadersResponse_Header) isBlockHeadersResponse_HeaderMessage() {} func (*BlockHeadersResponse_Fin) isBlockHeadersResponse_HeaderMessage() {} +type BlockProof struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Proof [][]byte `protobuf:"bytes,1,rep,name=proof,proto3" json:"proof,omitempty"` +} + +func (x *BlockProof) Reset() { + *x = BlockProof{} + if protoimpl.UnsafeEnabled { + mi := &file_p2p_proto_header_proto_msgTypes[4] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *BlockProof) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*BlockProof) ProtoMessage() {} + +func (x *BlockProof) ProtoReflect() protoreflect.Message { + mi := &file_p2p_proto_header_proto_msgTypes[4] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use BlockProof.ProtoReflect.Descriptor instead. +func (*BlockProof) Descriptor() ([]byte, []int) { + return file_p2p_proto_header_proto_rawDescGZIP(), []int{4} +} + +func (x *BlockProof) GetProof() [][]byte { + if x != nil { + return x.Proof + } + return nil +} + var File_p2p_proto_header_proto protoreflect.FileDescriptor var file_p2p_proto_header_proto_rawDesc = []byte{ 0x0a, 0x16, 0x70, 0x32, 0x70, 0x2f, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2f, 0x68, 0x65, 0x61, 0x64, 0x65, 0x72, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x1a, 0x16, 0x70, 0x32, 0x70, 0x2f, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2f, 0x63, 0x6f, 0x6d, 0x6d, 0x6f, 0x6e, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, - 0x22, 0xda, 0x05, 0x0a, 0x11, 0x53, 0x69, 0x67, 0x6e, 0x65, 0x64, 0x42, 0x6c, 0x6f, 0x63, 0x6b, + 0x22, 0xa7, 0x06, 0x0a, 0x11, 0x53, 0x69, 0x67, 0x6e, 0x65, 0x64, 0x42, 0x6c, 0x6f, 0x63, 0x6b, 0x48, 0x65, 0x61, 0x64, 0x65, 0x72, 0x12, 0x24, 0x0a, 0x0a, 0x62, 0x6c, 0x6f, 0x63, 0x6b, 0x5f, 0x68, 0x61, 0x73, 0x68, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x05, 0x2e, 0x48, 0x61, 0x73, 0x68, 0x52, 0x09, 0x62, 0x6c, 0x6f, 0x63, 0x6b, 0x48, 0x61, 0x73, 0x68, 0x12, 0x26, 0x0a, 0x0b, @@ -431,62 +478,69 @@ var file_p2p_proto_header_proto_rawDesc = []byte{ 0x12, 0x35, 0x0a, 0x11, 0x73, 0x65, 0x71, 0x75, 0x65, 0x6e, 0x63, 0x65, 0x72, 0x5f, 0x61, 0x64, 0x64, 0x72, 0x65, 0x73, 0x73, 0x18, 0x05, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x08, 0x2e, 0x41, 0x64, 0x64, 0x72, 0x65, 0x73, 0x73, 0x52, 0x10, 0x73, 0x65, 0x71, 0x75, 0x65, 0x6e, 0x63, 0x65, 0x72, - 0x41, 0x64, 0x64, 0x72, 0x65, 0x73, 0x73, 0x12, 0x39, 0x0a, 0x15, 0x73, 0x74, 0x61, 0x74, 0x65, - 0x5f, 0x64, 0x69, 0x66, 0x66, 0x5f, 0x63, 0x6f, 0x6d, 0x6d, 0x69, 0x74, 0x6d, 0x65, 0x6e, 0x74, - 0x18, 0x06, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x05, 0x2e, 0x48, 0x61, 0x73, 0x68, 0x52, 0x13, 0x73, + 0x41, 0x64, 0x64, 0x72, 0x65, 0x73, 0x73, 0x12, 0x24, 0x0a, 0x0a, 0x73, 0x74, 0x61, 0x74, 0x65, + 0x5f, 0x72, 0x6f, 0x6f, 0x74, 0x18, 0x06, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x05, 0x2e, 0x48, 0x61, + 0x73, 0x68, 0x52, 0x09, 0x73, 0x74, 0x61, 0x74, 0x65, 0x52, 0x6f, 0x6f, 0x74, 0x12, 0x48, 0x0a, + 0x15, 0x73, 0x74, 0x61, 0x74, 0x65, 0x5f, 0x64, 0x69, 0x66, 0x66, 0x5f, 0x63, 0x6f, 0x6d, 0x6d, + 0x69, 0x74, 0x6d, 0x65, 0x6e, 0x74, 0x18, 0x07, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x14, 0x2e, 0x53, 0x74, 0x61, 0x74, 0x65, 0x44, 0x69, 0x66, 0x66, 0x43, 0x6f, 0x6d, 0x6d, 0x69, 0x74, 0x6d, 0x65, - 0x6e, 0x74, 0x12, 0x1f, 0x0a, 0x05, 0x73, 0x74, 0x61, 0x74, 0x65, 0x18, 0x07, 0x20, 0x01, 0x28, - 0x0b, 0x32, 0x09, 0x2e, 0x50, 0x61, 0x74, 0x72, 0x69, 0x63, 0x69, 0x61, 0x52, 0x05, 0x73, 0x74, - 0x61, 0x74, 0x65, 0x12, 0x2b, 0x0a, 0x0c, 0x74, 0x72, 0x61, 0x6e, 0x73, 0x61, 0x63, 0x74, 0x69, - 0x6f, 0x6e, 0x73, 0x18, 0x08, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x07, 0x2e, 0x4d, 0x65, 0x72, 0x6b, - 0x6c, 0x65, 0x52, 0x0c, 0x74, 0x72, 0x61, 0x6e, 0x73, 0x61, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x73, - 0x12, 0x1f, 0x0a, 0x06, 0x65, 0x76, 0x65, 0x6e, 0x74, 0x73, 0x18, 0x09, 0x20, 0x01, 0x28, 0x0b, - 0x32, 0x07, 0x2e, 0x4d, 0x65, 0x72, 0x6b, 0x6c, 0x65, 0x52, 0x06, 0x65, 0x76, 0x65, 0x6e, 0x74, - 0x73, 0x12, 0x23, 0x0a, 0x08, 0x72, 0x65, 0x63, 0x65, 0x69, 0x70, 0x74, 0x73, 0x18, 0x0a, 0x20, - 0x01, 0x28, 0x0b, 0x32, 0x07, 0x2e, 0x4d, 0x65, 0x72, 0x6b, 0x6c, 0x65, 0x52, 0x08, 0x72, 0x65, - 0x63, 0x65, 0x69, 0x70, 0x74, 0x73, 0x12, 0x29, 0x0a, 0x10, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x63, - 0x6f, 0x6c, 0x5f, 0x76, 0x65, 0x72, 0x73, 0x69, 0x6f, 0x6e, 0x18, 0x0b, 0x20, 0x01, 0x28, 0x09, - 0x52, 0x0f, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x63, 0x6f, 0x6c, 0x56, 0x65, 0x72, 0x73, 0x69, 0x6f, - 0x6e, 0x12, 0x25, 0x0a, 0x09, 0x67, 0x61, 0x73, 0x5f, 0x70, 0x72, 0x69, 0x63, 0x65, 0x18, 0x0c, - 0x20, 0x01, 0x28, 0x0b, 0x32, 0x08, 0x2e, 0x46, 0x65, 0x6c, 0x74, 0x32, 0x35, 0x32, 0x52, 0x08, - 0x67, 0x61, 0x73, 0x50, 0x72, 0x69, 0x63, 0x65, 0x12, 0x2a, 0x0a, 0x11, 0x6e, 0x75, 0x6d, 0x5f, - 0x73, 0x74, 0x6f, 0x72, 0x61, 0x67, 0x65, 0x5f, 0x64, 0x69, 0x66, 0x66, 0x73, 0x18, 0x0d, 0x20, - 0x01, 0x28, 0x04, 0x52, 0x0f, 0x6e, 0x75, 0x6d, 0x53, 0x74, 0x6f, 0x72, 0x61, 0x67, 0x65, 0x44, - 0x69, 0x66, 0x66, 0x73, 0x12, 0x2a, 0x0a, 0x11, 0x6e, 0x75, 0x6d, 0x5f, 0x6e, 0x6f, 0x6e, 0x63, - 0x65, 0x5f, 0x75, 0x70, 0x64, 0x61, 0x74, 0x65, 0x73, 0x18, 0x0e, 0x20, 0x01, 0x28, 0x04, 0x52, - 0x0f, 0x6e, 0x75, 0x6d, 0x4e, 0x6f, 0x6e, 0x63, 0x65, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x73, - 0x12, 0x30, 0x0a, 0x14, 0x6e, 0x75, 0x6d, 0x5f, 0x64, 0x65, 0x63, 0x6c, 0x61, 0x72, 0x65, 0x64, - 0x5f, 0x63, 0x6c, 0x61, 0x73, 0x73, 0x65, 0x73, 0x18, 0x0f, 0x20, 0x01, 0x28, 0x04, 0x52, 0x12, - 0x6e, 0x75, 0x6d, 0x44, 0x65, 0x63, 0x6c, 0x61, 0x72, 0x65, 0x64, 0x43, 0x6c, 0x61, 0x73, 0x73, - 0x65, 0x73, 0x12, 0x34, 0x0a, 0x16, 0x6e, 0x75, 0x6d, 0x5f, 0x64, 0x65, 0x70, 0x6c, 0x6f, 0x79, - 0x65, 0x64, 0x5f, 0x63, 0x6f, 0x6e, 0x74, 0x72, 0x61, 0x63, 0x74, 0x73, 0x18, 0x10, 0x20, 0x01, - 0x28, 0x04, 0x52, 0x14, 0x6e, 0x75, 0x6d, 0x44, 0x65, 0x70, 0x6c, 0x6f, 0x79, 0x65, 0x64, 0x43, - 0x6f, 0x6e, 0x74, 0x72, 0x61, 0x63, 0x74, 0x73, 0x12, 0x33, 0x0a, 0x0a, 0x73, 0x69, 0x67, 0x6e, - 0x61, 0x74, 0x75, 0x72, 0x65, 0x73, 0x18, 0x11, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x13, 0x2e, 0x43, - 0x6f, 0x6e, 0x73, 0x65, 0x6e, 0x73, 0x75, 0x73, 0x53, 0x69, 0x67, 0x6e, 0x61, 0x74, 0x75, 0x72, - 0x65, 0x52, 0x0a, 0x73, 0x69, 0x67, 0x6e, 0x61, 0x74, 0x75, 0x72, 0x65, 0x73, 0x22, 0x65, 0x0a, - 0x08, 0x4e, 0x65, 0x77, 0x42, 0x6c, 0x6f, 0x63, 0x6b, 0x12, 0x1a, 0x0a, 0x02, 0x69, 0x64, 0x18, - 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x08, 0x2e, 0x42, 0x6c, 0x6f, 0x63, 0x6b, 0x49, 0x44, 0x48, - 0x00, 0x52, 0x02, 0x69, 0x64, 0x12, 0x2f, 0x0a, 0x06, 0x68, 0x65, 0x61, 0x64, 0x65, 0x72, 0x18, - 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x15, 0x2e, 0x42, 0x6c, 0x6f, 0x63, 0x6b, 0x48, 0x65, 0x61, - 0x64, 0x65, 0x72, 0x73, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x48, 0x00, 0x52, 0x06, - 0x68, 0x65, 0x61, 0x64, 0x65, 0x72, 0x42, 0x0c, 0x0a, 0x0a, 0x6d, 0x61, 0x79, 0x62, 0x65, 0x5f, - 0x66, 0x75, 0x6c, 0x6c, 0x22, 0x3f, 0x0a, 0x13, 0x42, 0x6c, 0x6f, 0x63, 0x6b, 0x48, 0x65, 0x61, - 0x64, 0x65, 0x72, 0x73, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x28, 0x0a, 0x09, 0x69, - 0x74, 0x65, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x0a, - 0x2e, 0x49, 0x74, 0x65, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x52, 0x09, 0x69, 0x74, 0x65, 0x72, - 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x22, 0x70, 0x0a, 0x14, 0x42, 0x6c, 0x6f, 0x63, 0x6b, 0x48, 0x65, - 0x61, 0x64, 0x65, 0x72, 0x73, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x2c, 0x0a, - 0x06, 0x68, 0x65, 0x61, 0x64, 0x65, 0x72, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x12, 0x2e, - 0x53, 0x69, 0x67, 0x6e, 0x65, 0x64, 0x42, 0x6c, 0x6f, 0x63, 0x6b, 0x48, 0x65, 0x61, 0x64, 0x65, - 0x72, 0x48, 0x00, 0x52, 0x06, 0x68, 0x65, 0x61, 0x64, 0x65, 0x72, 0x12, 0x18, 0x0a, 0x03, 0x66, - 0x69, 0x6e, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x04, 0x2e, 0x46, 0x69, 0x6e, 0x48, 0x00, - 0x52, 0x03, 0x66, 0x69, 0x6e, 0x42, 0x10, 0x0a, 0x0e, 0x68, 0x65, 0x61, 0x64, 0x65, 0x72, 0x5f, - 0x6d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x42, 0x31, 0x5a, 0x2f, 0x67, 0x69, 0x74, 0x68, 0x75, - 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x4e, 0x65, 0x74, 0x68, 0x65, 0x72, 0x6d, 0x69, 0x6e, 0x64, - 0x45, 0x74, 0x68, 0x2f, 0x6a, 0x75, 0x6e, 0x6f, 0x2f, 0x70, 0x32, 0x70, 0x2f, 0x73, 0x74, 0x61, - 0x72, 0x6b, 0x6e, 0x65, 0x74, 0x2f, 0x73, 0x70, 0x65, 0x63, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, - 0x6f, 0x33, + 0x6e, 0x74, 0x52, 0x13, 0x73, 0x74, 0x61, 0x74, 0x65, 0x44, 0x69, 0x66, 0x66, 0x43, 0x6f, 0x6d, + 0x6d, 0x69, 0x74, 0x6d, 0x65, 0x6e, 0x74, 0x12, 0x2d, 0x0a, 0x0c, 0x74, 0x72, 0x61, 0x6e, 0x73, + 0x61, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x18, 0x08, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x09, 0x2e, + 0x50, 0x61, 0x74, 0x72, 0x69, 0x63, 0x69, 0x61, 0x52, 0x0c, 0x74, 0x72, 0x61, 0x6e, 0x73, 0x61, + 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x12, 0x21, 0x0a, 0x06, 0x65, 0x76, 0x65, 0x6e, 0x74, 0x73, + 0x18, 0x09, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x09, 0x2e, 0x50, 0x61, 0x74, 0x72, 0x69, 0x63, 0x69, + 0x61, 0x52, 0x06, 0x65, 0x76, 0x65, 0x6e, 0x74, 0x73, 0x12, 0x21, 0x0a, 0x08, 0x72, 0x65, 0x63, + 0x65, 0x69, 0x70, 0x74, 0x73, 0x18, 0x0a, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x05, 0x2e, 0x48, 0x61, + 0x73, 0x68, 0x52, 0x08, 0x72, 0x65, 0x63, 0x65, 0x69, 0x70, 0x74, 0x73, 0x12, 0x29, 0x0a, 0x10, + 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x63, 0x6f, 0x6c, 0x5f, 0x76, 0x65, 0x72, 0x73, 0x69, 0x6f, 0x6e, + 0x18, 0x0b, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0f, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x63, 0x6f, 0x6c, + 0x56, 0x65, 0x72, 0x73, 0x69, 0x6f, 0x6e, 0x12, 0x2c, 0x0a, 0x0d, 0x67, 0x61, 0x73, 0x5f, 0x70, + 0x72, 0x69, 0x63, 0x65, 0x5f, 0x66, 0x72, 0x69, 0x18, 0x0c, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x08, + 0x2e, 0x55, 0x69, 0x6e, 0x74, 0x31, 0x32, 0x38, 0x52, 0x0b, 0x67, 0x61, 0x73, 0x50, 0x72, 0x69, + 0x63, 0x65, 0x46, 0x72, 0x69, 0x12, 0x2c, 0x0a, 0x0d, 0x67, 0x61, 0x73, 0x5f, 0x70, 0x72, 0x69, + 0x63, 0x65, 0x5f, 0x77, 0x65, 0x69, 0x18, 0x0d, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x08, 0x2e, 0x55, + 0x69, 0x6e, 0x74, 0x31, 0x32, 0x38, 0x52, 0x0b, 0x67, 0x61, 0x73, 0x50, 0x72, 0x69, 0x63, 0x65, + 0x57, 0x65, 0x69, 0x12, 0x35, 0x0a, 0x12, 0x64, 0x61, 0x74, 0x61, 0x5f, 0x67, 0x61, 0x73, 0x5f, + 0x70, 0x72, 0x69, 0x63, 0x65, 0x5f, 0x66, 0x72, 0x69, 0x18, 0x0e, 0x20, 0x01, 0x28, 0x0b, 0x32, + 0x08, 0x2e, 0x55, 0x69, 0x6e, 0x74, 0x31, 0x32, 0x38, 0x52, 0x0f, 0x64, 0x61, 0x74, 0x61, 0x47, + 0x61, 0x73, 0x50, 0x72, 0x69, 0x63, 0x65, 0x46, 0x72, 0x69, 0x12, 0x35, 0x0a, 0x12, 0x64, 0x61, + 0x74, 0x61, 0x5f, 0x67, 0x61, 0x73, 0x5f, 0x70, 0x72, 0x69, 0x63, 0x65, 0x5f, 0x77, 0x65, 0x69, + 0x18, 0x0f, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x08, 0x2e, 0x55, 0x69, 0x6e, 0x74, 0x31, 0x32, 0x38, + 0x52, 0x0f, 0x64, 0x61, 0x74, 0x61, 0x47, 0x61, 0x73, 0x50, 0x72, 0x69, 0x63, 0x65, 0x57, 0x65, + 0x69, 0x12, 0x52, 0x0a, 0x19, 0x6c, 0x31, 0x5f, 0x64, 0x61, 0x74, 0x61, 0x5f, 0x61, 0x76, 0x61, + 0x69, 0x6c, 0x61, 0x62, 0x69, 0x6c, 0x69, 0x74, 0x79, 0x5f, 0x6d, 0x6f, 0x64, 0x65, 0x18, 0x10, + 0x20, 0x01, 0x28, 0x0e, 0x32, 0x17, 0x2e, 0x4c, 0x31, 0x44, 0x61, 0x74, 0x61, 0x41, 0x76, 0x61, + 0x69, 0x6c, 0x61, 0x62, 0x69, 0x6c, 0x69, 0x74, 0x79, 0x4d, 0x6f, 0x64, 0x65, 0x52, 0x16, 0x6c, + 0x31, 0x44, 0x61, 0x74, 0x61, 0x41, 0x76, 0x61, 0x69, 0x6c, 0x61, 0x62, 0x69, 0x6c, 0x69, 0x74, + 0x79, 0x4d, 0x6f, 0x64, 0x65, 0x12, 0x33, 0x0a, 0x0a, 0x73, 0x69, 0x67, 0x6e, 0x61, 0x74, 0x75, + 0x72, 0x65, 0x73, 0x18, 0x11, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x13, 0x2e, 0x43, 0x6f, 0x6e, 0x73, + 0x65, 0x6e, 0x73, 0x75, 0x73, 0x53, 0x69, 0x67, 0x6e, 0x61, 0x74, 0x75, 0x72, 0x65, 0x52, 0x0a, + 0x73, 0x69, 0x67, 0x6e, 0x61, 0x74, 0x75, 0x72, 0x65, 0x73, 0x22, 0x65, 0x0a, 0x08, 0x4e, 0x65, + 0x77, 0x42, 0x6c, 0x6f, 0x63, 0x6b, 0x12, 0x1a, 0x0a, 0x02, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, + 0x28, 0x0b, 0x32, 0x08, 0x2e, 0x42, 0x6c, 0x6f, 0x63, 0x6b, 0x49, 0x44, 0x48, 0x00, 0x52, 0x02, + 0x69, 0x64, 0x12, 0x2f, 0x0a, 0x06, 0x68, 0x65, 0x61, 0x64, 0x65, 0x72, 0x18, 0x02, 0x20, 0x01, + 0x28, 0x0b, 0x32, 0x15, 0x2e, 0x42, 0x6c, 0x6f, 0x63, 0x6b, 0x48, 0x65, 0x61, 0x64, 0x65, 0x72, + 0x73, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x48, 0x00, 0x52, 0x06, 0x68, 0x65, 0x61, + 0x64, 0x65, 0x72, 0x42, 0x0c, 0x0a, 0x0a, 0x6d, 0x61, 0x79, 0x62, 0x65, 0x5f, 0x66, 0x75, 0x6c, + 0x6c, 0x22, 0x3f, 0x0a, 0x13, 0x42, 0x6c, 0x6f, 0x63, 0x6b, 0x48, 0x65, 0x61, 0x64, 0x65, 0x72, + 0x73, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x28, 0x0a, 0x09, 0x69, 0x74, 0x65, 0x72, + 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x0a, 0x2e, 0x49, 0x74, + 0x65, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x52, 0x09, 0x69, 0x74, 0x65, 0x72, 0x61, 0x74, 0x69, + 0x6f, 0x6e, 0x22, 0x70, 0x0a, 0x14, 0x42, 0x6c, 0x6f, 0x63, 0x6b, 0x48, 0x65, 0x61, 0x64, 0x65, + 0x72, 0x73, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x2c, 0x0a, 0x06, 0x68, 0x65, + 0x61, 0x64, 0x65, 0x72, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x12, 0x2e, 0x53, 0x69, 0x67, + 0x6e, 0x65, 0x64, 0x42, 0x6c, 0x6f, 0x63, 0x6b, 0x48, 0x65, 0x61, 0x64, 0x65, 0x72, 0x48, 0x00, + 0x52, 0x06, 0x68, 0x65, 0x61, 0x64, 0x65, 0x72, 0x12, 0x18, 0x0a, 0x03, 0x66, 0x69, 0x6e, 0x18, + 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x04, 0x2e, 0x46, 0x69, 0x6e, 0x48, 0x00, 0x52, 0x03, 0x66, + 0x69, 0x6e, 0x42, 0x10, 0x0a, 0x0e, 0x68, 0x65, 0x61, 0x64, 0x65, 0x72, 0x5f, 0x6d, 0x65, 0x73, + 0x73, 0x61, 0x67, 0x65, 0x22, 0x22, 0x0a, 0x0a, 0x42, 0x6c, 0x6f, 0x63, 0x6b, 0x50, 0x72, 0x6f, + 0x6f, 0x66, 0x12, 0x14, 0x0a, 0x05, 0x70, 0x72, 0x6f, 0x6f, 0x66, 0x18, 0x01, 0x20, 0x03, 0x28, + 0x0c, 0x52, 0x05, 0x70, 0x72, 0x6f, 0x6f, 0x66, 0x42, 0x31, 0x5a, 0x2f, 0x67, 0x69, 0x74, 0x68, + 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x4e, 0x65, 0x74, 0x68, 0x65, 0x72, 0x6d, 0x69, 0x6e, + 0x64, 0x45, 0x74, 0x68, 0x2f, 0x6a, 0x75, 0x6e, 0x6f, 0x2f, 0x70, 0x32, 0x70, 0x2f, 0x73, 0x74, + 0x61, 0x72, 0x6b, 0x6e, 0x65, 0x74, 0x2f, 0x73, 0x70, 0x65, 0x63, 0x62, 0x06, 0x70, 0x72, 0x6f, + 0x74, 0x6f, 0x33, } var ( @@ -502,44 +556,50 @@ func file_p2p_proto_header_proto_rawDescGZIP() []byte { } var ( - file_p2p_proto_header_proto_msgTypes = make([]protoimpl.MessageInfo, 4) + file_p2p_proto_header_proto_msgTypes = make([]protoimpl.MessageInfo, 5) file_p2p_proto_header_proto_goTypes = []interface{}{ (*SignedBlockHeader)(nil), // 0: SignedBlockHeader (*NewBlock)(nil), // 1: NewBlock (*BlockHeadersRequest)(nil), // 2: BlockHeadersRequest (*BlockHeadersResponse)(nil), // 3: BlockHeadersResponse - (*Hash)(nil), // 4: Hash - (*Address)(nil), // 5: Address - (*Patricia)(nil), // 6: Patricia - (*Merkle)(nil), // 7: Merkle - (*Felt252)(nil), // 8: Felt252 - (*ConsensusSignature)(nil), // 9: ConsensusSignature - (*BlockID)(nil), // 10: BlockID - (*Iteration)(nil), // 11: Iteration - (*Fin)(nil), // 12: Fin + (*BlockProof)(nil), // 4: BlockProof + (*Hash)(nil), // 5: Hash + (*Address)(nil), // 6: Address + (*StateDiffCommitment)(nil), // 7: StateDiffCommitment + (*Patricia)(nil), // 8: Patricia + (*Uint128)(nil), // 9: Uint128 + (L1DataAvailabilityMode)(0), // 10: L1DataAvailabilityMode + (*ConsensusSignature)(nil), // 11: ConsensusSignature + (*BlockID)(nil), // 12: BlockID + (*Iteration)(nil), // 13: Iteration + (*Fin)(nil), // 14: Fin } ) var file_p2p_proto_header_proto_depIdxs = []int32{ - 4, // 0: SignedBlockHeader.block_hash:type_name -> Hash - 4, // 1: SignedBlockHeader.parent_hash:type_name -> Hash - 5, // 2: SignedBlockHeader.sequencer_address:type_name -> Address - 4, // 3: SignedBlockHeader.state_diff_commitment:type_name -> Hash - 6, // 4: SignedBlockHeader.state:type_name -> Patricia - 7, // 5: SignedBlockHeader.transactions:type_name -> Merkle - 7, // 6: SignedBlockHeader.events:type_name -> Merkle - 7, // 7: SignedBlockHeader.receipts:type_name -> Merkle - 8, // 8: SignedBlockHeader.gas_price:type_name -> Felt252 - 9, // 9: SignedBlockHeader.signatures:type_name -> ConsensusSignature - 10, // 10: NewBlock.id:type_name -> BlockID - 3, // 11: NewBlock.header:type_name -> BlockHeadersResponse - 11, // 12: BlockHeadersRequest.iteration:type_name -> Iteration - 0, // 13: BlockHeadersResponse.header:type_name -> SignedBlockHeader - 12, // 14: BlockHeadersResponse.fin:type_name -> Fin - 15, // [15:15] is the sub-list for method output_type - 15, // [15:15] is the sub-list for method input_type - 15, // [15:15] is the sub-list for extension type_name - 15, // [15:15] is the sub-list for extension extendee - 0, // [0:15] is the sub-list for field type_name + 5, // 0: SignedBlockHeader.block_hash:type_name -> Hash + 5, // 1: SignedBlockHeader.parent_hash:type_name -> Hash + 6, // 2: SignedBlockHeader.sequencer_address:type_name -> Address + 5, // 3: SignedBlockHeader.state_root:type_name -> Hash + 7, // 4: SignedBlockHeader.state_diff_commitment:type_name -> StateDiffCommitment + 8, // 5: SignedBlockHeader.transactions:type_name -> Patricia + 8, // 6: SignedBlockHeader.events:type_name -> Patricia + 5, // 7: SignedBlockHeader.receipts:type_name -> Hash + 9, // 8: SignedBlockHeader.gas_price_fri:type_name -> Uint128 + 9, // 9: SignedBlockHeader.gas_price_wei:type_name -> Uint128 + 9, // 10: SignedBlockHeader.data_gas_price_fri:type_name -> Uint128 + 9, // 11: SignedBlockHeader.data_gas_price_wei:type_name -> Uint128 + 10, // 12: SignedBlockHeader.l1_data_availability_mode:type_name -> L1DataAvailabilityMode + 11, // 13: SignedBlockHeader.signatures:type_name -> ConsensusSignature + 12, // 14: NewBlock.id:type_name -> BlockID + 3, // 15: NewBlock.header:type_name -> BlockHeadersResponse + 13, // 16: BlockHeadersRequest.iteration:type_name -> Iteration + 0, // 17: BlockHeadersResponse.header:type_name -> SignedBlockHeader + 14, // 18: BlockHeadersResponse.fin:type_name -> Fin + 19, // [19:19] is the sub-list for method output_type + 19, // [19:19] is the sub-list for method input_type + 19, // [19:19] is the sub-list for extension type_name + 19, // [19:19] is the sub-list for extension extendee + 0, // [0:19] is the sub-list for field type_name } func init() { file_p2p_proto_header_proto_init() } @@ -597,6 +657,18 @@ func file_p2p_proto_header_proto_init() { return nil } } + file_p2p_proto_header_proto_msgTypes[4].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*BlockProof); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } } file_p2p_proto_header_proto_msgTypes[1].OneofWrappers = []interface{}{ (*NewBlock_Id)(nil), @@ -612,7 +684,7 @@ func file_p2p_proto_header_proto_init() { GoPackagePath: reflect.TypeOf(x{}).PkgPath(), RawDescriptor: file_p2p_proto_header_proto_rawDesc, NumEnums: 0, - NumMessages: 4, + NumMessages: 5, NumExtensions: 0, NumServices: 0, }, diff --git a/p2p/starknet/spec/receipt.pb.go b/p2p/starknet/spec/receipt.pb.go index 45836b8d77..680e7dceb1 100644 --- a/p2p/starknet/spec/receipt.pb.go +++ b/p2p/starknet/spec/receipt.pb.go @@ -21,14 +21,60 @@ const ( _ = protoimpl.EnforceVersion(protoimpl.MaxVersion - 20) ) +type PriceUnit int32 + +const ( + PriceUnit_Wei PriceUnit = 0 + PriceUnit_Fri PriceUnit = 1 +) + +// Enum value maps for PriceUnit. +var ( + PriceUnit_name = map[int32]string{ + 0: "Wei", + 1: "Fri", + } + PriceUnit_value = map[string]int32{ + "Wei": 0, + "Fri": 1, + } +) + +func (x PriceUnit) Enum() *PriceUnit { + p := new(PriceUnit) + *p = x + return p +} + +func (x PriceUnit) String() string { + return protoimpl.X.EnumStringOf(x.Descriptor(), protoreflect.EnumNumber(x)) +} + +func (PriceUnit) Descriptor() protoreflect.EnumDescriptor { + return file_p2p_proto_receipt_proto_enumTypes[0].Descriptor() +} + +func (PriceUnit) Type() protoreflect.EnumType { + return &file_p2p_proto_receipt_proto_enumTypes[0] +} + +func (x PriceUnit) Number() protoreflect.EnumNumber { + return protoreflect.EnumNumber(x) +} + +// Deprecated: Use PriceUnit.Descriptor instead. +func (PriceUnit) EnumDescriptor() ([]byte, []int) { + return file_p2p_proto_receipt_proto_rawDescGZIP(), []int{0} +} + type MessageToL1 struct { state protoimpl.MessageState sizeCache protoimpl.SizeCache unknownFields protoimpl.UnknownFields - FromAddress *Felt252 `protobuf:"bytes,1,opt,name=from_address,json=fromAddress,proto3" json:"from_address,omitempty"` - Payload []*Felt252 `protobuf:"bytes,2,rep,name=payload,proto3" json:"payload,omitempty"` - ToAddress *EthereumAddress `protobuf:"bytes,3,opt,name=to_address,json=toAddress,proto3" json:"to_address,omitempty"` + FromAddress *Felt252 `protobuf:"bytes,2,opt,name=from_address,json=fromAddress,proto3" json:"from_address,omitempty"` + Payload []*Felt252 `protobuf:"bytes,3,rep,name=payload,proto3" json:"payload,omitempty"` + ToAddress *EthereumAddress `protobuf:"bytes,4,opt,name=to_address,json=toAddress,proto3" json:"to_address,omitempty"` } func (x *MessageToL1) Reset() { @@ -254,182 +300,6 @@ func (*Receipt_DeprecatedDeploy) isReceipt_Type() {} func (*Receipt_DeployAccount_) isReceipt_Type() {} -type ReceiptsRequest struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - Iteration *Iteration `protobuf:"bytes,1,opt,name=iteration,proto3" json:"iteration,omitempty"` -} - -func (x *ReceiptsRequest) Reset() { - *x = ReceiptsRequest{} - if protoimpl.UnsafeEnabled { - mi := &file_p2p_proto_receipt_proto_msgTypes[3] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *ReceiptsRequest) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*ReceiptsRequest) ProtoMessage() {} - -func (x *ReceiptsRequest) ProtoReflect() protoreflect.Message { - mi := &file_p2p_proto_receipt_proto_msgTypes[3] - if protoimpl.UnsafeEnabled && x != nil { - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - if ms.LoadMessageInfo() == nil { - ms.StoreMessageInfo(mi) - } - return ms - } - return mi.MessageOf(x) -} - -// Deprecated: Use ReceiptsRequest.ProtoReflect.Descriptor instead. -func (*ReceiptsRequest) Descriptor() ([]byte, []int) { - return file_p2p_proto_receipt_proto_rawDescGZIP(), []int{3} -} - -func (x *ReceiptsRequest) GetIteration() *Iteration { - if x != nil { - return x.Iteration - } - return nil -} - -type Receipts struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - Items []*Receipt `protobuf:"bytes,2,rep,name=items,proto3" json:"items,omitempty"` -} - -func (x *Receipts) Reset() { - *x = Receipts{} - if protoimpl.UnsafeEnabled { - mi := &file_p2p_proto_receipt_proto_msgTypes[4] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *Receipts) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*Receipts) ProtoMessage() {} - -func (x *Receipts) ProtoReflect() protoreflect.Message { - mi := &file_p2p_proto_receipt_proto_msgTypes[4] - if protoimpl.UnsafeEnabled && x != nil { - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - if ms.LoadMessageInfo() == nil { - ms.StoreMessageInfo(mi) - } - return ms - } - return mi.MessageOf(x) -} - -// Deprecated: Use Receipts.ProtoReflect.Descriptor instead. -func (*Receipts) Descriptor() ([]byte, []int) { - return file_p2p_proto_receipt_proto_rawDescGZIP(), []int{4} -} - -func (x *Receipts) GetItems() []*Receipt { - if x != nil { - return x.Items - } - return nil -} - -// Responses are sent ordered by the order given in the request. -type ReceiptsResponse struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - // Types that are assignable to ReceiptMessage: - // - // *ReceiptsResponse_Receipt - // *ReceiptsResponse_Fin - ReceiptMessage isReceiptsResponse_ReceiptMessage `protobuf_oneof:"receipt_message"` -} - -func (x *ReceiptsResponse) Reset() { - *x = ReceiptsResponse{} - if protoimpl.UnsafeEnabled { - mi := &file_p2p_proto_receipt_proto_msgTypes[5] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *ReceiptsResponse) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*ReceiptsResponse) ProtoMessage() {} - -func (x *ReceiptsResponse) ProtoReflect() protoreflect.Message { - mi := &file_p2p_proto_receipt_proto_msgTypes[5] - if protoimpl.UnsafeEnabled && x != nil { - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - if ms.LoadMessageInfo() == nil { - ms.StoreMessageInfo(mi) - } - return ms - } - return mi.MessageOf(x) -} - -// Deprecated: Use ReceiptsResponse.ProtoReflect.Descriptor instead. -func (*ReceiptsResponse) Descriptor() ([]byte, []int) { - return file_p2p_proto_receipt_proto_rawDescGZIP(), []int{5} -} - -func (m *ReceiptsResponse) GetReceiptMessage() isReceiptsResponse_ReceiptMessage { - if m != nil { - return m.ReceiptMessage - } - return nil -} - -func (x *ReceiptsResponse) GetReceipt() *Receipt { - if x, ok := x.GetReceiptMessage().(*ReceiptsResponse_Receipt); ok { - return x.Receipt - } - return nil -} - -func (x *ReceiptsResponse) GetFin() *Fin { - if x, ok := x.GetReceiptMessage().(*ReceiptsResponse_Fin); ok { - return x.Fin - } - return nil -} - -type isReceiptsResponse_ReceiptMessage interface { - isReceiptsResponse_ReceiptMessage() -} - -type ReceiptsResponse_Receipt struct { - Receipt *Receipt `protobuf:"bytes,1,opt,name=receipt,proto3,oneof"` -} - -type ReceiptsResponse_Fin struct { - Fin *Fin `protobuf:"bytes,2,opt,name=fin,proto3,oneof"` // Fin is sent after the peer sent all the data or when it encountered a block that it doesn't have its receipts. -} - -func (*ReceiptsResponse_Receipt) isReceiptsResponse_ReceiptMessage() {} - -func (*ReceiptsResponse_Fin) isReceiptsResponse_ReceiptMessage() {} - type Receipt_ExecutionResources struct { state protoimpl.MessageState sizeCache protoimpl.SizeCache @@ -438,12 +308,14 @@ type Receipt_ExecutionResources struct { Builtins *Receipt_ExecutionResources_BuiltinCounter `protobuf:"bytes,1,opt,name=builtins,proto3" json:"builtins,omitempty"` Steps uint32 `protobuf:"varint,2,opt,name=steps,proto3" json:"steps,omitempty"` MemoryHoles uint32 `protobuf:"varint,3,opt,name=memory_holes,json=memoryHoles,proto3" json:"memory_holes,omitempty"` + L1Gas *Felt252 `protobuf:"bytes,4,opt,name=l1_gas,json=l1Gas,proto3" json:"l1_gas,omitempty"` + L1DataGas *Felt252 `protobuf:"bytes,5,opt,name=l1_data_gas,json=l1DataGas,proto3" json:"l1_data_gas,omitempty"` } func (x *Receipt_ExecutionResources) Reset() { *x = Receipt_ExecutionResources{} if protoimpl.UnsafeEnabled { - mi := &file_p2p_proto_receipt_proto_msgTypes[6] + mi := &file_p2p_proto_receipt_proto_msgTypes[3] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -456,7 +328,7 @@ func (x *Receipt_ExecutionResources) String() string { func (*Receipt_ExecutionResources) ProtoMessage() {} func (x *Receipt_ExecutionResources) ProtoReflect() protoreflect.Message { - mi := &file_p2p_proto_receipt_proto_msgTypes[6] + mi := &file_p2p_proto_receipt_proto_msgTypes[3] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -493,22 +365,36 @@ func (x *Receipt_ExecutionResources) GetMemoryHoles() uint32 { return 0 } +func (x *Receipt_ExecutionResources) GetL1Gas() *Felt252 { + if x != nil { + return x.L1Gas + } + return nil +} + +func (x *Receipt_ExecutionResources) GetL1DataGas() *Felt252 { + if x != nil { + return x.L1DataGas + } + return nil +} + type Receipt_Common struct { state protoimpl.MessageState sizeCache protoimpl.SizeCache unknownFields protoimpl.UnknownFields - TransactionHash *Hash `protobuf:"bytes,1,opt,name=transaction_hash,json=transactionHash,proto3" json:"transaction_hash,omitempty"` - ActualFee *Felt252 `protobuf:"bytes,2,opt,name=actual_fee,json=actualFee,proto3" json:"actual_fee,omitempty"` - MessagesSent []*MessageToL1 `protobuf:"bytes,3,rep,name=messages_sent,json=messagesSent,proto3" json:"messages_sent,omitempty"` - ExecutionResources *Receipt_ExecutionResources `protobuf:"bytes,4,opt,name=execution_resources,json=executionResources,proto3" json:"execution_resources,omitempty"` - RevertReason string `protobuf:"bytes,5,opt,name=revert_reason,json=revertReason,proto3" json:"revert_reason,omitempty"` + ActualFee *Felt252 `protobuf:"bytes,2,opt,name=actual_fee,json=actualFee,proto3" json:"actual_fee,omitempty"` + PriceUnit PriceUnit `protobuf:"varint,3,opt,name=price_unit,json=priceUnit,proto3,enum=PriceUnit" json:"price_unit,omitempty"` + MessagesSent []*MessageToL1 `protobuf:"bytes,4,rep,name=messages_sent,json=messagesSent,proto3" json:"messages_sent,omitempty"` + ExecutionResources *Receipt_ExecutionResources `protobuf:"bytes,5,opt,name=execution_resources,json=executionResources,proto3" json:"execution_resources,omitempty"` + RevertReason *string `protobuf:"bytes,6,opt,name=revert_reason,json=revertReason,proto3,oneof" json:"revert_reason,omitempty"` } func (x *Receipt_Common) Reset() { *x = Receipt_Common{} if protoimpl.UnsafeEnabled { - mi := &file_p2p_proto_receipt_proto_msgTypes[7] + mi := &file_p2p_proto_receipt_proto_msgTypes[4] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -521,7 +407,7 @@ func (x *Receipt_Common) String() string { func (*Receipt_Common) ProtoMessage() {} func (x *Receipt_Common) ProtoReflect() protoreflect.Message { - mi := &file_p2p_proto_receipt_proto_msgTypes[7] + mi := &file_p2p_proto_receipt_proto_msgTypes[4] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -537,18 +423,18 @@ func (*Receipt_Common) Descriptor() ([]byte, []int) { return file_p2p_proto_receipt_proto_rawDescGZIP(), []int{2, 1} } -func (x *Receipt_Common) GetTransactionHash() *Hash { +func (x *Receipt_Common) GetActualFee() *Felt252 { if x != nil { - return x.TransactionHash + return x.ActualFee } return nil } -func (x *Receipt_Common) GetActualFee() *Felt252 { +func (x *Receipt_Common) GetPriceUnit() PriceUnit { if x != nil { - return x.ActualFee + return x.PriceUnit } - return nil + return PriceUnit_Wei } func (x *Receipt_Common) GetMessagesSent() []*MessageToL1 { @@ -566,8 +452,8 @@ func (x *Receipt_Common) GetExecutionResources() *Receipt_ExecutionResources { } func (x *Receipt_Common) GetRevertReason() string { - if x != nil { - return x.RevertReason + if x != nil && x.RevertReason != nil { + return *x.RevertReason } return "" } @@ -583,7 +469,7 @@ type Receipt_Invoke struct { func (x *Receipt_Invoke) Reset() { *x = Receipt_Invoke{} if protoimpl.UnsafeEnabled { - mi := &file_p2p_proto_receipt_proto_msgTypes[8] + mi := &file_p2p_proto_receipt_proto_msgTypes[5] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -596,7 +482,7 @@ func (x *Receipt_Invoke) String() string { func (*Receipt_Invoke) ProtoMessage() {} func (x *Receipt_Invoke) ProtoReflect() protoreflect.Message { - mi := &file_p2p_proto_receipt_proto_msgTypes[8] + mi := &file_p2p_proto_receipt_proto_msgTypes[5] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -631,7 +517,7 @@ type Receipt_L1Handler struct { func (x *Receipt_L1Handler) Reset() { *x = Receipt_L1Handler{} if protoimpl.UnsafeEnabled { - mi := &file_p2p_proto_receipt_proto_msgTypes[9] + mi := &file_p2p_proto_receipt_proto_msgTypes[6] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -644,7 +530,7 @@ func (x *Receipt_L1Handler) String() string { func (*Receipt_L1Handler) ProtoMessage() {} func (x *Receipt_L1Handler) ProtoReflect() protoreflect.Message { - mi := &file_p2p_proto_receipt_proto_msgTypes[9] + mi := &file_p2p_proto_receipt_proto_msgTypes[6] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -685,7 +571,7 @@ type Receipt_Declare struct { func (x *Receipt_Declare) Reset() { *x = Receipt_Declare{} if protoimpl.UnsafeEnabled { - mi := &file_p2p_proto_receipt_proto_msgTypes[10] + mi := &file_p2p_proto_receipt_proto_msgTypes[7] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -698,7 +584,7 @@ func (x *Receipt_Declare) String() string { func (*Receipt_Declare) ProtoMessage() {} func (x *Receipt_Declare) ProtoReflect() protoreflect.Message { - mi := &file_p2p_proto_receipt_proto_msgTypes[10] + mi := &file_p2p_proto_receipt_proto_msgTypes[7] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -733,7 +619,7 @@ type Receipt_Deploy struct { func (x *Receipt_Deploy) Reset() { *x = Receipt_Deploy{} if protoimpl.UnsafeEnabled { - mi := &file_p2p_proto_receipt_proto_msgTypes[11] + mi := &file_p2p_proto_receipt_proto_msgTypes[8] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -746,7 +632,7 @@ func (x *Receipt_Deploy) String() string { func (*Receipt_Deploy) ProtoMessage() {} func (x *Receipt_Deploy) ProtoReflect() protoreflect.Message { - mi := &file_p2p_proto_receipt_proto_msgTypes[11] + mi := &file_p2p_proto_receipt_proto_msgTypes[8] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -788,7 +674,7 @@ type Receipt_DeployAccount struct { func (x *Receipt_DeployAccount) Reset() { *x = Receipt_DeployAccount{} if protoimpl.UnsafeEnabled { - mi := &file_p2p_proto_receipt_proto_msgTypes[12] + mi := &file_p2p_proto_receipt_proto_msgTypes[9] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -801,7 +687,7 @@ func (x *Receipt_DeployAccount) String() string { func (*Receipt_DeployAccount) ProtoMessage() {} func (x *Receipt_DeployAccount) ProtoReflect() protoreflect.Message { - mi := &file_p2p_proto_receipt_proto_msgTypes[12] + mi := &file_p2p_proto_receipt_proto_msgTypes[9] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -849,7 +735,7 @@ type Receipt_ExecutionResources_BuiltinCounter struct { func (x *Receipt_ExecutionResources_BuiltinCounter) Reset() { *x = Receipt_ExecutionResources_BuiltinCounter{} if protoimpl.UnsafeEnabled { - mi := &file_p2p_proto_receipt_proto_msgTypes[13] + mi := &file_p2p_proto_receipt_proto_msgTypes[10] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -862,7 +748,7 @@ func (x *Receipt_ExecutionResources_BuiltinCounter) String() string { func (*Receipt_ExecutionResources_BuiltinCounter) ProtoMessage() {} func (x *Receipt_ExecutionResources_BuiltinCounter) ProtoReflect() protoreflect.Message { - mi := &file_p2p_proto_receipt_proto_msgTypes[13] + mi := &file_p2p_proto_receipt_proto_msgTypes[10] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -942,17 +828,17 @@ var file_p2p_proto_receipt_proto_rawDesc = []byte{ 0x72, 0x6f, 0x74, 0x6f, 0x2f, 0x63, 0x6f, 0x6d, 0x6d, 0x6f, 0x6e, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x22, 0x8f, 0x01, 0x0a, 0x0b, 0x4d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x54, 0x6f, 0x4c, 0x31, 0x12, 0x2b, 0x0a, 0x0c, 0x66, 0x72, 0x6f, 0x6d, 0x5f, 0x61, 0x64, 0x64, 0x72, 0x65, 0x73, - 0x73, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x08, 0x2e, 0x46, 0x65, 0x6c, 0x74, 0x32, 0x35, + 0x73, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x08, 0x2e, 0x46, 0x65, 0x6c, 0x74, 0x32, 0x35, 0x32, 0x52, 0x0b, 0x66, 0x72, 0x6f, 0x6d, 0x41, 0x64, 0x64, 0x72, 0x65, 0x73, 0x73, 0x12, 0x22, - 0x0a, 0x07, 0x70, 0x61, 0x79, 0x6c, 0x6f, 0x61, 0x64, 0x18, 0x02, 0x20, 0x03, 0x28, 0x0b, 0x32, + 0x0a, 0x07, 0x70, 0x61, 0x79, 0x6c, 0x6f, 0x61, 0x64, 0x18, 0x03, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x08, 0x2e, 0x46, 0x65, 0x6c, 0x74, 0x32, 0x35, 0x32, 0x52, 0x07, 0x70, 0x61, 0x79, 0x6c, 0x6f, 0x61, 0x64, 0x12, 0x2f, 0x0a, 0x0a, 0x74, 0x6f, 0x5f, 0x61, 0x64, 0x64, 0x72, 0x65, 0x73, 0x73, - 0x18, 0x03, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x10, 0x2e, 0x45, 0x74, 0x68, 0x65, 0x72, 0x65, 0x75, + 0x18, 0x04, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x10, 0x2e, 0x45, 0x74, 0x68, 0x65, 0x72, 0x65, 0x75, 0x6d, 0x41, 0x64, 0x64, 0x72, 0x65, 0x73, 0x73, 0x52, 0x09, 0x74, 0x6f, 0x41, 0x64, 0x64, 0x72, 0x65, 0x73, 0x73, 0x22, 0x2d, 0x0a, 0x0f, 0x45, 0x74, 0x68, 0x65, 0x72, 0x65, 0x75, 0x6d, 0x41, 0x64, 0x64, 0x72, 0x65, 0x73, 0x73, 0x12, 0x1a, 0x0a, 0x08, 0x65, 0x6c, 0x65, 0x6d, 0x65, 0x6e, 0x74, 0x73, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0c, 0x52, 0x08, 0x65, 0x6c, 0x65, 0x6d, 0x65, 0x6e, - 0x74, 0x73, 0x22, 0xbb, 0x0a, 0x0a, 0x07, 0x52, 0x65, 0x63, 0x65, 0x69, 0x70, 0x74, 0x12, 0x29, + 0x74, 0x73, 0x22, 0x96, 0x0b, 0x0a, 0x07, 0x52, 0x65, 0x63, 0x65, 0x69, 0x70, 0x74, 0x12, 0x29, 0x0a, 0x06, 0x69, 0x6e, 0x76, 0x6f, 0x6b, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x0f, 0x2e, 0x52, 0x65, 0x63, 0x65, 0x69, 0x70, 0x74, 0x2e, 0x49, 0x6e, 0x76, 0x6f, 0x6b, 0x65, 0x48, 0x00, 0x52, 0x06, 0x69, 0x6e, 0x76, 0x6f, 0x6b, 0x65, 0x12, 0x33, 0x0a, 0x0a, 0x6c, 0x31, 0x5f, @@ -969,7 +855,7 @@ var file_p2p_proto_receipt_proto_rawDesc = []byte{ 0x64, 0x65, 0x70, 0x6c, 0x6f, 0x79, 0x5f, 0x61, 0x63, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x18, 0x05, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x16, 0x2e, 0x52, 0x65, 0x63, 0x65, 0x69, 0x70, 0x74, 0x2e, 0x44, 0x65, 0x70, 0x6c, 0x6f, 0x79, 0x41, 0x63, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x48, 0x00, 0x52, 0x0d, - 0x64, 0x65, 0x70, 0x6c, 0x6f, 0x79, 0x41, 0x63, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x1a, 0xf6, 0x02, + 0x64, 0x65, 0x70, 0x6c, 0x6f, 0x79, 0x41, 0x63, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x1a, 0xc1, 0x03, 0x0a, 0x12, 0x45, 0x78, 0x65, 0x63, 0x75, 0x74, 0x69, 0x6f, 0x6e, 0x52, 0x65, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x73, 0x12, 0x46, 0x0a, 0x08, 0x62, 0x75, 0x69, 0x6c, 0x74, 0x69, 0x6e, 0x73, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x2a, 0x2e, 0x52, 0x65, 0x63, 0x65, 0x69, 0x70, 0x74, @@ -979,80 +865,75 @@ var file_p2p_proto_receipt_proto_rawDesc = []byte{ 0x73, 0x74, 0x65, 0x70, 0x73, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0d, 0x52, 0x05, 0x73, 0x74, 0x65, 0x70, 0x73, 0x12, 0x21, 0x0a, 0x0c, 0x6d, 0x65, 0x6d, 0x6f, 0x72, 0x79, 0x5f, 0x68, 0x6f, 0x6c, 0x65, 0x73, 0x18, 0x03, 0x20, 0x01, 0x28, 0x0d, 0x52, 0x0b, 0x6d, 0x65, 0x6d, 0x6f, 0x72, 0x79, - 0x48, 0x6f, 0x6c, 0x65, 0x73, 0x1a, 0xde, 0x01, 0x0a, 0x0e, 0x42, 0x75, 0x69, 0x6c, 0x74, 0x69, - 0x6e, 0x43, 0x6f, 0x75, 0x6e, 0x74, 0x65, 0x72, 0x12, 0x18, 0x0a, 0x07, 0x62, 0x69, 0x74, 0x77, - 0x69, 0x73, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0d, 0x52, 0x07, 0x62, 0x69, 0x74, 0x77, 0x69, - 0x73, 0x65, 0x12, 0x14, 0x0a, 0x05, 0x65, 0x63, 0x64, 0x73, 0x61, 0x18, 0x02, 0x20, 0x01, 0x28, - 0x0d, 0x52, 0x05, 0x65, 0x63, 0x64, 0x73, 0x61, 0x12, 0x13, 0x0a, 0x05, 0x65, 0x63, 0x5f, 0x6f, - 0x70, 0x18, 0x03, 0x20, 0x01, 0x28, 0x0d, 0x52, 0x04, 0x65, 0x63, 0x4f, 0x70, 0x12, 0x1a, 0x0a, - 0x08, 0x70, 0x65, 0x64, 0x65, 0x72, 0x73, 0x65, 0x6e, 0x18, 0x04, 0x20, 0x01, 0x28, 0x0d, 0x52, - 0x08, 0x70, 0x65, 0x64, 0x65, 0x72, 0x73, 0x65, 0x6e, 0x12, 0x1f, 0x0a, 0x0b, 0x72, 0x61, 0x6e, - 0x67, 0x65, 0x5f, 0x63, 0x68, 0x65, 0x63, 0x6b, 0x18, 0x05, 0x20, 0x01, 0x28, 0x0d, 0x52, 0x0a, - 0x72, 0x61, 0x6e, 0x67, 0x65, 0x43, 0x68, 0x65, 0x63, 0x6b, 0x12, 0x1a, 0x0a, 0x08, 0x70, 0x6f, - 0x73, 0x65, 0x69, 0x64, 0x6f, 0x6e, 0x18, 0x06, 0x20, 0x01, 0x28, 0x0d, 0x52, 0x08, 0x70, 0x6f, - 0x73, 0x65, 0x69, 0x64, 0x6f, 0x6e, 0x12, 0x16, 0x0a, 0x06, 0x6b, 0x65, 0x63, 0x63, 0x61, 0x6b, - 0x18, 0x07, 0x20, 0x01, 0x28, 0x0d, 0x52, 0x06, 0x6b, 0x65, 0x63, 0x63, 0x61, 0x6b, 0x12, 0x16, - 0x0a, 0x06, 0x6f, 0x75, 0x74, 0x70, 0x75, 0x74, 0x18, 0x08, 0x20, 0x01, 0x28, 0x0d, 0x52, 0x06, - 0x6f, 0x75, 0x74, 0x70, 0x75, 0x74, 0x1a, 0x89, 0x02, 0x0a, 0x06, 0x43, 0x6f, 0x6d, 0x6d, 0x6f, - 0x6e, 0x12, 0x30, 0x0a, 0x10, 0x74, 0x72, 0x61, 0x6e, 0x73, 0x61, 0x63, 0x74, 0x69, 0x6f, 0x6e, - 0x5f, 0x68, 0x61, 0x73, 0x68, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x05, 0x2e, 0x48, 0x61, - 0x73, 0x68, 0x52, 0x0f, 0x74, 0x72, 0x61, 0x6e, 0x73, 0x61, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x48, - 0x61, 0x73, 0x68, 0x12, 0x27, 0x0a, 0x0a, 0x61, 0x63, 0x74, 0x75, 0x61, 0x6c, 0x5f, 0x66, 0x65, - 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x08, 0x2e, 0x46, 0x65, 0x6c, 0x74, 0x32, 0x35, - 0x32, 0x52, 0x09, 0x61, 0x63, 0x74, 0x75, 0x61, 0x6c, 0x46, 0x65, 0x65, 0x12, 0x31, 0x0a, 0x0d, - 0x6d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x73, 0x5f, 0x73, 0x65, 0x6e, 0x74, 0x18, 0x03, 0x20, - 0x03, 0x28, 0x0b, 0x32, 0x0c, 0x2e, 0x4d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x54, 0x6f, 0x4c, - 0x31, 0x52, 0x0c, 0x6d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x73, 0x53, 0x65, 0x6e, 0x74, 0x12, - 0x4c, 0x0a, 0x13, 0x65, 0x78, 0x65, 0x63, 0x75, 0x74, 0x69, 0x6f, 0x6e, 0x5f, 0x72, 0x65, 0x73, - 0x6f, 0x75, 0x72, 0x63, 0x65, 0x73, 0x18, 0x04, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1b, 0x2e, 0x52, - 0x65, 0x63, 0x65, 0x69, 0x70, 0x74, 0x2e, 0x45, 0x78, 0x65, 0x63, 0x75, 0x74, 0x69, 0x6f, 0x6e, - 0x52, 0x65, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x73, 0x52, 0x12, 0x65, 0x78, 0x65, 0x63, 0x75, - 0x74, 0x69, 0x6f, 0x6e, 0x52, 0x65, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x73, 0x12, 0x23, 0x0a, - 0x0d, 0x72, 0x65, 0x76, 0x65, 0x72, 0x74, 0x5f, 0x72, 0x65, 0x61, 0x73, 0x6f, 0x6e, 0x18, 0x05, - 0x20, 0x01, 0x28, 0x09, 0x52, 0x0c, 0x72, 0x65, 0x76, 0x65, 0x72, 0x74, 0x52, 0x65, 0x61, 0x73, - 0x6f, 0x6e, 0x1a, 0x31, 0x0a, 0x06, 0x49, 0x6e, 0x76, 0x6f, 0x6b, 0x65, 0x12, 0x27, 0x0a, 0x06, - 0x63, 0x6f, 0x6d, 0x6d, 0x6f, 0x6e, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x0f, 0x2e, 0x52, - 0x65, 0x63, 0x65, 0x69, 0x70, 0x74, 0x2e, 0x43, 0x6f, 0x6d, 0x6d, 0x6f, 0x6e, 0x52, 0x06, 0x63, - 0x6f, 0x6d, 0x6d, 0x6f, 0x6e, 0x1a, 0x56, 0x0a, 0x09, 0x4c, 0x31, 0x48, 0x61, 0x6e, 0x64, 0x6c, - 0x65, 0x72, 0x12, 0x27, 0x0a, 0x06, 0x63, 0x6f, 0x6d, 0x6d, 0x6f, 0x6e, 0x18, 0x01, 0x20, 0x01, - 0x28, 0x0b, 0x32, 0x0f, 0x2e, 0x52, 0x65, 0x63, 0x65, 0x69, 0x70, 0x74, 0x2e, 0x43, 0x6f, 0x6d, - 0x6d, 0x6f, 0x6e, 0x52, 0x06, 0x63, 0x6f, 0x6d, 0x6d, 0x6f, 0x6e, 0x12, 0x20, 0x0a, 0x08, 0x6d, - 0x73, 0x67, 0x5f, 0x68, 0x61, 0x73, 0x68, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x05, 0x2e, - 0x48, 0x61, 0x73, 0x68, 0x52, 0x07, 0x6d, 0x73, 0x67, 0x48, 0x61, 0x73, 0x68, 0x1a, 0x32, 0x0a, - 0x07, 0x44, 0x65, 0x63, 0x6c, 0x61, 0x72, 0x65, 0x12, 0x27, 0x0a, 0x06, 0x63, 0x6f, 0x6d, 0x6d, - 0x6f, 0x6e, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x0f, 0x2e, 0x52, 0x65, 0x63, 0x65, 0x69, - 0x70, 0x74, 0x2e, 0x43, 0x6f, 0x6d, 0x6d, 0x6f, 0x6e, 0x52, 0x06, 0x63, 0x6f, 0x6d, 0x6d, 0x6f, - 0x6e, 0x1a, 0x66, 0x0a, 0x06, 0x44, 0x65, 0x70, 0x6c, 0x6f, 0x79, 0x12, 0x27, 0x0a, 0x06, 0x63, - 0x6f, 0x6d, 0x6d, 0x6f, 0x6e, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x0f, 0x2e, 0x52, 0x65, - 0x63, 0x65, 0x69, 0x70, 0x74, 0x2e, 0x43, 0x6f, 0x6d, 0x6d, 0x6f, 0x6e, 0x52, 0x06, 0x63, 0x6f, - 0x6d, 0x6d, 0x6f, 0x6e, 0x12, 0x33, 0x0a, 0x10, 0x63, 0x6f, 0x6e, 0x74, 0x72, 0x61, 0x63, 0x74, - 0x5f, 0x61, 0x64, 0x64, 0x72, 0x65, 0x73, 0x73, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x08, - 0x2e, 0x46, 0x65, 0x6c, 0x74, 0x32, 0x35, 0x32, 0x52, 0x0f, 0x63, 0x6f, 0x6e, 0x74, 0x72, 0x61, - 0x63, 0x74, 0x41, 0x64, 0x64, 0x72, 0x65, 0x73, 0x73, 0x1a, 0x6d, 0x0a, 0x0d, 0x44, 0x65, 0x70, - 0x6c, 0x6f, 0x79, 0x41, 0x63, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x12, 0x27, 0x0a, 0x06, 0x63, 0x6f, - 0x6d, 0x6d, 0x6f, 0x6e, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x0f, 0x2e, 0x52, 0x65, 0x63, - 0x65, 0x69, 0x70, 0x74, 0x2e, 0x43, 0x6f, 0x6d, 0x6d, 0x6f, 0x6e, 0x52, 0x06, 0x63, 0x6f, 0x6d, - 0x6d, 0x6f, 0x6e, 0x12, 0x33, 0x0a, 0x10, 0x63, 0x6f, 0x6e, 0x74, 0x72, 0x61, 0x63, 0x74, 0x5f, - 0x61, 0x64, 0x64, 0x72, 0x65, 0x73, 0x73, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x08, 0x2e, - 0x46, 0x65, 0x6c, 0x74, 0x32, 0x35, 0x32, 0x52, 0x0f, 0x63, 0x6f, 0x6e, 0x74, 0x72, 0x61, 0x63, - 0x74, 0x41, 0x64, 0x64, 0x72, 0x65, 0x73, 0x73, 0x42, 0x06, 0x0a, 0x04, 0x74, 0x79, 0x70, 0x65, - 0x22, 0x3b, 0x0a, 0x0f, 0x52, 0x65, 0x63, 0x65, 0x69, 0x70, 0x74, 0x73, 0x52, 0x65, 0x71, 0x75, - 0x65, 0x73, 0x74, 0x12, 0x28, 0x0a, 0x09, 0x69, 0x74, 0x65, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, - 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x0a, 0x2e, 0x49, 0x74, 0x65, 0x72, 0x61, 0x74, 0x69, - 0x6f, 0x6e, 0x52, 0x09, 0x69, 0x74, 0x65, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x22, 0x2a, 0x0a, - 0x08, 0x52, 0x65, 0x63, 0x65, 0x69, 0x70, 0x74, 0x73, 0x12, 0x1e, 0x0a, 0x05, 0x69, 0x74, 0x65, - 0x6d, 0x73, 0x18, 0x02, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x08, 0x2e, 0x52, 0x65, 0x63, 0x65, 0x69, - 0x70, 0x74, 0x52, 0x05, 0x69, 0x74, 0x65, 0x6d, 0x73, 0x22, 0x65, 0x0a, 0x10, 0x52, 0x65, 0x63, - 0x65, 0x69, 0x70, 0x74, 0x73, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x24, 0x0a, - 0x07, 0x72, 0x65, 0x63, 0x65, 0x69, 0x70, 0x74, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x08, - 0x2e, 0x52, 0x65, 0x63, 0x65, 0x69, 0x70, 0x74, 0x48, 0x00, 0x52, 0x07, 0x72, 0x65, 0x63, 0x65, - 0x69, 0x70, 0x74, 0x12, 0x18, 0x0a, 0x03, 0x66, 0x69, 0x6e, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, - 0x32, 0x04, 0x2e, 0x46, 0x69, 0x6e, 0x48, 0x00, 0x52, 0x03, 0x66, 0x69, 0x6e, 0x42, 0x11, 0x0a, - 0x0f, 0x72, 0x65, 0x63, 0x65, 0x69, 0x70, 0x74, 0x5f, 0x6d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, - 0x42, 0x31, 0x5a, 0x2f, 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x4e, - 0x65, 0x74, 0x68, 0x65, 0x72, 0x6d, 0x69, 0x6e, 0x64, 0x45, 0x74, 0x68, 0x2f, 0x6a, 0x75, 0x6e, - 0x6f, 0x2f, 0x70, 0x32, 0x70, 0x2f, 0x73, 0x74, 0x61, 0x72, 0x6b, 0x6e, 0x65, 0x74, 0x2f, 0x73, - 0x70, 0x65, 0x63, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, + 0x48, 0x6f, 0x6c, 0x65, 0x73, 0x12, 0x1f, 0x0a, 0x06, 0x6c, 0x31, 0x5f, 0x67, 0x61, 0x73, 0x18, + 0x04, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x08, 0x2e, 0x46, 0x65, 0x6c, 0x74, 0x32, 0x35, 0x32, 0x52, + 0x05, 0x6c, 0x31, 0x47, 0x61, 0x73, 0x12, 0x28, 0x0a, 0x0b, 0x6c, 0x31, 0x5f, 0x64, 0x61, 0x74, + 0x61, 0x5f, 0x67, 0x61, 0x73, 0x18, 0x05, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x08, 0x2e, 0x46, 0x65, + 0x6c, 0x74, 0x32, 0x35, 0x32, 0x52, 0x09, 0x6c, 0x31, 0x44, 0x61, 0x74, 0x61, 0x47, 0x61, 0x73, + 0x1a, 0xde, 0x01, 0x0a, 0x0e, 0x42, 0x75, 0x69, 0x6c, 0x74, 0x69, 0x6e, 0x43, 0x6f, 0x75, 0x6e, + 0x74, 0x65, 0x72, 0x12, 0x18, 0x0a, 0x07, 0x62, 0x69, 0x74, 0x77, 0x69, 0x73, 0x65, 0x18, 0x01, + 0x20, 0x01, 0x28, 0x0d, 0x52, 0x07, 0x62, 0x69, 0x74, 0x77, 0x69, 0x73, 0x65, 0x12, 0x14, 0x0a, + 0x05, 0x65, 0x63, 0x64, 0x73, 0x61, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0d, 0x52, 0x05, 0x65, 0x63, + 0x64, 0x73, 0x61, 0x12, 0x13, 0x0a, 0x05, 0x65, 0x63, 0x5f, 0x6f, 0x70, 0x18, 0x03, 0x20, 0x01, + 0x28, 0x0d, 0x52, 0x04, 0x65, 0x63, 0x4f, 0x70, 0x12, 0x1a, 0x0a, 0x08, 0x70, 0x65, 0x64, 0x65, + 0x72, 0x73, 0x65, 0x6e, 0x18, 0x04, 0x20, 0x01, 0x28, 0x0d, 0x52, 0x08, 0x70, 0x65, 0x64, 0x65, + 0x72, 0x73, 0x65, 0x6e, 0x12, 0x1f, 0x0a, 0x0b, 0x72, 0x61, 0x6e, 0x67, 0x65, 0x5f, 0x63, 0x68, + 0x65, 0x63, 0x6b, 0x18, 0x05, 0x20, 0x01, 0x28, 0x0d, 0x52, 0x0a, 0x72, 0x61, 0x6e, 0x67, 0x65, + 0x43, 0x68, 0x65, 0x63, 0x6b, 0x12, 0x1a, 0x0a, 0x08, 0x70, 0x6f, 0x73, 0x65, 0x69, 0x64, 0x6f, + 0x6e, 0x18, 0x06, 0x20, 0x01, 0x28, 0x0d, 0x52, 0x08, 0x70, 0x6f, 0x73, 0x65, 0x69, 0x64, 0x6f, + 0x6e, 0x12, 0x16, 0x0a, 0x06, 0x6b, 0x65, 0x63, 0x63, 0x61, 0x6b, 0x18, 0x07, 0x20, 0x01, 0x28, + 0x0d, 0x52, 0x06, 0x6b, 0x65, 0x63, 0x63, 0x61, 0x6b, 0x12, 0x16, 0x0a, 0x06, 0x6f, 0x75, 0x74, + 0x70, 0x75, 0x74, 0x18, 0x08, 0x20, 0x01, 0x28, 0x0d, 0x52, 0x06, 0x6f, 0x75, 0x74, 0x70, 0x75, + 0x74, 0x1a, 0x99, 0x02, 0x0a, 0x06, 0x43, 0x6f, 0x6d, 0x6d, 0x6f, 0x6e, 0x12, 0x27, 0x0a, 0x0a, + 0x61, 0x63, 0x74, 0x75, 0x61, 0x6c, 0x5f, 0x66, 0x65, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, + 0x32, 0x08, 0x2e, 0x46, 0x65, 0x6c, 0x74, 0x32, 0x35, 0x32, 0x52, 0x09, 0x61, 0x63, 0x74, 0x75, + 0x61, 0x6c, 0x46, 0x65, 0x65, 0x12, 0x29, 0x0a, 0x0a, 0x70, 0x72, 0x69, 0x63, 0x65, 0x5f, 0x75, + 0x6e, 0x69, 0x74, 0x18, 0x03, 0x20, 0x01, 0x28, 0x0e, 0x32, 0x0a, 0x2e, 0x50, 0x72, 0x69, 0x63, + 0x65, 0x55, 0x6e, 0x69, 0x74, 0x52, 0x09, 0x70, 0x72, 0x69, 0x63, 0x65, 0x55, 0x6e, 0x69, 0x74, + 0x12, 0x31, 0x0a, 0x0d, 0x6d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x73, 0x5f, 0x73, 0x65, 0x6e, + 0x74, 0x18, 0x04, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x0c, 0x2e, 0x4d, 0x65, 0x73, 0x73, 0x61, 0x67, + 0x65, 0x54, 0x6f, 0x4c, 0x31, 0x52, 0x0c, 0x6d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x73, 0x53, + 0x65, 0x6e, 0x74, 0x12, 0x4c, 0x0a, 0x13, 0x65, 0x78, 0x65, 0x63, 0x75, 0x74, 0x69, 0x6f, 0x6e, + 0x5f, 0x72, 0x65, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x73, 0x18, 0x05, 0x20, 0x01, 0x28, 0x0b, + 0x32, 0x1b, 0x2e, 0x52, 0x65, 0x63, 0x65, 0x69, 0x70, 0x74, 0x2e, 0x45, 0x78, 0x65, 0x63, 0x75, + 0x74, 0x69, 0x6f, 0x6e, 0x52, 0x65, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x73, 0x52, 0x12, 0x65, + 0x78, 0x65, 0x63, 0x75, 0x74, 0x69, 0x6f, 0x6e, 0x52, 0x65, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, + 0x73, 0x12, 0x28, 0x0a, 0x0d, 0x72, 0x65, 0x76, 0x65, 0x72, 0x74, 0x5f, 0x72, 0x65, 0x61, 0x73, + 0x6f, 0x6e, 0x18, 0x06, 0x20, 0x01, 0x28, 0x09, 0x48, 0x00, 0x52, 0x0c, 0x72, 0x65, 0x76, 0x65, + 0x72, 0x74, 0x52, 0x65, 0x61, 0x73, 0x6f, 0x6e, 0x88, 0x01, 0x01, 0x42, 0x10, 0x0a, 0x0e, 0x5f, + 0x72, 0x65, 0x76, 0x65, 0x72, 0x74, 0x5f, 0x72, 0x65, 0x61, 0x73, 0x6f, 0x6e, 0x1a, 0x31, 0x0a, + 0x06, 0x49, 0x6e, 0x76, 0x6f, 0x6b, 0x65, 0x12, 0x27, 0x0a, 0x06, 0x63, 0x6f, 0x6d, 0x6d, 0x6f, + 0x6e, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x0f, 0x2e, 0x52, 0x65, 0x63, 0x65, 0x69, 0x70, + 0x74, 0x2e, 0x43, 0x6f, 0x6d, 0x6d, 0x6f, 0x6e, 0x52, 0x06, 0x63, 0x6f, 0x6d, 0x6d, 0x6f, 0x6e, + 0x1a, 0x56, 0x0a, 0x09, 0x4c, 0x31, 0x48, 0x61, 0x6e, 0x64, 0x6c, 0x65, 0x72, 0x12, 0x27, 0x0a, + 0x06, 0x63, 0x6f, 0x6d, 0x6d, 0x6f, 0x6e, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x0f, 0x2e, + 0x52, 0x65, 0x63, 0x65, 0x69, 0x70, 0x74, 0x2e, 0x43, 0x6f, 0x6d, 0x6d, 0x6f, 0x6e, 0x52, 0x06, + 0x63, 0x6f, 0x6d, 0x6d, 0x6f, 0x6e, 0x12, 0x20, 0x0a, 0x08, 0x6d, 0x73, 0x67, 0x5f, 0x68, 0x61, + 0x73, 0x68, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x05, 0x2e, 0x48, 0x61, 0x73, 0x68, 0x52, + 0x07, 0x6d, 0x73, 0x67, 0x48, 0x61, 0x73, 0x68, 0x1a, 0x32, 0x0a, 0x07, 0x44, 0x65, 0x63, 0x6c, + 0x61, 0x72, 0x65, 0x12, 0x27, 0x0a, 0x06, 0x63, 0x6f, 0x6d, 0x6d, 0x6f, 0x6e, 0x18, 0x01, 0x20, + 0x01, 0x28, 0x0b, 0x32, 0x0f, 0x2e, 0x52, 0x65, 0x63, 0x65, 0x69, 0x70, 0x74, 0x2e, 0x43, 0x6f, + 0x6d, 0x6d, 0x6f, 0x6e, 0x52, 0x06, 0x63, 0x6f, 0x6d, 0x6d, 0x6f, 0x6e, 0x1a, 0x66, 0x0a, 0x06, + 0x44, 0x65, 0x70, 0x6c, 0x6f, 0x79, 0x12, 0x27, 0x0a, 0x06, 0x63, 0x6f, 0x6d, 0x6d, 0x6f, 0x6e, + 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x0f, 0x2e, 0x52, 0x65, 0x63, 0x65, 0x69, 0x70, 0x74, + 0x2e, 0x43, 0x6f, 0x6d, 0x6d, 0x6f, 0x6e, 0x52, 0x06, 0x63, 0x6f, 0x6d, 0x6d, 0x6f, 0x6e, 0x12, + 0x33, 0x0a, 0x10, 0x63, 0x6f, 0x6e, 0x74, 0x72, 0x61, 0x63, 0x74, 0x5f, 0x61, 0x64, 0x64, 0x72, + 0x65, 0x73, 0x73, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x08, 0x2e, 0x46, 0x65, 0x6c, 0x74, + 0x32, 0x35, 0x32, 0x52, 0x0f, 0x63, 0x6f, 0x6e, 0x74, 0x72, 0x61, 0x63, 0x74, 0x41, 0x64, 0x64, + 0x72, 0x65, 0x73, 0x73, 0x1a, 0x6d, 0x0a, 0x0d, 0x44, 0x65, 0x70, 0x6c, 0x6f, 0x79, 0x41, 0x63, + 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x12, 0x27, 0x0a, 0x06, 0x63, 0x6f, 0x6d, 0x6d, 0x6f, 0x6e, 0x18, + 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x0f, 0x2e, 0x52, 0x65, 0x63, 0x65, 0x69, 0x70, 0x74, 0x2e, + 0x43, 0x6f, 0x6d, 0x6d, 0x6f, 0x6e, 0x52, 0x06, 0x63, 0x6f, 0x6d, 0x6d, 0x6f, 0x6e, 0x12, 0x33, + 0x0a, 0x10, 0x63, 0x6f, 0x6e, 0x74, 0x72, 0x61, 0x63, 0x74, 0x5f, 0x61, 0x64, 0x64, 0x72, 0x65, + 0x73, 0x73, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x08, 0x2e, 0x46, 0x65, 0x6c, 0x74, 0x32, + 0x35, 0x32, 0x52, 0x0f, 0x63, 0x6f, 0x6e, 0x74, 0x72, 0x61, 0x63, 0x74, 0x41, 0x64, 0x64, 0x72, + 0x65, 0x73, 0x73, 0x42, 0x06, 0x0a, 0x04, 0x74, 0x79, 0x70, 0x65, 0x2a, 0x1d, 0x0a, 0x09, 0x50, + 0x72, 0x69, 0x63, 0x65, 0x55, 0x6e, 0x69, 0x74, 0x12, 0x07, 0x0a, 0x03, 0x57, 0x65, 0x69, 0x10, + 0x00, 0x12, 0x07, 0x0a, 0x03, 0x46, 0x72, 0x69, 0x10, 0x01, 0x42, 0x31, 0x5a, 0x2f, 0x67, 0x69, + 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x4e, 0x65, 0x74, 0x68, 0x65, 0x72, 0x6d, + 0x69, 0x6e, 0x64, 0x45, 0x74, 0x68, 0x2f, 0x6a, 0x75, 0x6e, 0x6f, 0x2f, 0x70, 0x32, 0x70, 0x2f, + 0x73, 0x74, 0x61, 0x72, 0x6b, 0x6e, 0x65, 0x74, 0x2f, 0x73, 0x70, 0x65, 0x63, 0x62, 0x06, 0x70, + 0x72, 0x6f, 0x74, 0x6f, 0x33, } var ( @@ -1068,59 +949,54 @@ func file_p2p_proto_receipt_proto_rawDescGZIP() []byte { } var ( - file_p2p_proto_receipt_proto_msgTypes = make([]protoimpl.MessageInfo, 14) - file_p2p_proto_receipt_proto_goTypes = []interface{}{ - (*MessageToL1)(nil), // 0: MessageToL1 - (*EthereumAddress)(nil), // 1: EthereumAddress - (*Receipt)(nil), // 2: Receipt - (*ReceiptsRequest)(nil), // 3: ReceiptsRequest - (*Receipts)(nil), // 4: Receipts - (*ReceiptsResponse)(nil), // 5: ReceiptsResponse - (*Receipt_ExecutionResources)(nil), // 6: Receipt.ExecutionResources - (*Receipt_Common)(nil), // 7: Receipt.Common - (*Receipt_Invoke)(nil), // 8: Receipt.Invoke - (*Receipt_L1Handler)(nil), // 9: Receipt.L1Handler - (*Receipt_Declare)(nil), // 10: Receipt.Declare - (*Receipt_Deploy)(nil), // 11: Receipt.Deploy - (*Receipt_DeployAccount)(nil), // 12: Receipt.DeployAccount - (*Receipt_ExecutionResources_BuiltinCounter)(nil), // 13: Receipt.ExecutionResources.BuiltinCounter - (*Felt252)(nil), // 14: Felt252 - (*Iteration)(nil), // 15: Iteration - (*Fin)(nil), // 16: Fin - (*Hash)(nil), // 17: Hash + file_p2p_proto_receipt_proto_enumTypes = make([]protoimpl.EnumInfo, 1) + file_p2p_proto_receipt_proto_msgTypes = make([]protoimpl.MessageInfo, 11) + file_p2p_proto_receipt_proto_goTypes = []interface{}{ + (PriceUnit)(0), // 0: PriceUnit + (*MessageToL1)(nil), // 1: MessageToL1 + (*EthereumAddress)(nil), // 2: EthereumAddress + (*Receipt)(nil), // 3: Receipt + (*Receipt_ExecutionResources)(nil), // 4: Receipt.ExecutionResources + (*Receipt_Common)(nil), // 5: Receipt.Common + (*Receipt_Invoke)(nil), // 6: Receipt.Invoke + (*Receipt_L1Handler)(nil), // 7: Receipt.L1Handler + (*Receipt_Declare)(nil), // 8: Receipt.Declare + (*Receipt_Deploy)(nil), // 9: Receipt.Deploy + (*Receipt_DeployAccount)(nil), // 10: Receipt.DeployAccount + (*Receipt_ExecutionResources_BuiltinCounter)(nil), // 11: Receipt.ExecutionResources.BuiltinCounter + (*Felt252)(nil), // 12: Felt252 + (*Hash)(nil), // 13: Hash } ) var file_p2p_proto_receipt_proto_depIdxs = []int32{ - 14, // 0: MessageToL1.from_address:type_name -> Felt252 - 14, // 1: MessageToL1.payload:type_name -> Felt252 - 1, // 2: MessageToL1.to_address:type_name -> EthereumAddress - 8, // 3: Receipt.invoke:type_name -> Receipt.Invoke - 9, // 4: Receipt.l1_handler:type_name -> Receipt.L1Handler - 10, // 5: Receipt.declare:type_name -> Receipt.Declare - 11, // 6: Receipt.deprecated_deploy:type_name -> Receipt.Deploy - 12, // 7: Receipt.deploy_account:type_name -> Receipt.DeployAccount - 15, // 8: ReceiptsRequest.iteration:type_name -> Iteration - 2, // 9: Receipts.items:type_name -> Receipt - 2, // 10: ReceiptsResponse.receipt:type_name -> Receipt - 16, // 11: ReceiptsResponse.fin:type_name -> Fin - 13, // 12: Receipt.ExecutionResources.builtins:type_name -> Receipt.ExecutionResources.BuiltinCounter - 17, // 13: Receipt.Common.transaction_hash:type_name -> Hash - 14, // 14: Receipt.Common.actual_fee:type_name -> Felt252 - 0, // 15: Receipt.Common.messages_sent:type_name -> MessageToL1 - 6, // 16: Receipt.Common.execution_resources:type_name -> Receipt.ExecutionResources - 7, // 17: Receipt.Invoke.common:type_name -> Receipt.Common - 7, // 18: Receipt.L1Handler.common:type_name -> Receipt.Common - 17, // 19: Receipt.L1Handler.msg_hash:type_name -> Hash - 7, // 20: Receipt.Declare.common:type_name -> Receipt.Common - 7, // 21: Receipt.Deploy.common:type_name -> Receipt.Common - 14, // 22: Receipt.Deploy.contract_address:type_name -> Felt252 - 7, // 23: Receipt.DeployAccount.common:type_name -> Receipt.Common - 14, // 24: Receipt.DeployAccount.contract_address:type_name -> Felt252 - 25, // [25:25] is the sub-list for method output_type - 25, // [25:25] is the sub-list for method input_type - 25, // [25:25] is the sub-list for extension type_name - 25, // [25:25] is the sub-list for extension extendee - 0, // [0:25] is the sub-list for field type_name + 12, // 0: MessageToL1.from_address:type_name -> Felt252 + 12, // 1: MessageToL1.payload:type_name -> Felt252 + 2, // 2: MessageToL1.to_address:type_name -> EthereumAddress + 6, // 3: Receipt.invoke:type_name -> Receipt.Invoke + 7, // 4: Receipt.l1_handler:type_name -> Receipt.L1Handler + 8, // 5: Receipt.declare:type_name -> Receipt.Declare + 9, // 6: Receipt.deprecated_deploy:type_name -> Receipt.Deploy + 10, // 7: Receipt.deploy_account:type_name -> Receipt.DeployAccount + 11, // 8: Receipt.ExecutionResources.builtins:type_name -> Receipt.ExecutionResources.BuiltinCounter + 12, // 9: Receipt.ExecutionResources.l1_gas:type_name -> Felt252 + 12, // 10: Receipt.ExecutionResources.l1_data_gas:type_name -> Felt252 + 12, // 11: Receipt.Common.actual_fee:type_name -> Felt252 + 0, // 12: Receipt.Common.price_unit:type_name -> PriceUnit + 1, // 13: Receipt.Common.messages_sent:type_name -> MessageToL1 + 4, // 14: Receipt.Common.execution_resources:type_name -> Receipt.ExecutionResources + 5, // 15: Receipt.Invoke.common:type_name -> Receipt.Common + 5, // 16: Receipt.L1Handler.common:type_name -> Receipt.Common + 13, // 17: Receipt.L1Handler.msg_hash:type_name -> Hash + 5, // 18: Receipt.Declare.common:type_name -> Receipt.Common + 5, // 19: Receipt.Deploy.common:type_name -> Receipt.Common + 12, // 20: Receipt.Deploy.contract_address:type_name -> Felt252 + 5, // 21: Receipt.DeployAccount.common:type_name -> Receipt.Common + 12, // 22: Receipt.DeployAccount.contract_address:type_name -> Felt252 + 23, // [23:23] is the sub-list for method output_type + 23, // [23:23] is the sub-list for method input_type + 23, // [23:23] is the sub-list for extension type_name + 23, // [23:23] is the sub-list for extension extendee + 0, // [0:23] is the sub-list for field type_name } func init() { file_p2p_proto_receipt_proto_init() } @@ -1167,42 +1043,6 @@ func file_p2p_proto_receipt_proto_init() { } } file_p2p_proto_receipt_proto_msgTypes[3].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*ReceiptsRequest); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_p2p_proto_receipt_proto_msgTypes[4].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*Receipts); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_p2p_proto_receipt_proto_msgTypes[5].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*ReceiptsResponse); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_p2p_proto_receipt_proto_msgTypes[6].Exporter = func(v interface{}, i int) interface{} { switch v := v.(*Receipt_ExecutionResources); i { case 0: return &v.state @@ -1214,7 +1054,7 @@ func file_p2p_proto_receipt_proto_init() { return nil } } - file_p2p_proto_receipt_proto_msgTypes[7].Exporter = func(v interface{}, i int) interface{} { + file_p2p_proto_receipt_proto_msgTypes[4].Exporter = func(v interface{}, i int) interface{} { switch v := v.(*Receipt_Common); i { case 0: return &v.state @@ -1226,7 +1066,7 @@ func file_p2p_proto_receipt_proto_init() { return nil } } - file_p2p_proto_receipt_proto_msgTypes[8].Exporter = func(v interface{}, i int) interface{} { + file_p2p_proto_receipt_proto_msgTypes[5].Exporter = func(v interface{}, i int) interface{} { switch v := v.(*Receipt_Invoke); i { case 0: return &v.state @@ -1238,7 +1078,7 @@ func file_p2p_proto_receipt_proto_init() { return nil } } - file_p2p_proto_receipt_proto_msgTypes[9].Exporter = func(v interface{}, i int) interface{} { + file_p2p_proto_receipt_proto_msgTypes[6].Exporter = func(v interface{}, i int) interface{} { switch v := v.(*Receipt_L1Handler); i { case 0: return &v.state @@ -1250,7 +1090,7 @@ func file_p2p_proto_receipt_proto_init() { return nil } } - file_p2p_proto_receipt_proto_msgTypes[10].Exporter = func(v interface{}, i int) interface{} { + file_p2p_proto_receipt_proto_msgTypes[7].Exporter = func(v interface{}, i int) interface{} { switch v := v.(*Receipt_Declare); i { case 0: return &v.state @@ -1262,7 +1102,7 @@ func file_p2p_proto_receipt_proto_init() { return nil } } - file_p2p_proto_receipt_proto_msgTypes[11].Exporter = func(v interface{}, i int) interface{} { + file_p2p_proto_receipt_proto_msgTypes[8].Exporter = func(v interface{}, i int) interface{} { switch v := v.(*Receipt_Deploy); i { case 0: return &v.state @@ -1274,7 +1114,7 @@ func file_p2p_proto_receipt_proto_init() { return nil } } - file_p2p_proto_receipt_proto_msgTypes[12].Exporter = func(v interface{}, i int) interface{} { + file_p2p_proto_receipt_proto_msgTypes[9].Exporter = func(v interface{}, i int) interface{} { switch v := v.(*Receipt_DeployAccount); i { case 0: return &v.state @@ -1286,7 +1126,7 @@ func file_p2p_proto_receipt_proto_init() { return nil } } - file_p2p_proto_receipt_proto_msgTypes[13].Exporter = func(v interface{}, i int) interface{} { + file_p2p_proto_receipt_proto_msgTypes[10].Exporter = func(v interface{}, i int) interface{} { switch v := v.(*Receipt_ExecutionResources_BuiltinCounter); i { case 0: return &v.state @@ -1306,22 +1146,20 @@ func file_p2p_proto_receipt_proto_init() { (*Receipt_DeprecatedDeploy)(nil), (*Receipt_DeployAccount_)(nil), } - file_p2p_proto_receipt_proto_msgTypes[5].OneofWrappers = []interface{}{ - (*ReceiptsResponse_Receipt)(nil), - (*ReceiptsResponse_Fin)(nil), - } + file_p2p_proto_receipt_proto_msgTypes[4].OneofWrappers = []interface{}{} type x struct{} out := protoimpl.TypeBuilder{ File: protoimpl.DescBuilder{ GoPackagePath: reflect.TypeOf(x{}).PkgPath(), RawDescriptor: file_p2p_proto_receipt_proto_rawDesc, - NumEnums: 0, - NumMessages: 14, + NumEnums: 1, + NumMessages: 11, NumExtensions: 0, NumServices: 0, }, GoTypes: file_p2p_proto_receipt_proto_goTypes, DependencyIndexes: file_p2p_proto_receipt_proto_depIdxs, + EnumInfos: file_p2p_proto_receipt_proto_enumTypes, MessageInfos: file_p2p_proto_receipt_proto_msgTypes, }.Build() File_p2p_proto_receipt_proto = out.File diff --git a/p2p/starknet/spec/state.pb.go b/p2p/starknet/spec/state.pb.go index 6e08325842..ec257fba0e 100644 --- a/p2p/starknet/spec/state.pb.go +++ b/p2p/starknet/spec/state.pb.go @@ -82,12 +82,11 @@ type ContractDiff struct { sizeCache protoimpl.SizeCache unknownFields protoimpl.UnknownFields - Address *Address `protobuf:"bytes,1,opt,name=address,proto3" json:"address,omitempty"` - Nonce *Felt252 `protobuf:"bytes,2,opt,name=nonce,proto3,oneof" json:"nonce,omitempty"` // Present only if the nonce was updated - ClassHash *Hash `protobuf:"bytes,3,opt,name=class_hash,json=classHash,proto3,oneof" json:"class_hash,omitempty"` // Present only if the contract was deployed or replaced in this block. - IsReplaced *bool `protobuf:"varint,4,opt,name=is_replaced,json=isReplaced,proto3,oneof" json:"is_replaced,omitempty"` // Present only if the contract was deployed or replaced, in order to determine whether the contract was deployed or replaced. - Values []*ContractStoredValue `protobuf:"bytes,5,rep,name=values,proto3" json:"values,omitempty"` - Domain uint32 `protobuf:"varint,6,opt,name=domain,proto3" json:"domain,omitempty"` // volition state domain + Address *Address `protobuf:"bytes,1,opt,name=address,proto3" json:"address,omitempty"` + Nonce *Felt252 `protobuf:"bytes,2,opt,name=nonce,proto3,oneof" json:"nonce,omitempty"` // Present only if the nonce was updated + ClassHash *Hash `protobuf:"bytes,3,opt,name=class_hash,json=classHash,proto3,oneof" json:"class_hash,omitempty"` // Present only if the contract was deployed or replaced in this block. + Values []*ContractStoredValue `protobuf:"bytes,4,rep,name=values,proto3" json:"values,omitempty"` + Domain VolitionDomain `protobuf:"varint,5,opt,name=domain,proto3,enum=VolitionDomain" json:"domain,omitempty"` } func (x *ContractDiff) Reset() { @@ -143,13 +142,6 @@ func (x *ContractDiff) GetClassHash() *Hash { return nil } -func (x *ContractDiff) GetIsReplaced() bool { - if x != nil && x.IsReplaced != nil { - return *x.IsReplaced - } - return false -} - func (x *ContractDiff) GetValues() []*ContractStoredValue { if x != nil { return x.Values @@ -157,11 +149,66 @@ func (x *ContractDiff) GetValues() []*ContractStoredValue { return nil } -func (x *ContractDiff) GetDomain() uint32 { +func (x *ContractDiff) GetDomain() VolitionDomain { if x != nil { return x.Domain } - return 0 + return VolitionDomain_L1 +} + +type DeclaredClass struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + ClassHash *Hash `protobuf:"bytes,1,opt,name=class_hash,json=classHash,proto3" json:"class_hash,omitempty"` + CompiledClassHash *Hash `protobuf:"bytes,2,opt,name=compiled_class_hash,json=compiledClassHash,proto3,oneof" json:"compiled_class_hash,omitempty"` // Present only if the class is Cairo1 +} + +func (x *DeclaredClass) Reset() { + *x = DeclaredClass{} + if protoimpl.UnsafeEnabled { + mi := &file_p2p_proto_state_proto_msgTypes[2] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *DeclaredClass) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*DeclaredClass) ProtoMessage() {} + +func (x *DeclaredClass) ProtoReflect() protoreflect.Message { + mi := &file_p2p_proto_state_proto_msgTypes[2] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use DeclaredClass.ProtoReflect.Descriptor instead. +func (*DeclaredClass) Descriptor() ([]byte, []int) { + return file_p2p_proto_state_proto_rawDescGZIP(), []int{2} +} + +func (x *DeclaredClass) GetClassHash() *Hash { + if x != nil { + return x.ClassHash + } + return nil +} + +func (x *DeclaredClass) GetCompiledClassHash() *Hash { + if x != nil { + return x.CompiledClassHash + } + return nil } type StateDiffsRequest struct { @@ -175,7 +222,7 @@ type StateDiffsRequest struct { func (x *StateDiffsRequest) Reset() { *x = StateDiffsRequest{} if protoimpl.UnsafeEnabled { - mi := &file_p2p_proto_state_proto_msgTypes[2] + mi := &file_p2p_proto_state_proto_msgTypes[3] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -188,7 +235,7 @@ func (x *StateDiffsRequest) String() string { func (*StateDiffsRequest) ProtoMessage() {} func (x *StateDiffsRequest) ProtoReflect() protoreflect.Message { - mi := &file_p2p_proto_state_proto_msgTypes[2] + mi := &file_p2p_proto_state_proto_msgTypes[3] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -201,7 +248,7 @@ func (x *StateDiffsRequest) ProtoReflect() protoreflect.Message { // Deprecated: Use StateDiffsRequest.ProtoReflect.Descriptor instead. func (*StateDiffsRequest) Descriptor() ([]byte, []int) { - return file_p2p_proto_state_proto_rawDescGZIP(), []int{2} + return file_p2p_proto_state_proto_rawDescGZIP(), []int{3} } func (x *StateDiffsRequest) GetIteration() *Iteration { @@ -222,6 +269,7 @@ type StateDiffsResponse struct { // Types that are assignable to StateDiffMessage: // // *StateDiffsResponse_ContractDiff + // *StateDiffsResponse_DeclaredClass // *StateDiffsResponse_Fin StateDiffMessage isStateDiffsResponse_StateDiffMessage `protobuf_oneof:"state_diff_message"` } @@ -229,7 +277,7 @@ type StateDiffsResponse struct { func (x *StateDiffsResponse) Reset() { *x = StateDiffsResponse{} if protoimpl.UnsafeEnabled { - mi := &file_p2p_proto_state_proto_msgTypes[3] + mi := &file_p2p_proto_state_proto_msgTypes[4] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -242,7 +290,7 @@ func (x *StateDiffsResponse) String() string { func (*StateDiffsResponse) ProtoMessage() {} func (x *StateDiffsResponse) ProtoReflect() protoreflect.Message { - mi := &file_p2p_proto_state_proto_msgTypes[3] + mi := &file_p2p_proto_state_proto_msgTypes[4] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -255,7 +303,7 @@ func (x *StateDiffsResponse) ProtoReflect() protoreflect.Message { // Deprecated: Use StateDiffsResponse.ProtoReflect.Descriptor instead. func (*StateDiffsResponse) Descriptor() ([]byte, []int) { - return file_p2p_proto_state_proto_rawDescGZIP(), []int{3} + return file_p2p_proto_state_proto_rawDescGZIP(), []int{4} } func (m *StateDiffsResponse) GetStateDiffMessage() isStateDiffsResponse_StateDiffMessage { @@ -272,6 +320,13 @@ func (x *StateDiffsResponse) GetContractDiff() *ContractDiff { return nil } +func (x *StateDiffsResponse) GetDeclaredClass() *DeclaredClass { + if x, ok := x.GetStateDiffMessage().(*StateDiffsResponse_DeclaredClass); ok { + return x.DeclaredClass + } + return nil +} + func (x *StateDiffsResponse) GetFin() *Fin { if x, ok := x.GetStateDiffMessage().(*StateDiffsResponse_Fin); ok { return x.Fin @@ -284,15 +339,21 @@ type isStateDiffsResponse_StateDiffMessage interface { } type StateDiffsResponse_ContractDiff struct { - ContractDiff *ContractDiff `protobuf:"bytes,1,opt,name=contract_diff,json=contractDiff,proto3,oneof"` // Multiple contract diffs for the same contract may appear continuously if the diff is too large. + ContractDiff *ContractDiff `protobuf:"bytes,1,opt,name=contract_diff,json=contractDiff,proto3,oneof"` // Multiple contract diffs for the same contract may appear continuously if the diff is too large or if it's more convenient. +} + +type StateDiffsResponse_DeclaredClass struct { + DeclaredClass *DeclaredClass `protobuf:"bytes,2,opt,name=declared_class,json=declaredClass,proto3,oneof"` } type StateDiffsResponse_Fin struct { - Fin *Fin `protobuf:"bytes,2,opt,name=fin,proto3,oneof"` // Fin is sent after the peer sent all the data or when it encountered a block that it doesn't have its state diff. + Fin *Fin `protobuf:"bytes,3,opt,name=fin,proto3,oneof"` // Fin is sent after the peer sent all the data or when it encountered a block that it doesn't have its state diff. } func (*StateDiffsResponse_ContractDiff) isStateDiffsResponse_StateDiffMessage() {} +func (*StateDiffsResponse_DeclaredClass) isStateDiffsResponse_StateDiffMessage() {} + func (*StateDiffsResponse_Fin) isStateDiffsResponse_StateDiffMessage() {} var File_p2p_proto_state_proto protoreflect.FileDescriptor @@ -306,7 +367,7 @@ var file_p2p_proto_state_proto_rawDesc = []byte{ 0x01, 0x28, 0x0b, 0x32, 0x08, 0x2e, 0x46, 0x65, 0x6c, 0x74, 0x32, 0x35, 0x32, 0x52, 0x03, 0x6b, 0x65, 0x79, 0x12, 0x1e, 0x0a, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x08, 0x2e, 0x46, 0x65, 0x6c, 0x74, 0x32, 0x35, 0x32, 0x52, 0x05, 0x76, 0x61, 0x6c, - 0x75, 0x65, 0x22, 0x97, 0x02, 0x0a, 0x0c, 0x43, 0x6f, 0x6e, 0x74, 0x72, 0x61, 0x63, 0x74, 0x44, + 0x75, 0x65, 0x22, 0xf2, 0x01, 0x0a, 0x0c, 0x43, 0x6f, 0x6e, 0x74, 0x72, 0x61, 0x63, 0x74, 0x44, 0x69, 0x66, 0x66, 0x12, 0x22, 0x0a, 0x07, 0x61, 0x64, 0x64, 0x72, 0x65, 0x73, 0x73, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x08, 0x2e, 0x41, 0x64, 0x64, 0x72, 0x65, 0x73, 0x73, 0x52, 0x07, 0x61, 0x64, 0x64, 0x72, 0x65, 0x73, 0x73, 0x12, 0x23, 0x0a, 0x05, 0x6e, 0x6f, 0x6e, 0x63, 0x65, @@ -314,32 +375,42 @@ var file_p2p_proto_state_proto_rawDesc = []byte{ 0x48, 0x00, 0x52, 0x05, 0x6e, 0x6f, 0x6e, 0x63, 0x65, 0x88, 0x01, 0x01, 0x12, 0x29, 0x0a, 0x0a, 0x63, 0x6c, 0x61, 0x73, 0x73, 0x5f, 0x68, 0x61, 0x73, 0x68, 0x18, 0x03, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x05, 0x2e, 0x48, 0x61, 0x73, 0x68, 0x48, 0x01, 0x52, 0x09, 0x63, 0x6c, 0x61, 0x73, 0x73, - 0x48, 0x61, 0x73, 0x68, 0x88, 0x01, 0x01, 0x12, 0x24, 0x0a, 0x0b, 0x69, 0x73, 0x5f, 0x72, 0x65, - 0x70, 0x6c, 0x61, 0x63, 0x65, 0x64, 0x18, 0x04, 0x20, 0x01, 0x28, 0x08, 0x48, 0x02, 0x52, 0x0a, - 0x69, 0x73, 0x52, 0x65, 0x70, 0x6c, 0x61, 0x63, 0x65, 0x64, 0x88, 0x01, 0x01, 0x12, 0x2c, 0x0a, - 0x06, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x73, 0x18, 0x05, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x14, 0x2e, - 0x43, 0x6f, 0x6e, 0x74, 0x72, 0x61, 0x63, 0x74, 0x53, 0x74, 0x6f, 0x72, 0x65, 0x64, 0x56, 0x61, - 0x6c, 0x75, 0x65, 0x52, 0x06, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x73, 0x12, 0x16, 0x0a, 0x06, 0x64, - 0x6f, 0x6d, 0x61, 0x69, 0x6e, 0x18, 0x06, 0x20, 0x01, 0x28, 0x0d, 0x52, 0x06, 0x64, 0x6f, 0x6d, - 0x61, 0x69, 0x6e, 0x42, 0x08, 0x0a, 0x06, 0x5f, 0x6e, 0x6f, 0x6e, 0x63, 0x65, 0x42, 0x0d, 0x0a, - 0x0b, 0x5f, 0x63, 0x6c, 0x61, 0x73, 0x73, 0x5f, 0x68, 0x61, 0x73, 0x68, 0x42, 0x0e, 0x0a, 0x0c, - 0x5f, 0x69, 0x73, 0x5f, 0x72, 0x65, 0x70, 0x6c, 0x61, 0x63, 0x65, 0x64, 0x22, 0x3d, 0x0a, 0x11, - 0x53, 0x74, 0x61, 0x74, 0x65, 0x44, 0x69, 0x66, 0x66, 0x73, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, - 0x74, 0x12, 0x28, 0x0a, 0x09, 0x69, 0x74, 0x65, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x18, 0x01, - 0x20, 0x01, 0x28, 0x0b, 0x32, 0x0a, 0x2e, 0x49, 0x74, 0x65, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, - 0x52, 0x09, 0x69, 0x74, 0x65, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x22, 0x7a, 0x0a, 0x12, 0x53, - 0x74, 0x61, 0x74, 0x65, 0x44, 0x69, 0x66, 0x66, 0x73, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, - 0x65, 0x12, 0x34, 0x0a, 0x0d, 0x63, 0x6f, 0x6e, 0x74, 0x72, 0x61, 0x63, 0x74, 0x5f, 0x64, 0x69, - 0x66, 0x66, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x0d, 0x2e, 0x43, 0x6f, 0x6e, 0x74, 0x72, - 0x61, 0x63, 0x74, 0x44, 0x69, 0x66, 0x66, 0x48, 0x00, 0x52, 0x0c, 0x63, 0x6f, 0x6e, 0x74, 0x72, - 0x61, 0x63, 0x74, 0x44, 0x69, 0x66, 0x66, 0x12, 0x18, 0x0a, 0x03, 0x66, 0x69, 0x6e, 0x18, 0x02, - 0x20, 0x01, 0x28, 0x0b, 0x32, 0x04, 0x2e, 0x46, 0x69, 0x6e, 0x48, 0x00, 0x52, 0x03, 0x66, 0x69, - 0x6e, 0x42, 0x14, 0x0a, 0x12, 0x73, 0x74, 0x61, 0x74, 0x65, 0x5f, 0x64, 0x69, 0x66, 0x66, 0x5f, - 0x6d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x42, 0x31, 0x5a, 0x2f, 0x67, 0x69, 0x74, 0x68, 0x75, - 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x4e, 0x65, 0x74, 0x68, 0x65, 0x72, 0x6d, 0x69, 0x6e, 0x64, - 0x45, 0x74, 0x68, 0x2f, 0x6a, 0x75, 0x6e, 0x6f, 0x2f, 0x70, 0x32, 0x70, 0x2f, 0x73, 0x74, 0x61, - 0x72, 0x6b, 0x6e, 0x65, 0x74, 0x2f, 0x73, 0x70, 0x65, 0x63, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, - 0x6f, 0x33, + 0x48, 0x61, 0x73, 0x68, 0x88, 0x01, 0x01, 0x12, 0x2c, 0x0a, 0x06, 0x76, 0x61, 0x6c, 0x75, 0x65, + 0x73, 0x18, 0x04, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x14, 0x2e, 0x43, 0x6f, 0x6e, 0x74, 0x72, 0x61, + 0x63, 0x74, 0x53, 0x74, 0x6f, 0x72, 0x65, 0x64, 0x56, 0x61, 0x6c, 0x75, 0x65, 0x52, 0x06, 0x76, + 0x61, 0x6c, 0x75, 0x65, 0x73, 0x12, 0x27, 0x0a, 0x06, 0x64, 0x6f, 0x6d, 0x61, 0x69, 0x6e, 0x18, + 0x05, 0x20, 0x01, 0x28, 0x0e, 0x32, 0x0f, 0x2e, 0x56, 0x6f, 0x6c, 0x69, 0x74, 0x69, 0x6f, 0x6e, + 0x44, 0x6f, 0x6d, 0x61, 0x69, 0x6e, 0x52, 0x06, 0x64, 0x6f, 0x6d, 0x61, 0x69, 0x6e, 0x42, 0x08, + 0x0a, 0x06, 0x5f, 0x6e, 0x6f, 0x6e, 0x63, 0x65, 0x42, 0x0d, 0x0a, 0x0b, 0x5f, 0x63, 0x6c, 0x61, + 0x73, 0x73, 0x5f, 0x68, 0x61, 0x73, 0x68, 0x22, 0x89, 0x01, 0x0a, 0x0d, 0x44, 0x65, 0x63, 0x6c, + 0x61, 0x72, 0x65, 0x64, 0x43, 0x6c, 0x61, 0x73, 0x73, 0x12, 0x24, 0x0a, 0x0a, 0x63, 0x6c, 0x61, + 0x73, 0x73, 0x5f, 0x68, 0x61, 0x73, 0x68, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x05, 0x2e, + 0x48, 0x61, 0x73, 0x68, 0x52, 0x09, 0x63, 0x6c, 0x61, 0x73, 0x73, 0x48, 0x61, 0x73, 0x68, 0x12, + 0x3a, 0x0a, 0x13, 0x63, 0x6f, 0x6d, 0x70, 0x69, 0x6c, 0x65, 0x64, 0x5f, 0x63, 0x6c, 0x61, 0x73, + 0x73, 0x5f, 0x68, 0x61, 0x73, 0x68, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x05, 0x2e, 0x48, + 0x61, 0x73, 0x68, 0x48, 0x00, 0x52, 0x11, 0x63, 0x6f, 0x6d, 0x70, 0x69, 0x6c, 0x65, 0x64, 0x43, + 0x6c, 0x61, 0x73, 0x73, 0x48, 0x61, 0x73, 0x68, 0x88, 0x01, 0x01, 0x42, 0x16, 0x0a, 0x14, 0x5f, + 0x63, 0x6f, 0x6d, 0x70, 0x69, 0x6c, 0x65, 0x64, 0x5f, 0x63, 0x6c, 0x61, 0x73, 0x73, 0x5f, 0x68, + 0x61, 0x73, 0x68, 0x22, 0x3d, 0x0a, 0x11, 0x53, 0x74, 0x61, 0x74, 0x65, 0x44, 0x69, 0x66, 0x66, + 0x73, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x28, 0x0a, 0x09, 0x69, 0x74, 0x65, 0x72, + 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x0a, 0x2e, 0x49, 0x74, + 0x65, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x52, 0x09, 0x69, 0x74, 0x65, 0x72, 0x61, 0x74, 0x69, + 0x6f, 0x6e, 0x22, 0xb3, 0x01, 0x0a, 0x12, 0x53, 0x74, 0x61, 0x74, 0x65, 0x44, 0x69, 0x66, 0x66, + 0x73, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x34, 0x0a, 0x0d, 0x63, 0x6f, 0x6e, + 0x74, 0x72, 0x61, 0x63, 0x74, 0x5f, 0x64, 0x69, 0x66, 0x66, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, + 0x32, 0x0d, 0x2e, 0x43, 0x6f, 0x6e, 0x74, 0x72, 0x61, 0x63, 0x74, 0x44, 0x69, 0x66, 0x66, 0x48, + 0x00, 0x52, 0x0c, 0x63, 0x6f, 0x6e, 0x74, 0x72, 0x61, 0x63, 0x74, 0x44, 0x69, 0x66, 0x66, 0x12, + 0x37, 0x0a, 0x0e, 0x64, 0x65, 0x63, 0x6c, 0x61, 0x72, 0x65, 0x64, 0x5f, 0x63, 0x6c, 0x61, 0x73, + 0x73, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x0e, 0x2e, 0x44, 0x65, 0x63, 0x6c, 0x61, 0x72, + 0x65, 0x64, 0x43, 0x6c, 0x61, 0x73, 0x73, 0x48, 0x00, 0x52, 0x0d, 0x64, 0x65, 0x63, 0x6c, 0x61, + 0x72, 0x65, 0x64, 0x43, 0x6c, 0x61, 0x73, 0x73, 0x12, 0x18, 0x0a, 0x03, 0x66, 0x69, 0x6e, 0x18, + 0x03, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x04, 0x2e, 0x46, 0x69, 0x6e, 0x48, 0x00, 0x52, 0x03, 0x66, + 0x69, 0x6e, 0x42, 0x14, 0x0a, 0x12, 0x73, 0x74, 0x61, 0x74, 0x65, 0x5f, 0x64, 0x69, 0x66, 0x66, + 0x5f, 0x6d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x42, 0x31, 0x5a, 0x2f, 0x67, 0x69, 0x74, 0x68, + 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x4e, 0x65, 0x74, 0x68, 0x65, 0x72, 0x6d, 0x69, 0x6e, + 0x64, 0x45, 0x74, 0x68, 0x2f, 0x6a, 0x75, 0x6e, 0x6f, 0x2f, 0x70, 0x32, 0x70, 0x2f, 0x73, 0x74, + 0x61, 0x72, 0x6b, 0x6e, 0x65, 0x74, 0x2f, 0x73, 0x70, 0x65, 0x63, 0x62, 0x06, 0x70, 0x72, 0x6f, + 0x74, 0x6f, 0x33, } var ( @@ -355,34 +426,40 @@ func file_p2p_proto_state_proto_rawDescGZIP() []byte { } var ( - file_p2p_proto_state_proto_msgTypes = make([]protoimpl.MessageInfo, 4) + file_p2p_proto_state_proto_msgTypes = make([]protoimpl.MessageInfo, 5) file_p2p_proto_state_proto_goTypes = []interface{}{ (*ContractStoredValue)(nil), // 0: ContractStoredValue (*ContractDiff)(nil), // 1: ContractDiff - (*StateDiffsRequest)(nil), // 2: StateDiffsRequest - (*StateDiffsResponse)(nil), // 3: StateDiffsResponse - (*Felt252)(nil), // 4: Felt252 - (*Address)(nil), // 5: Address - (*Hash)(nil), // 6: Hash - (*Iteration)(nil), // 7: Iteration - (*Fin)(nil), // 8: Fin + (*DeclaredClass)(nil), // 2: DeclaredClass + (*StateDiffsRequest)(nil), // 3: StateDiffsRequest + (*StateDiffsResponse)(nil), // 4: StateDiffsResponse + (*Felt252)(nil), // 5: Felt252 + (*Address)(nil), // 6: Address + (*Hash)(nil), // 7: Hash + (VolitionDomain)(0), // 8: VolitionDomain + (*Iteration)(nil), // 9: Iteration + (*Fin)(nil), // 10: Fin } ) var file_p2p_proto_state_proto_depIdxs = []int32{ - 4, // 0: ContractStoredValue.key:type_name -> Felt252 - 4, // 1: ContractStoredValue.value:type_name -> Felt252 - 5, // 2: ContractDiff.address:type_name -> Address - 4, // 3: ContractDiff.nonce:type_name -> Felt252 - 6, // 4: ContractDiff.class_hash:type_name -> Hash - 0, // 5: ContractDiff.values:type_name -> ContractStoredValue - 7, // 6: StateDiffsRequest.iteration:type_name -> Iteration - 1, // 7: StateDiffsResponse.contract_diff:type_name -> ContractDiff - 8, // 8: StateDiffsResponse.fin:type_name -> Fin - 9, // [9:9] is the sub-list for method output_type - 9, // [9:9] is the sub-list for method input_type - 9, // [9:9] is the sub-list for extension type_name - 9, // [9:9] is the sub-list for extension extendee - 0, // [0:9] is the sub-list for field type_name + 5, // 0: ContractStoredValue.key:type_name -> Felt252 + 5, // 1: ContractStoredValue.value:type_name -> Felt252 + 6, // 2: ContractDiff.address:type_name -> Address + 5, // 3: ContractDiff.nonce:type_name -> Felt252 + 7, // 4: ContractDiff.class_hash:type_name -> Hash + 0, // 5: ContractDiff.values:type_name -> ContractStoredValue + 8, // 6: ContractDiff.domain:type_name -> VolitionDomain + 7, // 7: DeclaredClass.class_hash:type_name -> Hash + 7, // 8: DeclaredClass.compiled_class_hash:type_name -> Hash + 9, // 9: StateDiffsRequest.iteration:type_name -> Iteration + 1, // 10: StateDiffsResponse.contract_diff:type_name -> ContractDiff + 2, // 11: StateDiffsResponse.declared_class:type_name -> DeclaredClass + 10, // 12: StateDiffsResponse.fin:type_name -> Fin + 13, // [13:13] is the sub-list for method output_type + 13, // [13:13] is the sub-list for method input_type + 13, // [13:13] is the sub-list for extension type_name + 13, // [13:13] is the sub-list for extension extendee + 0, // [0:13] is the sub-list for field type_name } func init() { file_p2p_proto_state_proto_init() } @@ -417,7 +494,7 @@ func file_p2p_proto_state_proto_init() { } } file_p2p_proto_state_proto_msgTypes[2].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*StateDiffsRequest); i { + switch v := v.(*DeclaredClass); i { case 0: return &v.state case 1: @@ -429,6 +506,18 @@ func file_p2p_proto_state_proto_init() { } } file_p2p_proto_state_proto_msgTypes[3].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*StateDiffsRequest); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_p2p_proto_state_proto_msgTypes[4].Exporter = func(v interface{}, i int) interface{} { switch v := v.(*StateDiffsResponse); i { case 0: return &v.state @@ -442,8 +531,10 @@ func file_p2p_proto_state_proto_init() { } } file_p2p_proto_state_proto_msgTypes[1].OneofWrappers = []interface{}{} - file_p2p_proto_state_proto_msgTypes[3].OneofWrappers = []interface{}{ + file_p2p_proto_state_proto_msgTypes[2].OneofWrappers = []interface{}{} + file_p2p_proto_state_proto_msgTypes[4].OneofWrappers = []interface{}{ (*StateDiffsResponse_ContractDiff)(nil), + (*StateDiffsResponse_DeclaredClass)(nil), (*StateDiffsResponse_Fin)(nil), } type x struct{} @@ -452,7 +543,7 @@ func file_p2p_proto_state_proto_init() { GoPackagePath: reflect.TypeOf(x{}).PkgPath(), RawDescriptor: file_p2p_proto_state_proto_rawDesc, NumEnums: 0, - NumMessages: 4, + NumMessages: 5, NumExtensions: 0, NumServices: 0, }, diff --git a/p2p/starknet/spec/transaction.pb.go b/p2p/starknet/spec/transaction.pb.go index 207f8f5ab5..b6e1d2d94d 100644 --- a/p2p/starknet/spec/transaction.pb.go +++ b/p2p/starknet/spec/transaction.pb.go @@ -178,6 +178,8 @@ func (x *AccountSignature) GetParts() []*Felt252 { return nil } +// This is a transaction that is already accepted in a block. Once we have a mempool, we will define +// a separate message for BroadcastedTransaction. type Transaction struct { state protoimpl.MessageState sizeCache protoimpl.SizeCache @@ -196,8 +198,7 @@ type Transaction struct { // *Transaction_InvokeV1_ // *Transaction_InvokeV3_ // *Transaction_L1Handler - Txn isTransaction_Txn `protobuf_oneof:"txn"` - TransactionHash *Hash `protobuf:"bytes,12,opt,name=transaction_hash,json=transactionHash,proto3" json:"transaction_hash,omitempty"` + Txn isTransaction_Txn `protobuf_oneof:"txn"` } func (x *Transaction) Reset() { @@ -316,13 +317,6 @@ func (x *Transaction) GetL1Handler() *Transaction_L1HandlerV0 { return nil } -func (x *Transaction) GetTransactionHash() *Hash { - if x != nil { - return x.TransactionHash - } - return nil -} - type isTransaction_Txn interface { isTransaction_Txn() } @@ -393,6 +387,61 @@ func (*Transaction_InvokeV3_) isTransaction_Txn() {} func (*Transaction_L1Handler) isTransaction_Txn() {} +type TransactionWithReceipt struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Transaction *Transaction `protobuf:"bytes,1,opt,name=transaction,proto3" json:"transaction,omitempty"` + Receipt *Receipt `protobuf:"bytes,2,opt,name=receipt,proto3" json:"receipt,omitempty"` +} + +func (x *TransactionWithReceipt) Reset() { + *x = TransactionWithReceipt{} + if protoimpl.UnsafeEnabled { + mi := &file_p2p_proto_transaction_proto_msgTypes[4] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *TransactionWithReceipt) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*TransactionWithReceipt) ProtoMessage() {} + +func (x *TransactionWithReceipt) ProtoReflect() protoreflect.Message { + mi := &file_p2p_proto_transaction_proto_msgTypes[4] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use TransactionWithReceipt.ProtoReflect.Descriptor instead. +func (*TransactionWithReceipt) Descriptor() ([]byte, []int) { + return file_p2p_proto_transaction_proto_rawDescGZIP(), []int{4} +} + +func (x *TransactionWithReceipt) GetTransaction() *Transaction { + if x != nil { + return x.Transaction + } + return nil +} + +func (x *TransactionWithReceipt) GetReceipt() *Receipt { + if x != nil { + return x.Receipt + } + return nil +} + // TBD: can support a flag to return tx hashes only, good for standalone mempool to remove them, // or any node that keeps track of transaction streaming in the consensus. type TransactionsRequest struct { @@ -406,7 +455,7 @@ type TransactionsRequest struct { func (x *TransactionsRequest) Reset() { *x = TransactionsRequest{} if protoimpl.UnsafeEnabled { - mi := &file_p2p_proto_transaction_proto_msgTypes[4] + mi := &file_p2p_proto_transaction_proto_msgTypes[5] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -419,7 +468,7 @@ func (x *TransactionsRequest) String() string { func (*TransactionsRequest) ProtoMessage() {} func (x *TransactionsRequest) ProtoReflect() protoreflect.Message { - mi := &file_p2p_proto_transaction_proto_msgTypes[4] + mi := &file_p2p_proto_transaction_proto_msgTypes[5] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -432,7 +481,7 @@ func (x *TransactionsRequest) ProtoReflect() protoreflect.Message { // Deprecated: Use TransactionsRequest.ProtoReflect.Descriptor instead. func (*TransactionsRequest) Descriptor() ([]byte, []int) { - return file_p2p_proto_transaction_proto_rawDescGZIP(), []int{4} + return file_p2p_proto_transaction_proto_rawDescGZIP(), []int{5} } func (x *TransactionsRequest) GetIteration() *Iteration { @@ -442,7 +491,8 @@ func (x *TransactionsRequest) GetIteration() *Iteration { return nil } -// Responses are sent ordered by the order given in the request. +// Responses are sent ordered by the order given in the request. The order inside each block is +// according to the execution order. type TransactionsResponse struct { state protoimpl.MessageState sizeCache protoimpl.SizeCache @@ -450,7 +500,7 @@ type TransactionsResponse struct { // Types that are assignable to TransactionMessage: // - // *TransactionsResponse_Transaction + // *TransactionsResponse_TransactionWithReceipt // *TransactionsResponse_Fin TransactionMessage isTransactionsResponse_TransactionMessage `protobuf_oneof:"transaction_message"` } @@ -458,7 +508,7 @@ type TransactionsResponse struct { func (x *TransactionsResponse) Reset() { *x = TransactionsResponse{} if protoimpl.UnsafeEnabled { - mi := &file_p2p_proto_transaction_proto_msgTypes[5] + mi := &file_p2p_proto_transaction_proto_msgTypes[6] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -471,7 +521,7 @@ func (x *TransactionsResponse) String() string { func (*TransactionsResponse) ProtoMessage() {} func (x *TransactionsResponse) ProtoReflect() protoreflect.Message { - mi := &file_p2p_proto_transaction_proto_msgTypes[5] + mi := &file_p2p_proto_transaction_proto_msgTypes[6] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -484,7 +534,7 @@ func (x *TransactionsResponse) ProtoReflect() protoreflect.Message { // Deprecated: Use TransactionsResponse.ProtoReflect.Descriptor instead. func (*TransactionsResponse) Descriptor() ([]byte, []int) { - return file_p2p_proto_transaction_proto_rawDescGZIP(), []int{5} + return file_p2p_proto_transaction_proto_rawDescGZIP(), []int{6} } func (m *TransactionsResponse) GetTransactionMessage() isTransactionsResponse_TransactionMessage { @@ -494,9 +544,9 @@ func (m *TransactionsResponse) GetTransactionMessage() isTransactionsResponse_Tr return nil } -func (x *TransactionsResponse) GetTransaction() *Transaction { - if x, ok := x.GetTransactionMessage().(*TransactionsResponse_Transaction); ok { - return x.Transaction +func (x *TransactionsResponse) GetTransactionWithReceipt() *TransactionWithReceipt { + if x, ok := x.GetTransactionMessage().(*TransactionsResponse_TransactionWithReceipt); ok { + return x.TransactionWithReceipt } return nil } @@ -512,18 +562,65 @@ type isTransactionsResponse_TransactionMessage interface { isTransactionsResponse_TransactionMessage() } -type TransactionsResponse_Transaction struct { - Transaction *Transaction `protobuf:"bytes,1,opt,name=transaction,proto3,oneof"` +type TransactionsResponse_TransactionWithReceipt struct { + TransactionWithReceipt *TransactionWithReceipt `protobuf:"bytes,1,opt,name=transaction_with_receipt,json=transactionWithReceipt,proto3,oneof"` } type TransactionsResponse_Fin struct { Fin *Fin `protobuf:"bytes,2,opt,name=fin,proto3,oneof"` // Fin is sent after the peer sent all the data or when it encountered a block that it doesn't have its transactions. } -func (*TransactionsResponse_Transaction) isTransactionsResponse_TransactionMessage() {} +func (*TransactionsResponse_TransactionWithReceipt) isTransactionsResponse_TransactionMessage() {} func (*TransactionsResponse_Fin) isTransactionsResponse_TransactionMessage() {} +type Transactions struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Transactions []*Transaction `protobuf:"bytes,1,rep,name=transactions,proto3" json:"transactions,omitempty"` +} + +func (x *Transactions) Reset() { + *x = Transactions{} + if protoimpl.UnsafeEnabled { + mi := &file_p2p_proto_transaction_proto_msgTypes[7] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *Transactions) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*Transactions) ProtoMessage() {} + +func (x *Transactions) ProtoReflect() protoreflect.Message { + mi := &file_p2p_proto_transaction_proto_msgTypes[7] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use Transactions.ProtoReflect.Descriptor instead. +func (*Transactions) Descriptor() ([]byte, []int) { + return file_p2p_proto_transaction_proto_rawDescGZIP(), []int{7} +} + +func (x *Transactions) GetTransactions() []*Transaction { + if x != nil { + return x.Transactions + } + return nil +} + type Transaction_DeclareV0 struct { state protoimpl.MessageState sizeCache protoimpl.SizeCache @@ -538,7 +635,7 @@ type Transaction_DeclareV0 struct { func (x *Transaction_DeclareV0) Reset() { *x = Transaction_DeclareV0{} if protoimpl.UnsafeEnabled { - mi := &file_p2p_proto_transaction_proto_msgTypes[6] + mi := &file_p2p_proto_transaction_proto_msgTypes[8] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -551,7 +648,7 @@ func (x *Transaction_DeclareV0) String() string { func (*Transaction_DeclareV0) ProtoMessage() {} func (x *Transaction_DeclareV0) ProtoReflect() protoreflect.Message { - mi := &file_p2p_proto_transaction_proto_msgTypes[6] + mi := &file_p2p_proto_transaction_proto_msgTypes[8] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -610,7 +707,7 @@ type Transaction_DeclareV1 struct { func (x *Transaction_DeclareV1) Reset() { *x = Transaction_DeclareV1{} if protoimpl.UnsafeEnabled { - mi := &file_p2p_proto_transaction_proto_msgTypes[7] + mi := &file_p2p_proto_transaction_proto_msgTypes[9] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -623,7 +720,7 @@ func (x *Transaction_DeclareV1) String() string { func (*Transaction_DeclareV1) ProtoMessage() {} func (x *Transaction_DeclareV1) ProtoReflect() protoreflect.Message { - mi := &file_p2p_proto_transaction_proto_msgTypes[7] + mi := &file_p2p_proto_transaction_proto_msgTypes[9] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -684,13 +781,13 @@ type Transaction_DeclareV2 struct { Signature *AccountSignature `protobuf:"bytes,3,opt,name=signature,proto3" json:"signature,omitempty"` ClassHash *Hash `protobuf:"bytes,4,opt,name=class_hash,json=classHash,proto3" json:"class_hash,omitempty"` Nonce *Felt252 `protobuf:"bytes,5,opt,name=nonce,proto3" json:"nonce,omitempty"` - CompiledClassHash *Felt252 `protobuf:"bytes,6,opt,name=compiled_class_hash,json=compiledClassHash,proto3" json:"compiled_class_hash,omitempty"` + CompiledClassHash *Hash `protobuf:"bytes,6,opt,name=compiled_class_hash,json=compiledClassHash,proto3" json:"compiled_class_hash,omitempty"` } func (x *Transaction_DeclareV2) Reset() { *x = Transaction_DeclareV2{} if protoimpl.UnsafeEnabled { - mi := &file_p2p_proto_transaction_proto_msgTypes[8] + mi := &file_p2p_proto_transaction_proto_msgTypes[10] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -703,7 +800,7 @@ func (x *Transaction_DeclareV2) String() string { func (*Transaction_DeclareV2) ProtoMessage() {} func (x *Transaction_DeclareV2) ProtoReflect() protoreflect.Message { - mi := &file_p2p_proto_transaction_proto_msgTypes[8] + mi := &file_p2p_proto_transaction_proto_msgTypes[10] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -754,7 +851,7 @@ func (x *Transaction_DeclareV2) GetNonce() *Felt252 { return nil } -func (x *Transaction_DeclareV2) GetCompiledClassHash() *Felt252 { +func (x *Transaction_DeclareV2) GetCompiledClassHash() *Hash { if x != nil { return x.CompiledClassHash } @@ -767,23 +864,23 @@ type Transaction_DeclareV3 struct { sizeCache protoimpl.SizeCache unknownFields protoimpl.UnknownFields - Sender *Address `protobuf:"bytes,1,opt,name=sender,proto3" json:"sender,omitempty"` - Signature *AccountSignature `protobuf:"bytes,2,opt,name=signature,proto3" json:"signature,omitempty"` - ClassHash *Hash `protobuf:"bytes,3,opt,name=class_hash,json=classHash,proto3" json:"class_hash,omitempty"` - Nonce *Felt252 `protobuf:"bytes,4,opt,name=nonce,proto3" json:"nonce,omitempty"` - CompiledClassHash *Felt252 `protobuf:"bytes,5,opt,name=compiled_class_hash,json=compiledClassHash,proto3" json:"compiled_class_hash,omitempty"` - ResourceBounds *ResourceBounds `protobuf:"bytes,6,opt,name=resource_bounds,json=resourceBounds,proto3" json:"resource_bounds,omitempty"` - Tip *Felt252 `protobuf:"bytes,7,opt,name=tip,proto3" json:"tip,omitempty"` - PaymasterData *Address `protobuf:"bytes,8,opt,name=paymaster_data,json=paymasterData,proto3" json:"paymaster_data,omitempty"` - AccountDeploymentData *Address `protobuf:"bytes,9,opt,name=account_deployment_data,json=accountDeploymentData,proto3" json:"account_deployment_data,omitempty"` - NonceDomain string `protobuf:"bytes,10,opt,name=nonce_domain,json=nonceDomain,proto3" json:"nonce_domain,omitempty"` // rename to nonce_data_availability_mode ? - FeeDomain string `protobuf:"bytes,11,opt,name=fee_domain,json=feeDomain,proto3" json:"fee_domain,omitempty"` // rename to fee_data_availability_mode ? + Sender *Address `protobuf:"bytes,1,opt,name=sender,proto3" json:"sender,omitempty"` + Signature *AccountSignature `protobuf:"bytes,2,opt,name=signature,proto3" json:"signature,omitempty"` + ClassHash *Hash `protobuf:"bytes,3,opt,name=class_hash,json=classHash,proto3" json:"class_hash,omitempty"` + Nonce *Felt252 `protobuf:"bytes,4,opt,name=nonce,proto3" json:"nonce,omitempty"` + CompiledClassHash *Hash `protobuf:"bytes,5,opt,name=compiled_class_hash,json=compiledClassHash,proto3" json:"compiled_class_hash,omitempty"` + ResourceBounds *ResourceBounds `protobuf:"bytes,6,opt,name=resource_bounds,json=resourceBounds,proto3" json:"resource_bounds,omitempty"` + Tip uint64 `protobuf:"varint,7,opt,name=tip,proto3" json:"tip,omitempty"` + PaymasterData []*Felt252 `protobuf:"bytes,8,rep,name=paymaster_data,json=paymasterData,proto3" json:"paymaster_data,omitempty"` + AccountDeploymentData []*Felt252 `protobuf:"bytes,9,rep,name=account_deployment_data,json=accountDeploymentData,proto3" json:"account_deployment_data,omitempty"` + NonceDataAvailabilityMode VolitionDomain `protobuf:"varint,10,opt,name=nonce_data_availability_mode,json=nonceDataAvailabilityMode,proto3,enum=VolitionDomain" json:"nonce_data_availability_mode,omitempty"` + FeeDataAvailabilityMode VolitionDomain `protobuf:"varint,11,opt,name=fee_data_availability_mode,json=feeDataAvailabilityMode,proto3,enum=VolitionDomain" json:"fee_data_availability_mode,omitempty"` } func (x *Transaction_DeclareV3) Reset() { *x = Transaction_DeclareV3{} if protoimpl.UnsafeEnabled { - mi := &file_p2p_proto_transaction_proto_msgTypes[9] + mi := &file_p2p_proto_transaction_proto_msgTypes[11] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -796,7 +893,7 @@ func (x *Transaction_DeclareV3) String() string { func (*Transaction_DeclareV3) ProtoMessage() {} func (x *Transaction_DeclareV3) ProtoReflect() protoreflect.Message { - mi := &file_p2p_proto_transaction_proto_msgTypes[9] + mi := &file_p2p_proto_transaction_proto_msgTypes[11] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -840,7 +937,7 @@ func (x *Transaction_DeclareV3) GetNonce() *Felt252 { return nil } -func (x *Transaction_DeclareV3) GetCompiledClassHash() *Felt252 { +func (x *Transaction_DeclareV3) GetCompiledClassHash() *Hash { if x != nil { return x.CompiledClassHash } @@ -854,39 +951,39 @@ func (x *Transaction_DeclareV3) GetResourceBounds() *ResourceBounds { return nil } -func (x *Transaction_DeclareV3) GetTip() *Felt252 { +func (x *Transaction_DeclareV3) GetTip() uint64 { if x != nil { return x.Tip } - return nil + return 0 } -func (x *Transaction_DeclareV3) GetPaymasterData() *Address { +func (x *Transaction_DeclareV3) GetPaymasterData() []*Felt252 { if x != nil { return x.PaymasterData } return nil } -func (x *Transaction_DeclareV3) GetAccountDeploymentData() *Address { +func (x *Transaction_DeclareV3) GetAccountDeploymentData() []*Felt252 { if x != nil { return x.AccountDeploymentData } return nil } -func (x *Transaction_DeclareV3) GetNonceDomain() string { +func (x *Transaction_DeclareV3) GetNonceDataAvailabilityMode() VolitionDomain { if x != nil { - return x.NonceDomain + return x.NonceDataAvailabilityMode } - return "" + return VolitionDomain_L1 } -func (x *Transaction_DeclareV3) GetFeeDomain() string { +func (x *Transaction_DeclareV3) GetFeeDataAvailabilityMode() VolitionDomain { if x != nil { - return x.FeeDomain + return x.FeeDataAvailabilityMode } - return "" + return VolitionDomain_L1 } type Transaction_Deploy struct { @@ -903,7 +1000,7 @@ type Transaction_Deploy struct { func (x *Transaction_Deploy) Reset() { *x = Transaction_Deploy{} if protoimpl.UnsafeEnabled { - mi := &file_p2p_proto_transaction_proto_msgTypes[10] + mi := &file_p2p_proto_transaction_proto_msgTypes[12] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -916,7 +1013,7 @@ func (x *Transaction_Deploy) String() string { func (*Transaction_Deploy) ProtoMessage() {} func (x *Transaction_Deploy) ProtoReflect() protoreflect.Message { - mi := &file_p2p_proto_transaction_proto_msgTypes[10] + mi := &file_p2p_proto_transaction_proto_msgTypes[12] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -976,7 +1073,7 @@ type Transaction_DeployAccountV1 struct { func (x *Transaction_DeployAccountV1) Reset() { *x = Transaction_DeployAccountV1{} if protoimpl.UnsafeEnabled { - mi := &file_p2p_proto_transaction_proto_msgTypes[11] + mi := &file_p2p_proto_transaction_proto_msgTypes[13] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -989,7 +1086,7 @@ func (x *Transaction_DeployAccountV1) String() string { func (*Transaction_DeployAccountV1) ProtoMessage() {} func (x *Transaction_DeployAccountV1) ProtoReflect() protoreflect.Message { - mi := &file_p2p_proto_transaction_proto_msgTypes[11] + mi := &file_p2p_proto_transaction_proto_msgTypes[13] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -1053,22 +1150,22 @@ type Transaction_DeployAccountV3 struct { sizeCache protoimpl.SizeCache unknownFields protoimpl.UnknownFields - Signature *AccountSignature `protobuf:"bytes,1,opt,name=signature,proto3" json:"signature,omitempty"` - ClassHash *Hash `protobuf:"bytes,2,opt,name=class_hash,json=classHash,proto3" json:"class_hash,omitempty"` - Nonce *Felt252 `protobuf:"bytes,3,opt,name=nonce,proto3" json:"nonce,omitempty"` - AddressSalt *Felt252 `protobuf:"bytes,4,opt,name=address_salt,json=addressSalt,proto3" json:"address_salt,omitempty"` - Calldata []*Felt252 `protobuf:"bytes,5,rep,name=calldata,proto3" json:"calldata,omitempty"` - ResourceBounds *ResourceBounds `protobuf:"bytes,6,opt,name=resource_bounds,json=resourceBounds,proto3" json:"resource_bounds,omitempty"` - Tip *Felt252 `protobuf:"bytes,7,opt,name=tip,proto3" json:"tip,omitempty"` - PaymasterData *Address `protobuf:"bytes,8,opt,name=paymaster_data,json=paymasterData,proto3" json:"paymaster_data,omitempty"` - NonceDomain string `protobuf:"bytes,9,opt,name=nonce_domain,json=nonceDomain,proto3" json:"nonce_domain,omitempty"` // rename to nonce_data_availability_mode ? - FeeDomain string `protobuf:"bytes,10,opt,name=fee_domain,json=feeDomain,proto3" json:"fee_domain,omitempty"` // rename to fee_data_availability_mode ? + Signature *AccountSignature `protobuf:"bytes,1,opt,name=signature,proto3" json:"signature,omitempty"` + ClassHash *Hash `protobuf:"bytes,2,opt,name=class_hash,json=classHash,proto3" json:"class_hash,omitempty"` + Nonce *Felt252 `protobuf:"bytes,3,opt,name=nonce,proto3" json:"nonce,omitempty"` + AddressSalt *Felt252 `protobuf:"bytes,4,opt,name=address_salt,json=addressSalt,proto3" json:"address_salt,omitempty"` + Calldata []*Felt252 `protobuf:"bytes,5,rep,name=calldata,proto3" json:"calldata,omitempty"` + ResourceBounds *ResourceBounds `protobuf:"bytes,6,opt,name=resource_bounds,json=resourceBounds,proto3" json:"resource_bounds,omitempty"` + Tip uint64 `protobuf:"varint,7,opt,name=tip,proto3" json:"tip,omitempty"` + PaymasterData []*Felt252 `protobuf:"bytes,8,rep,name=paymaster_data,json=paymasterData,proto3" json:"paymaster_data,omitempty"` + NonceDataAvailabilityMode VolitionDomain `protobuf:"varint,9,opt,name=nonce_data_availability_mode,json=nonceDataAvailabilityMode,proto3,enum=VolitionDomain" json:"nonce_data_availability_mode,omitempty"` + FeeDataAvailabilityMode VolitionDomain `protobuf:"varint,10,opt,name=fee_data_availability_mode,json=feeDataAvailabilityMode,proto3,enum=VolitionDomain" json:"fee_data_availability_mode,omitempty"` } func (x *Transaction_DeployAccountV3) Reset() { *x = Transaction_DeployAccountV3{} if protoimpl.UnsafeEnabled { - mi := &file_p2p_proto_transaction_proto_msgTypes[12] + mi := &file_p2p_proto_transaction_proto_msgTypes[14] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -1081,7 +1178,7 @@ func (x *Transaction_DeployAccountV3) String() string { func (*Transaction_DeployAccountV3) ProtoMessage() {} func (x *Transaction_DeployAccountV3) ProtoReflect() protoreflect.Message { - mi := &file_p2p_proto_transaction_proto_msgTypes[12] + mi := &file_p2p_proto_transaction_proto_msgTypes[14] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -1139,32 +1236,32 @@ func (x *Transaction_DeployAccountV3) GetResourceBounds() *ResourceBounds { return nil } -func (x *Transaction_DeployAccountV3) GetTip() *Felt252 { +func (x *Transaction_DeployAccountV3) GetTip() uint64 { if x != nil { return x.Tip } - return nil + return 0 } -func (x *Transaction_DeployAccountV3) GetPaymasterData() *Address { +func (x *Transaction_DeployAccountV3) GetPaymasterData() []*Felt252 { if x != nil { return x.PaymasterData } return nil } -func (x *Transaction_DeployAccountV3) GetNonceDomain() string { +func (x *Transaction_DeployAccountV3) GetNonceDataAvailabilityMode() VolitionDomain { if x != nil { - return x.NonceDomain + return x.NonceDataAvailabilityMode } - return "" + return VolitionDomain_L1 } -func (x *Transaction_DeployAccountV3) GetFeeDomain() string { +func (x *Transaction_DeployAccountV3) GetFeeDataAvailabilityMode() VolitionDomain { if x != nil { - return x.FeeDomain + return x.FeeDataAvailabilityMode } - return "" + return VolitionDomain_L1 } type Transaction_InvokeV0 struct { @@ -1182,7 +1279,7 @@ type Transaction_InvokeV0 struct { func (x *Transaction_InvokeV0) Reset() { *x = Transaction_InvokeV0{} if protoimpl.UnsafeEnabled { - mi := &file_p2p_proto_transaction_proto_msgTypes[13] + mi := &file_p2p_proto_transaction_proto_msgTypes[15] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -1195,7 +1292,7 @@ func (x *Transaction_InvokeV0) String() string { func (*Transaction_InvokeV0) ProtoMessage() {} func (x *Transaction_InvokeV0) ProtoReflect() protoreflect.Message { - mi := &file_p2p_proto_transaction_proto_msgTypes[13] + mi := &file_p2p_proto_transaction_proto_msgTypes[15] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -1261,7 +1358,7 @@ type Transaction_InvokeV1 struct { func (x *Transaction_InvokeV1) Reset() { *x = Transaction_InvokeV1{} if protoimpl.UnsafeEnabled { - mi := &file_p2p_proto_transaction_proto_msgTypes[14] + mi := &file_p2p_proto_transaction_proto_msgTypes[16] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -1274,7 +1371,7 @@ func (x *Transaction_InvokeV1) String() string { func (*Transaction_InvokeV1) ProtoMessage() {} func (x *Transaction_InvokeV1) ProtoReflect() protoreflect.Message { - mi := &file_p2p_proto_transaction_proto_msgTypes[14] + mi := &file_p2p_proto_transaction_proto_msgTypes[16] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -1331,22 +1428,22 @@ type Transaction_InvokeV3 struct { sizeCache protoimpl.SizeCache unknownFields protoimpl.UnknownFields - Sender *Address `protobuf:"bytes,1,opt,name=sender,proto3" json:"sender,omitempty"` - Signature *AccountSignature `protobuf:"bytes,2,opt,name=signature,proto3" json:"signature,omitempty"` - Calldata []*Felt252 `protobuf:"bytes,3,rep,name=calldata,proto3" json:"calldata,omitempty"` - ResourceBounds *ResourceBounds `protobuf:"bytes,4,opt,name=resource_bounds,json=resourceBounds,proto3" json:"resource_bounds,omitempty"` - Tip *Felt252 `protobuf:"bytes,5,opt,name=tip,proto3" json:"tip,omitempty"` - PaymasterData *Address `protobuf:"bytes,6,opt,name=paymaster_data,json=paymasterData,proto3" json:"paymaster_data,omitempty"` - AccountDeploymentData *Address `protobuf:"bytes,7,opt,name=account_deployment_data,json=accountDeploymentData,proto3" json:"account_deployment_data,omitempty"` - NonceDomain string `protobuf:"bytes,8,opt,name=nonce_domain,json=nonceDomain,proto3" json:"nonce_domain,omitempty"` // rename to nonce_data_availability_mode ? - FeeDomain string `protobuf:"bytes,9,opt,name=fee_domain,json=feeDomain,proto3" json:"fee_domain,omitempty"` // rename to fee_data_availability_mode ? - Nonce *Felt252 `protobuf:"bytes,10,opt,name=nonce,proto3" json:"nonce,omitempty"` + Sender *Address `protobuf:"bytes,1,opt,name=sender,proto3" json:"sender,omitempty"` + Signature *AccountSignature `protobuf:"bytes,2,opt,name=signature,proto3" json:"signature,omitempty"` + Calldata []*Felt252 `protobuf:"bytes,3,rep,name=calldata,proto3" json:"calldata,omitempty"` + ResourceBounds *ResourceBounds `protobuf:"bytes,4,opt,name=resource_bounds,json=resourceBounds,proto3" json:"resource_bounds,omitempty"` + Tip uint64 `protobuf:"varint,5,opt,name=tip,proto3" json:"tip,omitempty"` + PaymasterData []*Felt252 `protobuf:"bytes,6,rep,name=paymaster_data,json=paymasterData,proto3" json:"paymaster_data,omitempty"` + AccountDeploymentData []*Felt252 `protobuf:"bytes,7,rep,name=account_deployment_data,json=accountDeploymentData,proto3" json:"account_deployment_data,omitempty"` + NonceDataAvailabilityMode VolitionDomain `protobuf:"varint,8,opt,name=nonce_data_availability_mode,json=nonceDataAvailabilityMode,proto3,enum=VolitionDomain" json:"nonce_data_availability_mode,omitempty"` + FeeDataAvailabilityMode VolitionDomain `protobuf:"varint,9,opt,name=fee_data_availability_mode,json=feeDataAvailabilityMode,proto3,enum=VolitionDomain" json:"fee_data_availability_mode,omitempty"` + Nonce *Felt252 `protobuf:"bytes,10,opt,name=nonce,proto3" json:"nonce,omitempty"` } func (x *Transaction_InvokeV3) Reset() { *x = Transaction_InvokeV3{} if protoimpl.UnsafeEnabled { - mi := &file_p2p_proto_transaction_proto_msgTypes[15] + mi := &file_p2p_proto_transaction_proto_msgTypes[17] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -1359,7 +1456,7 @@ func (x *Transaction_InvokeV3) String() string { func (*Transaction_InvokeV3) ProtoMessage() {} func (x *Transaction_InvokeV3) ProtoReflect() protoreflect.Message { - mi := &file_p2p_proto_transaction_proto_msgTypes[15] + mi := &file_p2p_proto_transaction_proto_msgTypes[17] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -1403,39 +1500,39 @@ func (x *Transaction_InvokeV3) GetResourceBounds() *ResourceBounds { return nil } -func (x *Transaction_InvokeV3) GetTip() *Felt252 { +func (x *Transaction_InvokeV3) GetTip() uint64 { if x != nil { return x.Tip } - return nil + return 0 } -func (x *Transaction_InvokeV3) GetPaymasterData() *Address { +func (x *Transaction_InvokeV3) GetPaymasterData() []*Felt252 { if x != nil { return x.PaymasterData } return nil } -func (x *Transaction_InvokeV3) GetAccountDeploymentData() *Address { +func (x *Transaction_InvokeV3) GetAccountDeploymentData() []*Felt252 { if x != nil { return x.AccountDeploymentData } return nil } -func (x *Transaction_InvokeV3) GetNonceDomain() string { +func (x *Transaction_InvokeV3) GetNonceDataAvailabilityMode() VolitionDomain { if x != nil { - return x.NonceDomain + return x.NonceDataAvailabilityMode } - return "" + return VolitionDomain_L1 } -func (x *Transaction_InvokeV3) GetFeeDomain() string { +func (x *Transaction_InvokeV3) GetFeeDataAvailabilityMode() VolitionDomain { if x != nil { - return x.FeeDomain + return x.FeeDataAvailabilityMode } - return "" + return VolitionDomain_L1 } func (x *Transaction_InvokeV3) GetNonce() *Felt252 { @@ -1459,7 +1556,7 @@ type Transaction_L1HandlerV0 struct { func (x *Transaction_L1HandlerV0) Reset() { *x = Transaction_L1HandlerV0{} if protoimpl.UnsafeEnabled { - mi := &file_p2p_proto_transaction_proto_msgTypes[16] + mi := &file_p2p_proto_transaction_proto_msgTypes[18] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -1472,7 +1569,7 @@ func (x *Transaction_L1HandlerV0) String() string { func (*Transaction_L1HandlerV0) ProtoMessage() {} func (x *Transaction_L1HandlerV0) ProtoReflect() protoreflect.Message { - mi := &file_p2p_proto_transaction_proto_msgTypes[16] + mi := &file_p2p_proto_transaction_proto_msgTypes[18] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -1522,272 +1619,299 @@ var file_p2p_proto_transaction_proto_rawDesc = []byte{ 0x0a, 0x1b, 0x70, 0x32, 0x70, 0x2f, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2f, 0x74, 0x72, 0x61, 0x6e, 0x73, 0x61, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x1a, 0x16, 0x70, 0x32, 0x70, 0x2f, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2f, 0x63, 0x6f, 0x6d, 0x6d, 0x6f, 0x6e, 0x2e, - 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x22, 0x70, 0x0a, 0x0e, 0x52, 0x65, 0x73, 0x6f, 0x75, 0x72, 0x63, - 0x65, 0x4c, 0x69, 0x6d, 0x69, 0x74, 0x73, 0x12, 0x27, 0x0a, 0x0a, 0x6d, 0x61, 0x78, 0x5f, 0x61, - 0x6d, 0x6f, 0x75, 0x6e, 0x74, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x08, 0x2e, 0x46, 0x65, - 0x6c, 0x74, 0x32, 0x35, 0x32, 0x52, 0x09, 0x6d, 0x61, 0x78, 0x41, 0x6d, 0x6f, 0x75, 0x6e, 0x74, - 0x12, 0x35, 0x0a, 0x12, 0x6d, 0x61, 0x78, 0x5f, 0x70, 0x72, 0x69, 0x63, 0x65, 0x5f, 0x70, 0x65, - 0x72, 0x5f, 0x75, 0x6e, 0x69, 0x74, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x08, 0x2e, 0x46, - 0x65, 0x6c, 0x74, 0x32, 0x35, 0x32, 0x52, 0x0f, 0x6d, 0x61, 0x78, 0x50, 0x72, 0x69, 0x63, 0x65, - 0x50, 0x65, 0x72, 0x55, 0x6e, 0x69, 0x74, 0x22, 0x60, 0x0a, 0x0e, 0x52, 0x65, 0x73, 0x6f, 0x75, - 0x72, 0x63, 0x65, 0x42, 0x6f, 0x75, 0x6e, 0x64, 0x73, 0x12, 0x26, 0x0a, 0x06, 0x6c, 0x31, 0x5f, - 0x67, 0x61, 0x73, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x0f, 0x2e, 0x52, 0x65, 0x73, 0x6f, - 0x75, 0x72, 0x63, 0x65, 0x4c, 0x69, 0x6d, 0x69, 0x74, 0x73, 0x52, 0x05, 0x6c, 0x31, 0x47, 0x61, - 0x73, 0x12, 0x26, 0x0a, 0x06, 0x6c, 0x32, 0x5f, 0x67, 0x61, 0x73, 0x18, 0x02, 0x20, 0x01, 0x28, - 0x0b, 0x32, 0x0f, 0x2e, 0x52, 0x65, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x4c, 0x69, 0x6d, 0x69, - 0x74, 0x73, 0x52, 0x05, 0x6c, 0x32, 0x47, 0x61, 0x73, 0x22, 0x32, 0x0a, 0x10, 0x41, 0x63, 0x63, - 0x6f, 0x75, 0x6e, 0x74, 0x53, 0x69, 0x67, 0x6e, 0x61, 0x74, 0x75, 0x72, 0x65, 0x12, 0x1e, 0x0a, - 0x05, 0x70, 0x61, 0x72, 0x74, 0x73, 0x18, 0x01, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x08, 0x2e, 0x46, - 0x65, 0x6c, 0x74, 0x32, 0x35, 0x32, 0x52, 0x05, 0x70, 0x61, 0x72, 0x74, 0x73, 0x22, 0x8f, 0x1d, - 0x0a, 0x0b, 0x54, 0x72, 0x61, 0x6e, 0x73, 0x61, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x12, 0x37, 0x0a, - 0x0a, 0x64, 0x65, 0x63, 0x6c, 0x61, 0x72, 0x65, 0x5f, 0x76, 0x30, 0x18, 0x01, 0x20, 0x01, 0x28, - 0x0b, 0x32, 0x16, 0x2e, 0x54, 0x72, 0x61, 0x6e, 0x73, 0x61, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x2e, - 0x44, 0x65, 0x63, 0x6c, 0x61, 0x72, 0x65, 0x56, 0x30, 0x48, 0x00, 0x52, 0x09, 0x64, 0x65, 0x63, - 0x6c, 0x61, 0x72, 0x65, 0x56, 0x30, 0x12, 0x37, 0x0a, 0x0a, 0x64, 0x65, 0x63, 0x6c, 0x61, 0x72, - 0x65, 0x5f, 0x76, 0x31, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x16, 0x2e, 0x54, 0x72, 0x61, + 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x1a, 0x17, 0x70, 0x32, 0x70, 0x2f, 0x70, 0x72, 0x6f, 0x74, 0x6f, + 0x2f, 0x72, 0x65, 0x63, 0x65, 0x69, 0x70, 0x74, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x22, 0x70, + 0x0a, 0x0e, 0x52, 0x65, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x4c, 0x69, 0x6d, 0x69, 0x74, 0x73, + 0x12, 0x27, 0x0a, 0x0a, 0x6d, 0x61, 0x78, 0x5f, 0x61, 0x6d, 0x6f, 0x75, 0x6e, 0x74, 0x18, 0x01, + 0x20, 0x01, 0x28, 0x0b, 0x32, 0x08, 0x2e, 0x46, 0x65, 0x6c, 0x74, 0x32, 0x35, 0x32, 0x52, 0x09, + 0x6d, 0x61, 0x78, 0x41, 0x6d, 0x6f, 0x75, 0x6e, 0x74, 0x12, 0x35, 0x0a, 0x12, 0x6d, 0x61, 0x78, + 0x5f, 0x70, 0x72, 0x69, 0x63, 0x65, 0x5f, 0x70, 0x65, 0x72, 0x5f, 0x75, 0x6e, 0x69, 0x74, 0x18, + 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x08, 0x2e, 0x46, 0x65, 0x6c, 0x74, 0x32, 0x35, 0x32, 0x52, + 0x0f, 0x6d, 0x61, 0x78, 0x50, 0x72, 0x69, 0x63, 0x65, 0x50, 0x65, 0x72, 0x55, 0x6e, 0x69, 0x74, + 0x22, 0x60, 0x0a, 0x0e, 0x52, 0x65, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x42, 0x6f, 0x75, 0x6e, + 0x64, 0x73, 0x12, 0x26, 0x0a, 0x06, 0x6c, 0x31, 0x5f, 0x67, 0x61, 0x73, 0x18, 0x01, 0x20, 0x01, + 0x28, 0x0b, 0x32, 0x0f, 0x2e, 0x52, 0x65, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x4c, 0x69, 0x6d, + 0x69, 0x74, 0x73, 0x52, 0x05, 0x6c, 0x31, 0x47, 0x61, 0x73, 0x12, 0x26, 0x0a, 0x06, 0x6c, 0x32, + 0x5f, 0x67, 0x61, 0x73, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x0f, 0x2e, 0x52, 0x65, 0x73, + 0x6f, 0x75, 0x72, 0x63, 0x65, 0x4c, 0x69, 0x6d, 0x69, 0x74, 0x73, 0x52, 0x05, 0x6c, 0x32, 0x47, + 0x61, 0x73, 0x22, 0x32, 0x0a, 0x10, 0x41, 0x63, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x53, 0x69, 0x67, + 0x6e, 0x61, 0x74, 0x75, 0x72, 0x65, 0x12, 0x1e, 0x0a, 0x05, 0x70, 0x61, 0x72, 0x74, 0x73, 0x18, + 0x01, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x08, 0x2e, 0x46, 0x65, 0x6c, 0x74, 0x32, 0x35, 0x32, 0x52, + 0x05, 0x70, 0x61, 0x72, 0x74, 0x73, 0x22, 0xd3, 0x1e, 0x0a, 0x0b, 0x54, 0x72, 0x61, 0x6e, 0x73, + 0x61, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x12, 0x37, 0x0a, 0x0a, 0x64, 0x65, 0x63, 0x6c, 0x61, 0x72, + 0x65, 0x5f, 0x76, 0x30, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x16, 0x2e, 0x54, 0x72, 0x61, 0x6e, 0x73, 0x61, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x2e, 0x44, 0x65, 0x63, 0x6c, 0x61, 0x72, 0x65, - 0x56, 0x31, 0x48, 0x00, 0x52, 0x09, 0x64, 0x65, 0x63, 0x6c, 0x61, 0x72, 0x65, 0x56, 0x31, 0x12, - 0x37, 0x0a, 0x0a, 0x64, 0x65, 0x63, 0x6c, 0x61, 0x72, 0x65, 0x5f, 0x76, 0x32, 0x18, 0x03, 0x20, + 0x56, 0x30, 0x48, 0x00, 0x52, 0x09, 0x64, 0x65, 0x63, 0x6c, 0x61, 0x72, 0x65, 0x56, 0x30, 0x12, + 0x37, 0x0a, 0x0a, 0x64, 0x65, 0x63, 0x6c, 0x61, 0x72, 0x65, 0x5f, 0x76, 0x31, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x16, 0x2e, 0x54, 0x72, 0x61, 0x6e, 0x73, 0x61, 0x63, 0x74, 0x69, 0x6f, - 0x6e, 0x2e, 0x44, 0x65, 0x63, 0x6c, 0x61, 0x72, 0x65, 0x56, 0x32, 0x48, 0x00, 0x52, 0x09, 0x64, - 0x65, 0x63, 0x6c, 0x61, 0x72, 0x65, 0x56, 0x32, 0x12, 0x37, 0x0a, 0x0a, 0x64, 0x65, 0x63, 0x6c, - 0x61, 0x72, 0x65, 0x5f, 0x76, 0x33, 0x18, 0x04, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x16, 0x2e, 0x54, + 0x6e, 0x2e, 0x44, 0x65, 0x63, 0x6c, 0x61, 0x72, 0x65, 0x56, 0x31, 0x48, 0x00, 0x52, 0x09, 0x64, + 0x65, 0x63, 0x6c, 0x61, 0x72, 0x65, 0x56, 0x31, 0x12, 0x37, 0x0a, 0x0a, 0x64, 0x65, 0x63, 0x6c, + 0x61, 0x72, 0x65, 0x5f, 0x76, 0x32, 0x18, 0x03, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x16, 0x2e, 0x54, 0x72, 0x61, 0x6e, 0x73, 0x61, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x2e, 0x44, 0x65, 0x63, 0x6c, 0x61, - 0x72, 0x65, 0x56, 0x33, 0x48, 0x00, 0x52, 0x09, 0x64, 0x65, 0x63, 0x6c, 0x61, 0x72, 0x65, 0x56, - 0x33, 0x12, 0x2d, 0x0a, 0x06, 0x64, 0x65, 0x70, 0x6c, 0x6f, 0x79, 0x18, 0x05, 0x20, 0x01, 0x28, - 0x0b, 0x32, 0x13, 0x2e, 0x54, 0x72, 0x61, 0x6e, 0x73, 0x61, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x2e, - 0x44, 0x65, 0x70, 0x6c, 0x6f, 0x79, 0x48, 0x00, 0x52, 0x06, 0x64, 0x65, 0x70, 0x6c, 0x6f, 0x79, - 0x12, 0x4a, 0x0a, 0x11, 0x64, 0x65, 0x70, 0x6c, 0x6f, 0x79, 0x5f, 0x61, 0x63, 0x63, 0x6f, 0x75, - 0x6e, 0x74, 0x5f, 0x76, 0x31, 0x18, 0x06, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1c, 0x2e, 0x54, 0x72, - 0x61, 0x6e, 0x73, 0x61, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x2e, 0x44, 0x65, 0x70, 0x6c, 0x6f, 0x79, - 0x41, 0x63, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x56, 0x31, 0x48, 0x00, 0x52, 0x0f, 0x64, 0x65, 0x70, - 0x6c, 0x6f, 0x79, 0x41, 0x63, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x56, 0x31, 0x12, 0x4a, 0x0a, 0x11, - 0x64, 0x65, 0x70, 0x6c, 0x6f, 0x79, 0x5f, 0x61, 0x63, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x5f, 0x76, - 0x33, 0x18, 0x07, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1c, 0x2e, 0x54, 0x72, 0x61, 0x6e, 0x73, 0x61, - 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x2e, 0x44, 0x65, 0x70, 0x6c, 0x6f, 0x79, 0x41, 0x63, 0x63, 0x6f, - 0x75, 0x6e, 0x74, 0x56, 0x33, 0x48, 0x00, 0x52, 0x0f, 0x64, 0x65, 0x70, 0x6c, 0x6f, 0x79, 0x41, - 0x63, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x56, 0x33, 0x12, 0x34, 0x0a, 0x09, 0x69, 0x6e, 0x76, 0x6f, - 0x6b, 0x65, 0x5f, 0x76, 0x30, 0x18, 0x08, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x15, 0x2e, 0x54, 0x72, - 0x61, 0x6e, 0x73, 0x61, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x2e, 0x49, 0x6e, 0x76, 0x6f, 0x6b, 0x65, - 0x56, 0x30, 0x48, 0x00, 0x52, 0x08, 0x69, 0x6e, 0x76, 0x6f, 0x6b, 0x65, 0x56, 0x30, 0x12, 0x34, - 0x0a, 0x09, 0x69, 0x6e, 0x76, 0x6f, 0x6b, 0x65, 0x5f, 0x76, 0x31, 0x18, 0x09, 0x20, 0x01, 0x28, - 0x0b, 0x32, 0x15, 0x2e, 0x54, 0x72, 0x61, 0x6e, 0x73, 0x61, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x2e, - 0x49, 0x6e, 0x76, 0x6f, 0x6b, 0x65, 0x56, 0x31, 0x48, 0x00, 0x52, 0x08, 0x69, 0x6e, 0x76, 0x6f, - 0x6b, 0x65, 0x56, 0x31, 0x12, 0x34, 0x0a, 0x09, 0x69, 0x6e, 0x76, 0x6f, 0x6b, 0x65, 0x5f, 0x76, - 0x33, 0x18, 0x0a, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x15, 0x2e, 0x54, 0x72, 0x61, 0x6e, 0x73, 0x61, - 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x2e, 0x49, 0x6e, 0x76, 0x6f, 0x6b, 0x65, 0x56, 0x33, 0x48, 0x00, - 0x52, 0x08, 0x69, 0x6e, 0x76, 0x6f, 0x6b, 0x65, 0x56, 0x33, 0x12, 0x39, 0x0a, 0x0a, 0x6c, 0x31, - 0x5f, 0x68, 0x61, 0x6e, 0x64, 0x6c, 0x65, 0x72, 0x18, 0x0b, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x18, - 0x2e, 0x54, 0x72, 0x61, 0x6e, 0x73, 0x61, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x2e, 0x4c, 0x31, 0x48, - 0x61, 0x6e, 0x64, 0x6c, 0x65, 0x72, 0x56, 0x30, 0x48, 0x00, 0x52, 0x09, 0x6c, 0x31, 0x48, 0x61, - 0x6e, 0x64, 0x6c, 0x65, 0x72, 0x12, 0x30, 0x0a, 0x10, 0x74, 0x72, 0x61, 0x6e, 0x73, 0x61, 0x63, - 0x74, 0x69, 0x6f, 0x6e, 0x5f, 0x68, 0x61, 0x73, 0x68, 0x18, 0x0c, 0x20, 0x01, 0x28, 0x0b, 0x32, - 0x05, 0x2e, 0x48, 0x61, 0x73, 0x68, 0x52, 0x0f, 0x74, 0x72, 0x61, 0x6e, 0x73, 0x61, 0x63, 0x74, - 0x69, 0x6f, 0x6e, 0x48, 0x61, 0x73, 0x68, 0x1a, 0xa7, 0x01, 0x0a, 0x09, 0x44, 0x65, 0x63, 0x6c, - 0x61, 0x72, 0x65, 0x56, 0x30, 0x12, 0x20, 0x0a, 0x06, 0x73, 0x65, 0x6e, 0x64, 0x65, 0x72, 0x18, - 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x08, 0x2e, 0x41, 0x64, 0x64, 0x72, 0x65, 0x73, 0x73, 0x52, - 0x06, 0x73, 0x65, 0x6e, 0x64, 0x65, 0x72, 0x12, 0x21, 0x0a, 0x07, 0x6d, 0x61, 0x78, 0x5f, 0x66, - 0x65, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x08, 0x2e, 0x46, 0x65, 0x6c, 0x74, 0x32, - 0x35, 0x32, 0x52, 0x06, 0x6d, 0x61, 0x78, 0x46, 0x65, 0x65, 0x12, 0x2f, 0x0a, 0x09, 0x73, 0x69, - 0x67, 0x6e, 0x61, 0x74, 0x75, 0x72, 0x65, 0x18, 0x03, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x11, 0x2e, - 0x41, 0x63, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x53, 0x69, 0x67, 0x6e, 0x61, 0x74, 0x75, 0x72, 0x65, - 0x52, 0x09, 0x73, 0x69, 0x67, 0x6e, 0x61, 0x74, 0x75, 0x72, 0x65, 0x12, 0x24, 0x0a, 0x0a, 0x63, - 0x6c, 0x61, 0x73, 0x73, 0x5f, 0x68, 0x61, 0x73, 0x68, 0x18, 0x04, 0x20, 0x01, 0x28, 0x0b, 0x32, - 0x05, 0x2e, 0x48, 0x61, 0x73, 0x68, 0x52, 0x09, 0x63, 0x6c, 0x61, 0x73, 0x73, 0x48, 0x61, 0x73, - 0x68, 0x1a, 0xc7, 0x01, 0x0a, 0x09, 0x44, 0x65, 0x63, 0x6c, 0x61, 0x72, 0x65, 0x56, 0x31, 0x12, - 0x20, 0x0a, 0x06, 0x73, 0x65, 0x6e, 0x64, 0x65, 0x72, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, - 0x08, 0x2e, 0x41, 0x64, 0x64, 0x72, 0x65, 0x73, 0x73, 0x52, 0x06, 0x73, 0x65, 0x6e, 0x64, 0x65, - 0x72, 0x12, 0x21, 0x0a, 0x07, 0x6d, 0x61, 0x78, 0x5f, 0x66, 0x65, 0x65, 0x18, 0x02, 0x20, 0x01, - 0x28, 0x0b, 0x32, 0x08, 0x2e, 0x46, 0x65, 0x6c, 0x74, 0x32, 0x35, 0x32, 0x52, 0x06, 0x6d, 0x61, - 0x78, 0x46, 0x65, 0x65, 0x12, 0x2f, 0x0a, 0x09, 0x73, 0x69, 0x67, 0x6e, 0x61, 0x74, 0x75, 0x72, - 0x65, 0x18, 0x03, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x11, 0x2e, 0x41, 0x63, 0x63, 0x6f, 0x75, 0x6e, - 0x74, 0x53, 0x69, 0x67, 0x6e, 0x61, 0x74, 0x75, 0x72, 0x65, 0x52, 0x09, 0x73, 0x69, 0x67, 0x6e, - 0x61, 0x74, 0x75, 0x72, 0x65, 0x12, 0x24, 0x0a, 0x0a, 0x63, 0x6c, 0x61, 0x73, 0x73, 0x5f, 0x68, - 0x61, 0x73, 0x68, 0x18, 0x04, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x05, 0x2e, 0x48, 0x61, 0x73, 0x68, - 0x52, 0x09, 0x63, 0x6c, 0x61, 0x73, 0x73, 0x48, 0x61, 0x73, 0x68, 0x12, 0x1e, 0x0a, 0x05, 0x6e, - 0x6f, 0x6e, 0x63, 0x65, 0x18, 0x05, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x08, 0x2e, 0x46, 0x65, 0x6c, - 0x74, 0x32, 0x35, 0x32, 0x52, 0x05, 0x6e, 0x6f, 0x6e, 0x63, 0x65, 0x1a, 0x81, 0x02, 0x0a, 0x09, - 0x44, 0x65, 0x63, 0x6c, 0x61, 0x72, 0x65, 0x56, 0x32, 0x12, 0x20, 0x0a, 0x06, 0x73, 0x65, 0x6e, - 0x64, 0x65, 0x72, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x08, 0x2e, 0x41, 0x64, 0x64, 0x72, - 0x65, 0x73, 0x73, 0x52, 0x06, 0x73, 0x65, 0x6e, 0x64, 0x65, 0x72, 0x12, 0x21, 0x0a, 0x07, 0x6d, - 0x61, 0x78, 0x5f, 0x66, 0x65, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x08, 0x2e, 0x46, - 0x65, 0x6c, 0x74, 0x32, 0x35, 0x32, 0x52, 0x06, 0x6d, 0x61, 0x78, 0x46, 0x65, 0x65, 0x12, 0x2f, - 0x0a, 0x09, 0x73, 0x69, 0x67, 0x6e, 0x61, 0x74, 0x75, 0x72, 0x65, 0x18, 0x03, 0x20, 0x01, 0x28, - 0x0b, 0x32, 0x11, 0x2e, 0x41, 0x63, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x53, 0x69, 0x67, 0x6e, 0x61, - 0x74, 0x75, 0x72, 0x65, 0x52, 0x09, 0x73, 0x69, 0x67, 0x6e, 0x61, 0x74, 0x75, 0x72, 0x65, 0x12, - 0x24, 0x0a, 0x0a, 0x63, 0x6c, 0x61, 0x73, 0x73, 0x5f, 0x68, 0x61, 0x73, 0x68, 0x18, 0x04, 0x20, - 0x01, 0x28, 0x0b, 0x32, 0x05, 0x2e, 0x48, 0x61, 0x73, 0x68, 0x52, 0x09, 0x63, 0x6c, 0x61, 0x73, - 0x73, 0x48, 0x61, 0x73, 0x68, 0x12, 0x1e, 0x0a, 0x05, 0x6e, 0x6f, 0x6e, 0x63, 0x65, 0x18, 0x05, - 0x20, 0x01, 0x28, 0x0b, 0x32, 0x08, 0x2e, 0x46, 0x65, 0x6c, 0x74, 0x32, 0x35, 0x32, 0x52, 0x05, - 0x6e, 0x6f, 0x6e, 0x63, 0x65, 0x12, 0x38, 0x0a, 0x13, 0x63, 0x6f, 0x6d, 0x70, 0x69, 0x6c, 0x65, - 0x64, 0x5f, 0x63, 0x6c, 0x61, 0x73, 0x73, 0x5f, 0x68, 0x61, 0x73, 0x68, 0x18, 0x06, 0x20, 0x01, - 0x28, 0x0b, 0x32, 0x08, 0x2e, 0x46, 0x65, 0x6c, 0x74, 0x32, 0x35, 0x32, 0x52, 0x11, 0x63, 0x6f, - 0x6d, 0x70, 0x69, 0x6c, 0x65, 0x64, 0x43, 0x6c, 0x61, 0x73, 0x73, 0x48, 0x61, 0x73, 0x68, 0x1a, - 0xe9, 0x03, 0x0a, 0x09, 0x44, 0x65, 0x63, 0x6c, 0x61, 0x72, 0x65, 0x56, 0x33, 0x12, 0x20, 0x0a, - 0x06, 0x73, 0x65, 0x6e, 0x64, 0x65, 0x72, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x08, 0x2e, - 0x41, 0x64, 0x64, 0x72, 0x65, 0x73, 0x73, 0x52, 0x06, 0x73, 0x65, 0x6e, 0x64, 0x65, 0x72, 0x12, - 0x2f, 0x0a, 0x09, 0x73, 0x69, 0x67, 0x6e, 0x61, 0x74, 0x75, 0x72, 0x65, 0x18, 0x02, 0x20, 0x01, - 0x28, 0x0b, 0x32, 0x11, 0x2e, 0x41, 0x63, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x53, 0x69, 0x67, 0x6e, - 0x61, 0x74, 0x75, 0x72, 0x65, 0x52, 0x09, 0x73, 0x69, 0x67, 0x6e, 0x61, 0x74, 0x75, 0x72, 0x65, - 0x12, 0x24, 0x0a, 0x0a, 0x63, 0x6c, 0x61, 0x73, 0x73, 0x5f, 0x68, 0x61, 0x73, 0x68, 0x18, 0x03, - 0x20, 0x01, 0x28, 0x0b, 0x32, 0x05, 0x2e, 0x48, 0x61, 0x73, 0x68, 0x52, 0x09, 0x63, 0x6c, 0x61, - 0x73, 0x73, 0x48, 0x61, 0x73, 0x68, 0x12, 0x1e, 0x0a, 0x05, 0x6e, 0x6f, 0x6e, 0x63, 0x65, 0x18, - 0x04, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x08, 0x2e, 0x46, 0x65, 0x6c, 0x74, 0x32, 0x35, 0x32, 0x52, - 0x05, 0x6e, 0x6f, 0x6e, 0x63, 0x65, 0x12, 0x38, 0x0a, 0x13, 0x63, 0x6f, 0x6d, 0x70, 0x69, 0x6c, - 0x65, 0x64, 0x5f, 0x63, 0x6c, 0x61, 0x73, 0x73, 0x5f, 0x68, 0x61, 0x73, 0x68, 0x18, 0x05, 0x20, - 0x01, 0x28, 0x0b, 0x32, 0x08, 0x2e, 0x46, 0x65, 0x6c, 0x74, 0x32, 0x35, 0x32, 0x52, 0x11, 0x63, - 0x6f, 0x6d, 0x70, 0x69, 0x6c, 0x65, 0x64, 0x43, 0x6c, 0x61, 0x73, 0x73, 0x48, 0x61, 0x73, 0x68, - 0x12, 0x38, 0x0a, 0x0f, 0x72, 0x65, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x5f, 0x62, 0x6f, 0x75, - 0x6e, 0x64, 0x73, 0x18, 0x06, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x0f, 0x2e, 0x52, 0x65, 0x73, 0x6f, - 0x75, 0x72, 0x63, 0x65, 0x42, 0x6f, 0x75, 0x6e, 0x64, 0x73, 0x52, 0x0e, 0x72, 0x65, 0x73, 0x6f, - 0x75, 0x72, 0x63, 0x65, 0x42, 0x6f, 0x75, 0x6e, 0x64, 0x73, 0x12, 0x1a, 0x0a, 0x03, 0x74, 0x69, - 0x70, 0x18, 0x07, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x08, 0x2e, 0x46, 0x65, 0x6c, 0x74, 0x32, 0x35, - 0x32, 0x52, 0x03, 0x74, 0x69, 0x70, 0x12, 0x2f, 0x0a, 0x0e, 0x70, 0x61, 0x79, 0x6d, 0x61, 0x73, - 0x74, 0x65, 0x72, 0x5f, 0x64, 0x61, 0x74, 0x61, 0x18, 0x08, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x08, - 0x2e, 0x41, 0x64, 0x64, 0x72, 0x65, 0x73, 0x73, 0x52, 0x0d, 0x70, 0x61, 0x79, 0x6d, 0x61, 0x73, - 0x74, 0x65, 0x72, 0x44, 0x61, 0x74, 0x61, 0x12, 0x40, 0x0a, 0x17, 0x61, 0x63, 0x63, 0x6f, 0x75, - 0x6e, 0x74, 0x5f, 0x64, 0x65, 0x70, 0x6c, 0x6f, 0x79, 0x6d, 0x65, 0x6e, 0x74, 0x5f, 0x64, 0x61, - 0x74, 0x61, 0x18, 0x09, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x08, 0x2e, 0x41, 0x64, 0x64, 0x72, 0x65, - 0x73, 0x73, 0x52, 0x15, 0x61, 0x63, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x44, 0x65, 0x70, 0x6c, 0x6f, - 0x79, 0x6d, 0x65, 0x6e, 0x74, 0x44, 0x61, 0x74, 0x61, 0x12, 0x21, 0x0a, 0x0c, 0x6e, 0x6f, 0x6e, - 0x63, 0x65, 0x5f, 0x64, 0x6f, 0x6d, 0x61, 0x69, 0x6e, 0x18, 0x0a, 0x20, 0x01, 0x28, 0x09, 0x52, - 0x0b, 0x6e, 0x6f, 0x6e, 0x63, 0x65, 0x44, 0x6f, 0x6d, 0x61, 0x69, 0x6e, 0x12, 0x1d, 0x0a, 0x0a, - 0x66, 0x65, 0x65, 0x5f, 0x64, 0x6f, 0x6d, 0x61, 0x69, 0x6e, 0x18, 0x0b, 0x20, 0x01, 0x28, 0x09, - 0x52, 0x09, 0x66, 0x65, 0x65, 0x44, 0x6f, 0x6d, 0x61, 0x69, 0x6e, 0x1a, 0x9b, 0x01, 0x0a, 0x06, - 0x44, 0x65, 0x70, 0x6c, 0x6f, 0x79, 0x12, 0x24, 0x0a, 0x0a, 0x63, 0x6c, 0x61, 0x73, 0x73, 0x5f, - 0x68, 0x61, 0x73, 0x68, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x05, 0x2e, 0x48, 0x61, 0x73, - 0x68, 0x52, 0x09, 0x63, 0x6c, 0x61, 0x73, 0x73, 0x48, 0x61, 0x73, 0x68, 0x12, 0x2b, 0x0a, 0x0c, - 0x61, 0x64, 0x64, 0x72, 0x65, 0x73, 0x73, 0x5f, 0x73, 0x61, 0x6c, 0x74, 0x18, 0x02, 0x20, 0x01, - 0x28, 0x0b, 0x32, 0x08, 0x2e, 0x46, 0x65, 0x6c, 0x74, 0x32, 0x35, 0x32, 0x52, 0x0b, 0x61, 0x64, - 0x64, 0x72, 0x65, 0x73, 0x73, 0x53, 0x61, 0x6c, 0x74, 0x12, 0x24, 0x0a, 0x08, 0x63, 0x61, 0x6c, - 0x6c, 0x64, 0x61, 0x74, 0x61, 0x18, 0x03, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x08, 0x2e, 0x46, 0x65, - 0x6c, 0x74, 0x32, 0x35, 0x32, 0x52, 0x08, 0x63, 0x61, 0x6c, 0x6c, 0x64, 0x61, 0x74, 0x61, 0x12, - 0x18, 0x0a, 0x07, 0x76, 0x65, 0x72, 0x73, 0x69, 0x6f, 0x6e, 0x18, 0x04, 0x20, 0x01, 0x28, 0x0d, - 0x52, 0x07, 0x76, 0x65, 0x72, 0x73, 0x69, 0x6f, 0x6e, 0x1a, 0xfe, 0x01, 0x0a, 0x0f, 0x44, 0x65, - 0x70, 0x6c, 0x6f, 0x79, 0x41, 0x63, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x56, 0x31, 0x12, 0x21, 0x0a, - 0x07, 0x6d, 0x61, 0x78, 0x5f, 0x66, 0x65, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x08, - 0x2e, 0x46, 0x65, 0x6c, 0x74, 0x32, 0x35, 0x32, 0x52, 0x06, 0x6d, 0x61, 0x78, 0x46, 0x65, 0x65, - 0x12, 0x2f, 0x0a, 0x09, 0x73, 0x69, 0x67, 0x6e, 0x61, 0x74, 0x75, 0x72, 0x65, 0x18, 0x02, 0x20, - 0x01, 0x28, 0x0b, 0x32, 0x11, 0x2e, 0x41, 0x63, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x53, 0x69, 0x67, - 0x6e, 0x61, 0x74, 0x75, 0x72, 0x65, 0x52, 0x09, 0x73, 0x69, 0x67, 0x6e, 0x61, 0x74, 0x75, 0x72, - 0x65, 0x12, 0x24, 0x0a, 0x0a, 0x63, 0x6c, 0x61, 0x73, 0x73, 0x5f, 0x68, 0x61, 0x73, 0x68, 0x18, - 0x03, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x05, 0x2e, 0x48, 0x61, 0x73, 0x68, 0x52, 0x09, 0x63, 0x6c, - 0x61, 0x73, 0x73, 0x48, 0x61, 0x73, 0x68, 0x12, 0x1e, 0x0a, 0x05, 0x6e, 0x6f, 0x6e, 0x63, 0x65, - 0x18, 0x04, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x08, 0x2e, 0x46, 0x65, 0x6c, 0x74, 0x32, 0x35, 0x32, - 0x52, 0x05, 0x6e, 0x6f, 0x6e, 0x63, 0x65, 0x12, 0x2b, 0x0a, 0x0c, 0x61, 0x64, 0x64, 0x72, 0x65, - 0x73, 0x73, 0x5f, 0x73, 0x61, 0x6c, 0x74, 0x18, 0x05, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x08, 0x2e, - 0x46, 0x65, 0x6c, 0x74, 0x32, 0x35, 0x32, 0x52, 0x0b, 0x61, 0x64, 0x64, 0x72, 0x65, 0x73, 0x73, - 0x53, 0x61, 0x6c, 0x74, 0x12, 0x24, 0x0a, 0x08, 0x63, 0x61, 0x6c, 0x6c, 0x64, 0x61, 0x74, 0x61, - 0x18, 0x06, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x08, 0x2e, 0x46, 0x65, 0x6c, 0x74, 0x32, 0x35, 0x32, - 0x52, 0x08, 0x63, 0x61, 0x6c, 0x6c, 0x64, 0x61, 0x74, 0x61, 0x1a, 0xa4, 0x03, 0x0a, 0x0f, 0x44, - 0x65, 0x70, 0x6c, 0x6f, 0x79, 0x41, 0x63, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x56, 0x33, 0x12, 0x2f, - 0x0a, 0x09, 0x73, 0x69, 0x67, 0x6e, 0x61, 0x74, 0x75, 0x72, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, - 0x0b, 0x32, 0x11, 0x2e, 0x41, 0x63, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x53, 0x69, 0x67, 0x6e, 0x61, - 0x74, 0x75, 0x72, 0x65, 0x52, 0x09, 0x73, 0x69, 0x67, 0x6e, 0x61, 0x74, 0x75, 0x72, 0x65, 0x12, - 0x24, 0x0a, 0x0a, 0x63, 0x6c, 0x61, 0x73, 0x73, 0x5f, 0x68, 0x61, 0x73, 0x68, 0x18, 0x02, 0x20, - 0x01, 0x28, 0x0b, 0x32, 0x05, 0x2e, 0x48, 0x61, 0x73, 0x68, 0x52, 0x09, 0x63, 0x6c, 0x61, 0x73, - 0x73, 0x48, 0x61, 0x73, 0x68, 0x12, 0x1e, 0x0a, 0x05, 0x6e, 0x6f, 0x6e, 0x63, 0x65, 0x18, 0x03, - 0x20, 0x01, 0x28, 0x0b, 0x32, 0x08, 0x2e, 0x46, 0x65, 0x6c, 0x74, 0x32, 0x35, 0x32, 0x52, 0x05, - 0x6e, 0x6f, 0x6e, 0x63, 0x65, 0x12, 0x2b, 0x0a, 0x0c, 0x61, 0x64, 0x64, 0x72, 0x65, 0x73, 0x73, - 0x5f, 0x73, 0x61, 0x6c, 0x74, 0x18, 0x04, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x08, 0x2e, 0x46, 0x65, - 0x6c, 0x74, 0x32, 0x35, 0x32, 0x52, 0x0b, 0x61, 0x64, 0x64, 0x72, 0x65, 0x73, 0x73, 0x53, 0x61, - 0x6c, 0x74, 0x12, 0x24, 0x0a, 0x08, 0x63, 0x61, 0x6c, 0x6c, 0x64, 0x61, 0x74, 0x61, 0x18, 0x05, - 0x20, 0x03, 0x28, 0x0b, 0x32, 0x08, 0x2e, 0x46, 0x65, 0x6c, 0x74, 0x32, 0x35, 0x32, 0x52, 0x08, - 0x63, 0x61, 0x6c, 0x6c, 0x64, 0x61, 0x74, 0x61, 0x12, 0x38, 0x0a, 0x0f, 0x72, 0x65, 0x73, 0x6f, - 0x75, 0x72, 0x63, 0x65, 0x5f, 0x62, 0x6f, 0x75, 0x6e, 0x64, 0x73, 0x18, 0x06, 0x20, 0x01, 0x28, - 0x0b, 0x32, 0x0f, 0x2e, 0x52, 0x65, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x42, 0x6f, 0x75, 0x6e, - 0x64, 0x73, 0x52, 0x0e, 0x72, 0x65, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x42, 0x6f, 0x75, 0x6e, - 0x64, 0x73, 0x12, 0x1a, 0x0a, 0x03, 0x74, 0x69, 0x70, 0x18, 0x07, 0x20, 0x01, 0x28, 0x0b, 0x32, - 0x08, 0x2e, 0x46, 0x65, 0x6c, 0x74, 0x32, 0x35, 0x32, 0x52, 0x03, 0x74, 0x69, 0x70, 0x12, 0x2f, - 0x0a, 0x0e, 0x70, 0x61, 0x79, 0x6d, 0x61, 0x73, 0x74, 0x65, 0x72, 0x5f, 0x64, 0x61, 0x74, 0x61, - 0x18, 0x08, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x08, 0x2e, 0x41, 0x64, 0x64, 0x72, 0x65, 0x73, 0x73, - 0x52, 0x0d, 0x70, 0x61, 0x79, 0x6d, 0x61, 0x73, 0x74, 0x65, 0x72, 0x44, 0x61, 0x74, 0x61, 0x12, - 0x21, 0x0a, 0x0c, 0x6e, 0x6f, 0x6e, 0x63, 0x65, 0x5f, 0x64, 0x6f, 0x6d, 0x61, 0x69, 0x6e, 0x18, - 0x09, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0b, 0x6e, 0x6f, 0x6e, 0x63, 0x65, 0x44, 0x6f, 0x6d, 0x61, - 0x69, 0x6e, 0x12, 0x1d, 0x0a, 0x0a, 0x66, 0x65, 0x65, 0x5f, 0x64, 0x6f, 0x6d, 0x61, 0x69, 0x6e, - 0x18, 0x0a, 0x20, 0x01, 0x28, 0x09, 0x52, 0x09, 0x66, 0x65, 0x65, 0x44, 0x6f, 0x6d, 0x61, 0x69, - 0x6e, 0x1a, 0xe4, 0x01, 0x0a, 0x08, 0x49, 0x6e, 0x76, 0x6f, 0x6b, 0x65, 0x56, 0x30, 0x12, 0x21, - 0x0a, 0x07, 0x6d, 0x61, 0x78, 0x5f, 0x66, 0x65, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, + 0x72, 0x65, 0x56, 0x32, 0x48, 0x00, 0x52, 0x09, 0x64, 0x65, 0x63, 0x6c, 0x61, 0x72, 0x65, 0x56, + 0x32, 0x12, 0x37, 0x0a, 0x0a, 0x64, 0x65, 0x63, 0x6c, 0x61, 0x72, 0x65, 0x5f, 0x76, 0x33, 0x18, + 0x04, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x16, 0x2e, 0x54, 0x72, 0x61, 0x6e, 0x73, 0x61, 0x63, 0x74, + 0x69, 0x6f, 0x6e, 0x2e, 0x44, 0x65, 0x63, 0x6c, 0x61, 0x72, 0x65, 0x56, 0x33, 0x48, 0x00, 0x52, + 0x09, 0x64, 0x65, 0x63, 0x6c, 0x61, 0x72, 0x65, 0x56, 0x33, 0x12, 0x2d, 0x0a, 0x06, 0x64, 0x65, + 0x70, 0x6c, 0x6f, 0x79, 0x18, 0x05, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x13, 0x2e, 0x54, 0x72, 0x61, + 0x6e, 0x73, 0x61, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x2e, 0x44, 0x65, 0x70, 0x6c, 0x6f, 0x79, 0x48, + 0x00, 0x52, 0x06, 0x64, 0x65, 0x70, 0x6c, 0x6f, 0x79, 0x12, 0x4a, 0x0a, 0x11, 0x64, 0x65, 0x70, + 0x6c, 0x6f, 0x79, 0x5f, 0x61, 0x63, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x5f, 0x76, 0x31, 0x18, 0x06, + 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1c, 0x2e, 0x54, 0x72, 0x61, 0x6e, 0x73, 0x61, 0x63, 0x74, 0x69, + 0x6f, 0x6e, 0x2e, 0x44, 0x65, 0x70, 0x6c, 0x6f, 0x79, 0x41, 0x63, 0x63, 0x6f, 0x75, 0x6e, 0x74, + 0x56, 0x31, 0x48, 0x00, 0x52, 0x0f, 0x64, 0x65, 0x70, 0x6c, 0x6f, 0x79, 0x41, 0x63, 0x63, 0x6f, + 0x75, 0x6e, 0x74, 0x56, 0x31, 0x12, 0x4a, 0x0a, 0x11, 0x64, 0x65, 0x70, 0x6c, 0x6f, 0x79, 0x5f, + 0x61, 0x63, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x5f, 0x76, 0x33, 0x18, 0x07, 0x20, 0x01, 0x28, 0x0b, + 0x32, 0x1c, 0x2e, 0x54, 0x72, 0x61, 0x6e, 0x73, 0x61, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x2e, 0x44, + 0x65, 0x70, 0x6c, 0x6f, 0x79, 0x41, 0x63, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x56, 0x33, 0x48, 0x00, + 0x52, 0x0f, 0x64, 0x65, 0x70, 0x6c, 0x6f, 0x79, 0x41, 0x63, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x56, + 0x33, 0x12, 0x34, 0x0a, 0x09, 0x69, 0x6e, 0x76, 0x6f, 0x6b, 0x65, 0x5f, 0x76, 0x30, 0x18, 0x08, + 0x20, 0x01, 0x28, 0x0b, 0x32, 0x15, 0x2e, 0x54, 0x72, 0x61, 0x6e, 0x73, 0x61, 0x63, 0x74, 0x69, + 0x6f, 0x6e, 0x2e, 0x49, 0x6e, 0x76, 0x6f, 0x6b, 0x65, 0x56, 0x30, 0x48, 0x00, 0x52, 0x08, 0x69, + 0x6e, 0x76, 0x6f, 0x6b, 0x65, 0x56, 0x30, 0x12, 0x34, 0x0a, 0x09, 0x69, 0x6e, 0x76, 0x6f, 0x6b, + 0x65, 0x5f, 0x76, 0x31, 0x18, 0x09, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x15, 0x2e, 0x54, 0x72, 0x61, + 0x6e, 0x73, 0x61, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x2e, 0x49, 0x6e, 0x76, 0x6f, 0x6b, 0x65, 0x56, + 0x31, 0x48, 0x00, 0x52, 0x08, 0x69, 0x6e, 0x76, 0x6f, 0x6b, 0x65, 0x56, 0x31, 0x12, 0x34, 0x0a, + 0x09, 0x69, 0x6e, 0x76, 0x6f, 0x6b, 0x65, 0x5f, 0x76, 0x33, 0x18, 0x0a, 0x20, 0x01, 0x28, 0x0b, + 0x32, 0x15, 0x2e, 0x54, 0x72, 0x61, 0x6e, 0x73, 0x61, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x2e, 0x49, + 0x6e, 0x76, 0x6f, 0x6b, 0x65, 0x56, 0x33, 0x48, 0x00, 0x52, 0x08, 0x69, 0x6e, 0x76, 0x6f, 0x6b, + 0x65, 0x56, 0x33, 0x12, 0x39, 0x0a, 0x0a, 0x6c, 0x31, 0x5f, 0x68, 0x61, 0x6e, 0x64, 0x6c, 0x65, + 0x72, 0x18, 0x0b, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x18, 0x2e, 0x54, 0x72, 0x61, 0x6e, 0x73, 0x61, + 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x2e, 0x4c, 0x31, 0x48, 0x61, 0x6e, 0x64, 0x6c, 0x65, 0x72, 0x56, + 0x30, 0x48, 0x00, 0x52, 0x09, 0x6c, 0x31, 0x48, 0x61, 0x6e, 0x64, 0x6c, 0x65, 0x72, 0x1a, 0xa7, + 0x01, 0x0a, 0x09, 0x44, 0x65, 0x63, 0x6c, 0x61, 0x72, 0x65, 0x56, 0x30, 0x12, 0x20, 0x0a, 0x06, + 0x73, 0x65, 0x6e, 0x64, 0x65, 0x72, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x08, 0x2e, 0x41, + 0x64, 0x64, 0x72, 0x65, 0x73, 0x73, 0x52, 0x06, 0x73, 0x65, 0x6e, 0x64, 0x65, 0x72, 0x12, 0x21, + 0x0a, 0x07, 0x6d, 0x61, 0x78, 0x5f, 0x66, 0x65, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x08, 0x2e, 0x46, 0x65, 0x6c, 0x74, 0x32, 0x35, 0x32, 0x52, 0x06, 0x6d, 0x61, 0x78, 0x46, 0x65, - 0x65, 0x12, 0x2f, 0x0a, 0x09, 0x73, 0x69, 0x67, 0x6e, 0x61, 0x74, 0x75, 0x72, 0x65, 0x18, 0x02, + 0x65, 0x12, 0x2f, 0x0a, 0x09, 0x73, 0x69, 0x67, 0x6e, 0x61, 0x74, 0x75, 0x72, 0x65, 0x18, 0x03, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x11, 0x2e, 0x41, 0x63, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x53, 0x69, 0x67, 0x6e, 0x61, 0x74, 0x75, 0x72, 0x65, 0x52, 0x09, 0x73, 0x69, 0x67, 0x6e, 0x61, 0x74, 0x75, - 0x72, 0x65, 0x12, 0x22, 0x0a, 0x07, 0x61, 0x64, 0x64, 0x72, 0x65, 0x73, 0x73, 0x18, 0x03, 0x20, - 0x01, 0x28, 0x0b, 0x32, 0x08, 0x2e, 0x41, 0x64, 0x64, 0x72, 0x65, 0x73, 0x73, 0x52, 0x07, 0x61, - 0x64, 0x64, 0x72, 0x65, 0x73, 0x73, 0x12, 0x3a, 0x0a, 0x14, 0x65, 0x6e, 0x74, 0x72, 0x79, 0x5f, - 0x70, 0x6f, 0x69, 0x6e, 0x74, 0x5f, 0x73, 0x65, 0x6c, 0x65, 0x63, 0x74, 0x6f, 0x72, 0x18, 0x04, - 0x20, 0x01, 0x28, 0x0b, 0x32, 0x08, 0x2e, 0x46, 0x65, 0x6c, 0x74, 0x32, 0x35, 0x32, 0x52, 0x12, - 0x65, 0x6e, 0x74, 0x72, 0x79, 0x50, 0x6f, 0x69, 0x6e, 0x74, 0x53, 0x65, 0x6c, 0x65, 0x63, 0x74, - 0x6f, 0x72, 0x12, 0x24, 0x0a, 0x08, 0x63, 0x61, 0x6c, 0x6c, 0x64, 0x61, 0x74, 0x61, 0x18, 0x05, - 0x20, 0x03, 0x28, 0x0b, 0x32, 0x08, 0x2e, 0x46, 0x65, 0x6c, 0x74, 0x32, 0x35, 0x32, 0x52, 0x08, - 0x63, 0x61, 0x6c, 0x6c, 0x64, 0x61, 0x74, 0x61, 0x1a, 0xc6, 0x01, 0x0a, 0x08, 0x49, 0x6e, 0x76, - 0x6f, 0x6b, 0x65, 0x56, 0x31, 0x12, 0x20, 0x0a, 0x06, 0x73, 0x65, 0x6e, 0x64, 0x65, 0x72, 0x18, - 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x08, 0x2e, 0x41, 0x64, 0x64, 0x72, 0x65, 0x73, 0x73, 0x52, - 0x06, 0x73, 0x65, 0x6e, 0x64, 0x65, 0x72, 0x12, 0x21, 0x0a, 0x07, 0x6d, 0x61, 0x78, 0x5f, 0x66, - 0x65, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x08, 0x2e, 0x46, 0x65, 0x6c, 0x74, 0x32, + 0x72, 0x65, 0x12, 0x24, 0x0a, 0x0a, 0x63, 0x6c, 0x61, 0x73, 0x73, 0x5f, 0x68, 0x61, 0x73, 0x68, + 0x18, 0x04, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x05, 0x2e, 0x48, 0x61, 0x73, 0x68, 0x52, 0x09, 0x63, + 0x6c, 0x61, 0x73, 0x73, 0x48, 0x61, 0x73, 0x68, 0x1a, 0xc7, 0x01, 0x0a, 0x09, 0x44, 0x65, 0x63, + 0x6c, 0x61, 0x72, 0x65, 0x56, 0x31, 0x12, 0x20, 0x0a, 0x06, 0x73, 0x65, 0x6e, 0x64, 0x65, 0x72, + 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x08, 0x2e, 0x41, 0x64, 0x64, 0x72, 0x65, 0x73, 0x73, + 0x52, 0x06, 0x73, 0x65, 0x6e, 0x64, 0x65, 0x72, 0x12, 0x21, 0x0a, 0x07, 0x6d, 0x61, 0x78, 0x5f, + 0x66, 0x65, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x08, 0x2e, 0x46, 0x65, 0x6c, 0x74, + 0x32, 0x35, 0x32, 0x52, 0x06, 0x6d, 0x61, 0x78, 0x46, 0x65, 0x65, 0x12, 0x2f, 0x0a, 0x09, 0x73, + 0x69, 0x67, 0x6e, 0x61, 0x74, 0x75, 0x72, 0x65, 0x18, 0x03, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x11, + 0x2e, 0x41, 0x63, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x53, 0x69, 0x67, 0x6e, 0x61, 0x74, 0x75, 0x72, + 0x65, 0x52, 0x09, 0x73, 0x69, 0x67, 0x6e, 0x61, 0x74, 0x75, 0x72, 0x65, 0x12, 0x24, 0x0a, 0x0a, + 0x63, 0x6c, 0x61, 0x73, 0x73, 0x5f, 0x68, 0x61, 0x73, 0x68, 0x18, 0x04, 0x20, 0x01, 0x28, 0x0b, + 0x32, 0x05, 0x2e, 0x48, 0x61, 0x73, 0x68, 0x52, 0x09, 0x63, 0x6c, 0x61, 0x73, 0x73, 0x48, 0x61, + 0x73, 0x68, 0x12, 0x1e, 0x0a, 0x05, 0x6e, 0x6f, 0x6e, 0x63, 0x65, 0x18, 0x05, 0x20, 0x01, 0x28, + 0x0b, 0x32, 0x08, 0x2e, 0x46, 0x65, 0x6c, 0x74, 0x32, 0x35, 0x32, 0x52, 0x05, 0x6e, 0x6f, 0x6e, + 0x63, 0x65, 0x1a, 0xfe, 0x01, 0x0a, 0x09, 0x44, 0x65, 0x63, 0x6c, 0x61, 0x72, 0x65, 0x56, 0x32, + 0x12, 0x20, 0x0a, 0x06, 0x73, 0x65, 0x6e, 0x64, 0x65, 0x72, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, + 0x32, 0x08, 0x2e, 0x41, 0x64, 0x64, 0x72, 0x65, 0x73, 0x73, 0x52, 0x06, 0x73, 0x65, 0x6e, 0x64, + 0x65, 0x72, 0x12, 0x21, 0x0a, 0x07, 0x6d, 0x61, 0x78, 0x5f, 0x66, 0x65, 0x65, 0x18, 0x02, 0x20, + 0x01, 0x28, 0x0b, 0x32, 0x08, 0x2e, 0x46, 0x65, 0x6c, 0x74, 0x32, 0x35, 0x32, 0x52, 0x06, 0x6d, + 0x61, 0x78, 0x46, 0x65, 0x65, 0x12, 0x2f, 0x0a, 0x09, 0x73, 0x69, 0x67, 0x6e, 0x61, 0x74, 0x75, + 0x72, 0x65, 0x18, 0x03, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x11, 0x2e, 0x41, 0x63, 0x63, 0x6f, 0x75, + 0x6e, 0x74, 0x53, 0x69, 0x67, 0x6e, 0x61, 0x74, 0x75, 0x72, 0x65, 0x52, 0x09, 0x73, 0x69, 0x67, + 0x6e, 0x61, 0x74, 0x75, 0x72, 0x65, 0x12, 0x24, 0x0a, 0x0a, 0x63, 0x6c, 0x61, 0x73, 0x73, 0x5f, + 0x68, 0x61, 0x73, 0x68, 0x18, 0x04, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x05, 0x2e, 0x48, 0x61, 0x73, + 0x68, 0x52, 0x09, 0x63, 0x6c, 0x61, 0x73, 0x73, 0x48, 0x61, 0x73, 0x68, 0x12, 0x1e, 0x0a, 0x05, + 0x6e, 0x6f, 0x6e, 0x63, 0x65, 0x18, 0x05, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x08, 0x2e, 0x46, 0x65, + 0x6c, 0x74, 0x32, 0x35, 0x32, 0x52, 0x05, 0x6e, 0x6f, 0x6e, 0x63, 0x65, 0x12, 0x35, 0x0a, 0x13, + 0x63, 0x6f, 0x6d, 0x70, 0x69, 0x6c, 0x65, 0x64, 0x5f, 0x63, 0x6c, 0x61, 0x73, 0x73, 0x5f, 0x68, + 0x61, 0x73, 0x68, 0x18, 0x06, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x05, 0x2e, 0x48, 0x61, 0x73, 0x68, + 0x52, 0x11, 0x63, 0x6f, 0x6d, 0x70, 0x69, 0x6c, 0x65, 0x64, 0x43, 0x6c, 0x61, 0x73, 0x73, 0x48, + 0x61, 0x73, 0x68, 0x1a, 0xba, 0x04, 0x0a, 0x09, 0x44, 0x65, 0x63, 0x6c, 0x61, 0x72, 0x65, 0x56, + 0x33, 0x12, 0x20, 0x0a, 0x06, 0x73, 0x65, 0x6e, 0x64, 0x65, 0x72, 0x18, 0x01, 0x20, 0x01, 0x28, + 0x0b, 0x32, 0x08, 0x2e, 0x41, 0x64, 0x64, 0x72, 0x65, 0x73, 0x73, 0x52, 0x06, 0x73, 0x65, 0x6e, + 0x64, 0x65, 0x72, 0x12, 0x2f, 0x0a, 0x09, 0x73, 0x69, 0x67, 0x6e, 0x61, 0x74, 0x75, 0x72, 0x65, + 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x11, 0x2e, 0x41, 0x63, 0x63, 0x6f, 0x75, 0x6e, 0x74, + 0x53, 0x69, 0x67, 0x6e, 0x61, 0x74, 0x75, 0x72, 0x65, 0x52, 0x09, 0x73, 0x69, 0x67, 0x6e, 0x61, + 0x74, 0x75, 0x72, 0x65, 0x12, 0x24, 0x0a, 0x0a, 0x63, 0x6c, 0x61, 0x73, 0x73, 0x5f, 0x68, 0x61, + 0x73, 0x68, 0x18, 0x03, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x05, 0x2e, 0x48, 0x61, 0x73, 0x68, 0x52, + 0x09, 0x63, 0x6c, 0x61, 0x73, 0x73, 0x48, 0x61, 0x73, 0x68, 0x12, 0x1e, 0x0a, 0x05, 0x6e, 0x6f, + 0x6e, 0x63, 0x65, 0x18, 0x04, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x08, 0x2e, 0x46, 0x65, 0x6c, 0x74, + 0x32, 0x35, 0x32, 0x52, 0x05, 0x6e, 0x6f, 0x6e, 0x63, 0x65, 0x12, 0x35, 0x0a, 0x13, 0x63, 0x6f, + 0x6d, 0x70, 0x69, 0x6c, 0x65, 0x64, 0x5f, 0x63, 0x6c, 0x61, 0x73, 0x73, 0x5f, 0x68, 0x61, 0x73, + 0x68, 0x18, 0x05, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x05, 0x2e, 0x48, 0x61, 0x73, 0x68, 0x52, 0x11, + 0x63, 0x6f, 0x6d, 0x70, 0x69, 0x6c, 0x65, 0x64, 0x43, 0x6c, 0x61, 0x73, 0x73, 0x48, 0x61, 0x73, + 0x68, 0x12, 0x38, 0x0a, 0x0f, 0x72, 0x65, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x5f, 0x62, 0x6f, + 0x75, 0x6e, 0x64, 0x73, 0x18, 0x06, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x0f, 0x2e, 0x52, 0x65, 0x73, + 0x6f, 0x75, 0x72, 0x63, 0x65, 0x42, 0x6f, 0x75, 0x6e, 0x64, 0x73, 0x52, 0x0e, 0x72, 0x65, 0x73, + 0x6f, 0x75, 0x72, 0x63, 0x65, 0x42, 0x6f, 0x75, 0x6e, 0x64, 0x73, 0x12, 0x10, 0x0a, 0x03, 0x74, + 0x69, 0x70, 0x18, 0x07, 0x20, 0x01, 0x28, 0x04, 0x52, 0x03, 0x74, 0x69, 0x70, 0x12, 0x2f, 0x0a, + 0x0e, 0x70, 0x61, 0x79, 0x6d, 0x61, 0x73, 0x74, 0x65, 0x72, 0x5f, 0x64, 0x61, 0x74, 0x61, 0x18, + 0x08, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x08, 0x2e, 0x46, 0x65, 0x6c, 0x74, 0x32, 0x35, 0x32, 0x52, + 0x0d, 0x70, 0x61, 0x79, 0x6d, 0x61, 0x73, 0x74, 0x65, 0x72, 0x44, 0x61, 0x74, 0x61, 0x12, 0x40, + 0x0a, 0x17, 0x61, 0x63, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x5f, 0x64, 0x65, 0x70, 0x6c, 0x6f, 0x79, + 0x6d, 0x65, 0x6e, 0x74, 0x5f, 0x64, 0x61, 0x74, 0x61, 0x18, 0x09, 0x20, 0x03, 0x28, 0x0b, 0x32, + 0x08, 0x2e, 0x46, 0x65, 0x6c, 0x74, 0x32, 0x35, 0x32, 0x52, 0x15, 0x61, 0x63, 0x63, 0x6f, 0x75, + 0x6e, 0x74, 0x44, 0x65, 0x70, 0x6c, 0x6f, 0x79, 0x6d, 0x65, 0x6e, 0x74, 0x44, 0x61, 0x74, 0x61, + 0x12, 0x50, 0x0a, 0x1c, 0x6e, 0x6f, 0x6e, 0x63, 0x65, 0x5f, 0x64, 0x61, 0x74, 0x61, 0x5f, 0x61, + 0x76, 0x61, 0x69, 0x6c, 0x61, 0x62, 0x69, 0x6c, 0x69, 0x74, 0x79, 0x5f, 0x6d, 0x6f, 0x64, 0x65, + 0x18, 0x0a, 0x20, 0x01, 0x28, 0x0e, 0x32, 0x0f, 0x2e, 0x56, 0x6f, 0x6c, 0x69, 0x74, 0x69, 0x6f, + 0x6e, 0x44, 0x6f, 0x6d, 0x61, 0x69, 0x6e, 0x52, 0x19, 0x6e, 0x6f, 0x6e, 0x63, 0x65, 0x44, 0x61, + 0x74, 0x61, 0x41, 0x76, 0x61, 0x69, 0x6c, 0x61, 0x62, 0x69, 0x6c, 0x69, 0x74, 0x79, 0x4d, 0x6f, + 0x64, 0x65, 0x12, 0x4c, 0x0a, 0x1a, 0x66, 0x65, 0x65, 0x5f, 0x64, 0x61, 0x74, 0x61, 0x5f, 0x61, + 0x76, 0x61, 0x69, 0x6c, 0x61, 0x62, 0x69, 0x6c, 0x69, 0x74, 0x79, 0x5f, 0x6d, 0x6f, 0x64, 0x65, + 0x18, 0x0b, 0x20, 0x01, 0x28, 0x0e, 0x32, 0x0f, 0x2e, 0x56, 0x6f, 0x6c, 0x69, 0x74, 0x69, 0x6f, + 0x6e, 0x44, 0x6f, 0x6d, 0x61, 0x69, 0x6e, 0x52, 0x17, 0x66, 0x65, 0x65, 0x44, 0x61, 0x74, 0x61, + 0x41, 0x76, 0x61, 0x69, 0x6c, 0x61, 0x62, 0x69, 0x6c, 0x69, 0x74, 0x79, 0x4d, 0x6f, 0x64, 0x65, + 0x1a, 0x9b, 0x01, 0x0a, 0x06, 0x44, 0x65, 0x70, 0x6c, 0x6f, 0x79, 0x12, 0x24, 0x0a, 0x0a, 0x63, + 0x6c, 0x61, 0x73, 0x73, 0x5f, 0x68, 0x61, 0x73, 0x68, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, + 0x05, 0x2e, 0x48, 0x61, 0x73, 0x68, 0x52, 0x09, 0x63, 0x6c, 0x61, 0x73, 0x73, 0x48, 0x61, 0x73, + 0x68, 0x12, 0x2b, 0x0a, 0x0c, 0x61, 0x64, 0x64, 0x72, 0x65, 0x73, 0x73, 0x5f, 0x73, 0x61, 0x6c, + 0x74, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x08, 0x2e, 0x46, 0x65, 0x6c, 0x74, 0x32, 0x35, + 0x32, 0x52, 0x0b, 0x61, 0x64, 0x64, 0x72, 0x65, 0x73, 0x73, 0x53, 0x61, 0x6c, 0x74, 0x12, 0x24, + 0x0a, 0x08, 0x63, 0x61, 0x6c, 0x6c, 0x64, 0x61, 0x74, 0x61, 0x18, 0x03, 0x20, 0x03, 0x28, 0x0b, + 0x32, 0x08, 0x2e, 0x46, 0x65, 0x6c, 0x74, 0x32, 0x35, 0x32, 0x52, 0x08, 0x63, 0x61, 0x6c, 0x6c, + 0x64, 0x61, 0x74, 0x61, 0x12, 0x18, 0x0a, 0x07, 0x76, 0x65, 0x72, 0x73, 0x69, 0x6f, 0x6e, 0x18, + 0x04, 0x20, 0x01, 0x28, 0x0d, 0x52, 0x07, 0x76, 0x65, 0x72, 0x73, 0x69, 0x6f, 0x6e, 0x1a, 0xfe, + 0x01, 0x0a, 0x0f, 0x44, 0x65, 0x70, 0x6c, 0x6f, 0x79, 0x41, 0x63, 0x63, 0x6f, 0x75, 0x6e, 0x74, + 0x56, 0x31, 0x12, 0x21, 0x0a, 0x07, 0x6d, 0x61, 0x78, 0x5f, 0x66, 0x65, 0x65, 0x18, 0x01, 0x20, + 0x01, 0x28, 0x0b, 0x32, 0x08, 0x2e, 0x46, 0x65, 0x6c, 0x74, 0x32, 0x35, 0x32, 0x52, 0x06, 0x6d, + 0x61, 0x78, 0x46, 0x65, 0x65, 0x12, 0x2f, 0x0a, 0x09, 0x73, 0x69, 0x67, 0x6e, 0x61, 0x74, 0x75, + 0x72, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x11, 0x2e, 0x41, 0x63, 0x63, 0x6f, 0x75, + 0x6e, 0x74, 0x53, 0x69, 0x67, 0x6e, 0x61, 0x74, 0x75, 0x72, 0x65, 0x52, 0x09, 0x73, 0x69, 0x67, + 0x6e, 0x61, 0x74, 0x75, 0x72, 0x65, 0x12, 0x24, 0x0a, 0x0a, 0x63, 0x6c, 0x61, 0x73, 0x73, 0x5f, + 0x68, 0x61, 0x73, 0x68, 0x18, 0x03, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x05, 0x2e, 0x48, 0x61, 0x73, + 0x68, 0x52, 0x09, 0x63, 0x6c, 0x61, 0x73, 0x73, 0x48, 0x61, 0x73, 0x68, 0x12, 0x1e, 0x0a, 0x05, + 0x6e, 0x6f, 0x6e, 0x63, 0x65, 0x18, 0x04, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x08, 0x2e, 0x46, 0x65, + 0x6c, 0x74, 0x32, 0x35, 0x32, 0x52, 0x05, 0x6e, 0x6f, 0x6e, 0x63, 0x65, 0x12, 0x2b, 0x0a, 0x0c, + 0x61, 0x64, 0x64, 0x72, 0x65, 0x73, 0x73, 0x5f, 0x73, 0x61, 0x6c, 0x74, 0x18, 0x05, 0x20, 0x01, + 0x28, 0x0b, 0x32, 0x08, 0x2e, 0x46, 0x65, 0x6c, 0x74, 0x32, 0x35, 0x32, 0x52, 0x0b, 0x61, 0x64, + 0x64, 0x72, 0x65, 0x73, 0x73, 0x53, 0x61, 0x6c, 0x74, 0x12, 0x24, 0x0a, 0x08, 0x63, 0x61, 0x6c, + 0x6c, 0x64, 0x61, 0x74, 0x61, 0x18, 0x06, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x08, 0x2e, 0x46, 0x65, + 0x6c, 0x74, 0x32, 0x35, 0x32, 0x52, 0x08, 0x63, 0x61, 0x6c, 0x6c, 0x64, 0x61, 0x74, 0x61, 0x1a, + 0xf8, 0x03, 0x0a, 0x0f, 0x44, 0x65, 0x70, 0x6c, 0x6f, 0x79, 0x41, 0x63, 0x63, 0x6f, 0x75, 0x6e, + 0x74, 0x56, 0x33, 0x12, 0x2f, 0x0a, 0x09, 0x73, 0x69, 0x67, 0x6e, 0x61, 0x74, 0x75, 0x72, 0x65, + 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x11, 0x2e, 0x41, 0x63, 0x63, 0x6f, 0x75, 0x6e, 0x74, + 0x53, 0x69, 0x67, 0x6e, 0x61, 0x74, 0x75, 0x72, 0x65, 0x52, 0x09, 0x73, 0x69, 0x67, 0x6e, 0x61, + 0x74, 0x75, 0x72, 0x65, 0x12, 0x24, 0x0a, 0x0a, 0x63, 0x6c, 0x61, 0x73, 0x73, 0x5f, 0x68, 0x61, + 0x73, 0x68, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x05, 0x2e, 0x48, 0x61, 0x73, 0x68, 0x52, + 0x09, 0x63, 0x6c, 0x61, 0x73, 0x73, 0x48, 0x61, 0x73, 0x68, 0x12, 0x1e, 0x0a, 0x05, 0x6e, 0x6f, + 0x6e, 0x63, 0x65, 0x18, 0x03, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x08, 0x2e, 0x46, 0x65, 0x6c, 0x74, + 0x32, 0x35, 0x32, 0x52, 0x05, 0x6e, 0x6f, 0x6e, 0x63, 0x65, 0x12, 0x2b, 0x0a, 0x0c, 0x61, 0x64, + 0x64, 0x72, 0x65, 0x73, 0x73, 0x5f, 0x73, 0x61, 0x6c, 0x74, 0x18, 0x04, 0x20, 0x01, 0x28, 0x0b, + 0x32, 0x08, 0x2e, 0x46, 0x65, 0x6c, 0x74, 0x32, 0x35, 0x32, 0x52, 0x0b, 0x61, 0x64, 0x64, 0x72, + 0x65, 0x73, 0x73, 0x53, 0x61, 0x6c, 0x74, 0x12, 0x24, 0x0a, 0x08, 0x63, 0x61, 0x6c, 0x6c, 0x64, + 0x61, 0x74, 0x61, 0x18, 0x05, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x08, 0x2e, 0x46, 0x65, 0x6c, 0x74, + 0x32, 0x35, 0x32, 0x52, 0x08, 0x63, 0x61, 0x6c, 0x6c, 0x64, 0x61, 0x74, 0x61, 0x12, 0x38, 0x0a, + 0x0f, 0x72, 0x65, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x5f, 0x62, 0x6f, 0x75, 0x6e, 0x64, 0x73, + 0x18, 0x06, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x0f, 0x2e, 0x52, 0x65, 0x73, 0x6f, 0x75, 0x72, 0x63, + 0x65, 0x42, 0x6f, 0x75, 0x6e, 0x64, 0x73, 0x52, 0x0e, 0x72, 0x65, 0x73, 0x6f, 0x75, 0x72, 0x63, + 0x65, 0x42, 0x6f, 0x75, 0x6e, 0x64, 0x73, 0x12, 0x10, 0x0a, 0x03, 0x74, 0x69, 0x70, 0x18, 0x07, + 0x20, 0x01, 0x28, 0x04, 0x52, 0x03, 0x74, 0x69, 0x70, 0x12, 0x2f, 0x0a, 0x0e, 0x70, 0x61, 0x79, + 0x6d, 0x61, 0x73, 0x74, 0x65, 0x72, 0x5f, 0x64, 0x61, 0x74, 0x61, 0x18, 0x08, 0x20, 0x03, 0x28, + 0x0b, 0x32, 0x08, 0x2e, 0x46, 0x65, 0x6c, 0x74, 0x32, 0x35, 0x32, 0x52, 0x0d, 0x70, 0x61, 0x79, + 0x6d, 0x61, 0x73, 0x74, 0x65, 0x72, 0x44, 0x61, 0x74, 0x61, 0x12, 0x50, 0x0a, 0x1c, 0x6e, 0x6f, + 0x6e, 0x63, 0x65, 0x5f, 0x64, 0x61, 0x74, 0x61, 0x5f, 0x61, 0x76, 0x61, 0x69, 0x6c, 0x61, 0x62, + 0x69, 0x6c, 0x69, 0x74, 0x79, 0x5f, 0x6d, 0x6f, 0x64, 0x65, 0x18, 0x09, 0x20, 0x01, 0x28, 0x0e, + 0x32, 0x0f, 0x2e, 0x56, 0x6f, 0x6c, 0x69, 0x74, 0x69, 0x6f, 0x6e, 0x44, 0x6f, 0x6d, 0x61, 0x69, + 0x6e, 0x52, 0x19, 0x6e, 0x6f, 0x6e, 0x63, 0x65, 0x44, 0x61, 0x74, 0x61, 0x41, 0x76, 0x61, 0x69, + 0x6c, 0x61, 0x62, 0x69, 0x6c, 0x69, 0x74, 0x79, 0x4d, 0x6f, 0x64, 0x65, 0x12, 0x4c, 0x0a, 0x1a, + 0x66, 0x65, 0x65, 0x5f, 0x64, 0x61, 0x74, 0x61, 0x5f, 0x61, 0x76, 0x61, 0x69, 0x6c, 0x61, 0x62, + 0x69, 0x6c, 0x69, 0x74, 0x79, 0x5f, 0x6d, 0x6f, 0x64, 0x65, 0x18, 0x0a, 0x20, 0x01, 0x28, 0x0e, + 0x32, 0x0f, 0x2e, 0x56, 0x6f, 0x6c, 0x69, 0x74, 0x69, 0x6f, 0x6e, 0x44, 0x6f, 0x6d, 0x61, 0x69, + 0x6e, 0x52, 0x17, 0x66, 0x65, 0x65, 0x44, 0x61, 0x74, 0x61, 0x41, 0x76, 0x61, 0x69, 0x6c, 0x61, + 0x62, 0x69, 0x6c, 0x69, 0x74, 0x79, 0x4d, 0x6f, 0x64, 0x65, 0x1a, 0xe4, 0x01, 0x0a, 0x08, 0x49, + 0x6e, 0x76, 0x6f, 0x6b, 0x65, 0x56, 0x30, 0x12, 0x21, 0x0a, 0x07, 0x6d, 0x61, 0x78, 0x5f, 0x66, + 0x65, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x08, 0x2e, 0x46, 0x65, 0x6c, 0x74, 0x32, 0x35, 0x32, 0x52, 0x06, 0x6d, 0x61, 0x78, 0x46, 0x65, 0x65, 0x12, 0x2f, 0x0a, 0x09, 0x73, 0x69, - 0x67, 0x6e, 0x61, 0x74, 0x75, 0x72, 0x65, 0x18, 0x03, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x11, 0x2e, + 0x67, 0x6e, 0x61, 0x74, 0x75, 0x72, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x11, 0x2e, 0x41, 0x63, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x53, 0x69, 0x67, 0x6e, 0x61, 0x74, 0x75, 0x72, 0x65, - 0x52, 0x09, 0x73, 0x69, 0x67, 0x6e, 0x61, 0x74, 0x75, 0x72, 0x65, 0x12, 0x24, 0x0a, 0x08, 0x63, - 0x61, 0x6c, 0x6c, 0x64, 0x61, 0x74, 0x61, 0x18, 0x04, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x08, 0x2e, + 0x52, 0x09, 0x73, 0x69, 0x67, 0x6e, 0x61, 0x74, 0x75, 0x72, 0x65, 0x12, 0x22, 0x0a, 0x07, 0x61, + 0x64, 0x64, 0x72, 0x65, 0x73, 0x73, 0x18, 0x03, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x08, 0x2e, 0x41, + 0x64, 0x64, 0x72, 0x65, 0x73, 0x73, 0x52, 0x07, 0x61, 0x64, 0x64, 0x72, 0x65, 0x73, 0x73, 0x12, + 0x3a, 0x0a, 0x14, 0x65, 0x6e, 0x74, 0x72, 0x79, 0x5f, 0x70, 0x6f, 0x69, 0x6e, 0x74, 0x5f, 0x73, + 0x65, 0x6c, 0x65, 0x63, 0x74, 0x6f, 0x72, 0x18, 0x04, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x08, 0x2e, + 0x46, 0x65, 0x6c, 0x74, 0x32, 0x35, 0x32, 0x52, 0x12, 0x65, 0x6e, 0x74, 0x72, 0x79, 0x50, 0x6f, + 0x69, 0x6e, 0x74, 0x53, 0x65, 0x6c, 0x65, 0x63, 0x74, 0x6f, 0x72, 0x12, 0x24, 0x0a, 0x08, 0x63, + 0x61, 0x6c, 0x6c, 0x64, 0x61, 0x74, 0x61, 0x18, 0x05, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x08, 0x2e, 0x46, 0x65, 0x6c, 0x74, 0x32, 0x35, 0x32, 0x52, 0x08, 0x63, 0x61, 0x6c, 0x6c, 0x64, 0x61, 0x74, - 0x61, 0x12, 0x1e, 0x0a, 0x05, 0x6e, 0x6f, 0x6e, 0x63, 0x65, 0x18, 0x05, 0x20, 0x01, 0x28, 0x0b, - 0x32, 0x08, 0x2e, 0x46, 0x65, 0x6c, 0x74, 0x32, 0x35, 0x32, 0x52, 0x05, 0x6e, 0x6f, 0x6e, 0x63, - 0x65, 0x1a, 0xae, 0x03, 0x0a, 0x08, 0x49, 0x6e, 0x76, 0x6f, 0x6b, 0x65, 0x56, 0x33, 0x12, 0x20, + 0x61, 0x1a, 0xc6, 0x01, 0x0a, 0x08, 0x49, 0x6e, 0x76, 0x6f, 0x6b, 0x65, 0x56, 0x31, 0x12, 0x20, 0x0a, 0x06, 0x73, 0x65, 0x6e, 0x64, 0x65, 0x72, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x08, 0x2e, 0x41, 0x64, 0x64, 0x72, 0x65, 0x73, 0x73, 0x52, 0x06, 0x73, 0x65, 0x6e, 0x64, 0x65, 0x72, - 0x12, 0x2f, 0x0a, 0x09, 0x73, 0x69, 0x67, 0x6e, 0x61, 0x74, 0x75, 0x72, 0x65, 0x18, 0x02, 0x20, - 0x01, 0x28, 0x0b, 0x32, 0x11, 0x2e, 0x41, 0x63, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x53, 0x69, 0x67, - 0x6e, 0x61, 0x74, 0x75, 0x72, 0x65, 0x52, 0x09, 0x73, 0x69, 0x67, 0x6e, 0x61, 0x74, 0x75, 0x72, - 0x65, 0x12, 0x24, 0x0a, 0x08, 0x63, 0x61, 0x6c, 0x6c, 0x64, 0x61, 0x74, 0x61, 0x18, 0x03, 0x20, - 0x03, 0x28, 0x0b, 0x32, 0x08, 0x2e, 0x46, 0x65, 0x6c, 0x74, 0x32, 0x35, 0x32, 0x52, 0x08, 0x63, - 0x61, 0x6c, 0x6c, 0x64, 0x61, 0x74, 0x61, 0x12, 0x38, 0x0a, 0x0f, 0x72, 0x65, 0x73, 0x6f, 0x75, - 0x72, 0x63, 0x65, 0x5f, 0x62, 0x6f, 0x75, 0x6e, 0x64, 0x73, 0x18, 0x04, 0x20, 0x01, 0x28, 0x0b, - 0x32, 0x0f, 0x2e, 0x52, 0x65, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x42, 0x6f, 0x75, 0x6e, 0x64, - 0x73, 0x52, 0x0e, 0x72, 0x65, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x42, 0x6f, 0x75, 0x6e, 0x64, - 0x73, 0x12, 0x1a, 0x0a, 0x03, 0x74, 0x69, 0x70, 0x18, 0x05, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x08, - 0x2e, 0x46, 0x65, 0x6c, 0x74, 0x32, 0x35, 0x32, 0x52, 0x03, 0x74, 0x69, 0x70, 0x12, 0x2f, 0x0a, - 0x0e, 0x70, 0x61, 0x79, 0x6d, 0x61, 0x73, 0x74, 0x65, 0x72, 0x5f, 0x64, 0x61, 0x74, 0x61, 0x18, - 0x06, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x08, 0x2e, 0x41, 0x64, 0x64, 0x72, 0x65, 0x73, 0x73, 0x52, - 0x0d, 0x70, 0x61, 0x79, 0x6d, 0x61, 0x73, 0x74, 0x65, 0x72, 0x44, 0x61, 0x74, 0x61, 0x12, 0x40, - 0x0a, 0x17, 0x61, 0x63, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x5f, 0x64, 0x65, 0x70, 0x6c, 0x6f, 0x79, - 0x6d, 0x65, 0x6e, 0x74, 0x5f, 0x64, 0x61, 0x74, 0x61, 0x18, 0x07, 0x20, 0x01, 0x28, 0x0b, 0x32, - 0x08, 0x2e, 0x41, 0x64, 0x64, 0x72, 0x65, 0x73, 0x73, 0x52, 0x15, 0x61, 0x63, 0x63, 0x6f, 0x75, - 0x6e, 0x74, 0x44, 0x65, 0x70, 0x6c, 0x6f, 0x79, 0x6d, 0x65, 0x6e, 0x74, 0x44, 0x61, 0x74, 0x61, - 0x12, 0x21, 0x0a, 0x0c, 0x6e, 0x6f, 0x6e, 0x63, 0x65, 0x5f, 0x64, 0x6f, 0x6d, 0x61, 0x69, 0x6e, - 0x18, 0x08, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0b, 0x6e, 0x6f, 0x6e, 0x63, 0x65, 0x44, 0x6f, 0x6d, - 0x61, 0x69, 0x6e, 0x12, 0x1d, 0x0a, 0x0a, 0x66, 0x65, 0x65, 0x5f, 0x64, 0x6f, 0x6d, 0x61, 0x69, - 0x6e, 0x18, 0x09, 0x20, 0x01, 0x28, 0x09, 0x52, 0x09, 0x66, 0x65, 0x65, 0x44, 0x6f, 0x6d, 0x61, - 0x69, 0x6e, 0x12, 0x1e, 0x0a, 0x05, 0x6e, 0x6f, 0x6e, 0x63, 0x65, 0x18, 0x0a, 0x20, 0x01, 0x28, - 0x0b, 0x32, 0x08, 0x2e, 0x46, 0x65, 0x6c, 0x74, 0x32, 0x35, 0x32, 0x52, 0x05, 0x6e, 0x6f, 0x6e, - 0x63, 0x65, 0x1a, 0xb3, 0x01, 0x0a, 0x0b, 0x4c, 0x31, 0x48, 0x61, 0x6e, 0x64, 0x6c, 0x65, 0x72, - 0x56, 0x30, 0x12, 0x1e, 0x0a, 0x05, 0x6e, 0x6f, 0x6e, 0x63, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, - 0x0b, 0x32, 0x08, 0x2e, 0x46, 0x65, 0x6c, 0x74, 0x32, 0x35, 0x32, 0x52, 0x05, 0x6e, 0x6f, 0x6e, - 0x63, 0x65, 0x12, 0x22, 0x0a, 0x07, 0x61, 0x64, 0x64, 0x72, 0x65, 0x73, 0x73, 0x18, 0x02, 0x20, - 0x01, 0x28, 0x0b, 0x32, 0x08, 0x2e, 0x41, 0x64, 0x64, 0x72, 0x65, 0x73, 0x73, 0x52, 0x07, 0x61, - 0x64, 0x64, 0x72, 0x65, 0x73, 0x73, 0x12, 0x3a, 0x0a, 0x14, 0x65, 0x6e, 0x74, 0x72, 0x79, 0x5f, - 0x70, 0x6f, 0x69, 0x6e, 0x74, 0x5f, 0x73, 0x65, 0x6c, 0x65, 0x63, 0x74, 0x6f, 0x72, 0x18, 0x03, - 0x20, 0x01, 0x28, 0x0b, 0x32, 0x08, 0x2e, 0x46, 0x65, 0x6c, 0x74, 0x32, 0x35, 0x32, 0x52, 0x12, - 0x65, 0x6e, 0x74, 0x72, 0x79, 0x50, 0x6f, 0x69, 0x6e, 0x74, 0x53, 0x65, 0x6c, 0x65, 0x63, 0x74, - 0x6f, 0x72, 0x12, 0x24, 0x0a, 0x08, 0x63, 0x61, 0x6c, 0x6c, 0x64, 0x61, 0x74, 0x61, 0x18, 0x04, - 0x20, 0x03, 0x28, 0x0b, 0x32, 0x08, 0x2e, 0x46, 0x65, 0x6c, 0x74, 0x32, 0x35, 0x32, 0x52, 0x08, - 0x63, 0x61, 0x6c, 0x6c, 0x64, 0x61, 0x74, 0x61, 0x42, 0x05, 0x0a, 0x03, 0x74, 0x78, 0x6e, 0x22, - 0x3f, 0x0a, 0x13, 0x54, 0x72, 0x61, 0x6e, 0x73, 0x61, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x52, - 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x28, 0x0a, 0x09, 0x69, 0x74, 0x65, 0x72, 0x61, 0x74, - 0x69, 0x6f, 0x6e, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x0a, 0x2e, 0x49, 0x74, 0x65, 0x72, - 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x52, 0x09, 0x69, 0x74, 0x65, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, - 0x22, 0x79, 0x0a, 0x14, 0x54, 0x72, 0x61, 0x6e, 0x73, 0x61, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x73, - 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x30, 0x0a, 0x0b, 0x74, 0x72, 0x61, 0x6e, - 0x73, 0x61, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x0c, 0x2e, - 0x54, 0x72, 0x61, 0x6e, 0x73, 0x61, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x48, 0x00, 0x52, 0x0b, 0x74, - 0x72, 0x61, 0x6e, 0x73, 0x61, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x12, 0x18, 0x0a, 0x03, 0x66, 0x69, - 0x6e, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x04, 0x2e, 0x46, 0x69, 0x6e, 0x48, 0x00, 0x52, - 0x03, 0x66, 0x69, 0x6e, 0x42, 0x15, 0x0a, 0x13, 0x74, 0x72, 0x61, 0x6e, 0x73, 0x61, 0x63, 0x74, - 0x69, 0x6f, 0x6e, 0x5f, 0x6d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x42, 0x31, 0x5a, 0x2f, 0x67, - 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x4e, 0x65, 0x74, 0x68, 0x65, 0x72, - 0x6d, 0x69, 0x6e, 0x64, 0x45, 0x74, 0x68, 0x2f, 0x6a, 0x75, 0x6e, 0x6f, 0x2f, 0x70, 0x32, 0x70, - 0x2f, 0x73, 0x74, 0x61, 0x72, 0x6b, 0x6e, 0x65, 0x74, 0x2f, 0x73, 0x70, 0x65, 0x63, 0x62, 0x06, - 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, + 0x12, 0x21, 0x0a, 0x07, 0x6d, 0x61, 0x78, 0x5f, 0x66, 0x65, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, + 0x0b, 0x32, 0x08, 0x2e, 0x46, 0x65, 0x6c, 0x74, 0x32, 0x35, 0x32, 0x52, 0x06, 0x6d, 0x61, 0x78, + 0x46, 0x65, 0x65, 0x12, 0x2f, 0x0a, 0x09, 0x73, 0x69, 0x67, 0x6e, 0x61, 0x74, 0x75, 0x72, 0x65, + 0x18, 0x03, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x11, 0x2e, 0x41, 0x63, 0x63, 0x6f, 0x75, 0x6e, 0x74, + 0x53, 0x69, 0x67, 0x6e, 0x61, 0x74, 0x75, 0x72, 0x65, 0x52, 0x09, 0x73, 0x69, 0x67, 0x6e, 0x61, + 0x74, 0x75, 0x72, 0x65, 0x12, 0x24, 0x0a, 0x08, 0x63, 0x61, 0x6c, 0x6c, 0x64, 0x61, 0x74, 0x61, + 0x18, 0x04, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x08, 0x2e, 0x46, 0x65, 0x6c, 0x74, 0x32, 0x35, 0x32, + 0x52, 0x08, 0x63, 0x61, 0x6c, 0x6c, 0x64, 0x61, 0x74, 0x61, 0x12, 0x1e, 0x0a, 0x05, 0x6e, 0x6f, + 0x6e, 0x63, 0x65, 0x18, 0x05, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x08, 0x2e, 0x46, 0x65, 0x6c, 0x74, + 0x32, 0x35, 0x32, 0x52, 0x05, 0x6e, 0x6f, 0x6e, 0x63, 0x65, 0x1a, 0x82, 0x04, 0x0a, 0x08, 0x49, + 0x6e, 0x76, 0x6f, 0x6b, 0x65, 0x56, 0x33, 0x12, 0x20, 0x0a, 0x06, 0x73, 0x65, 0x6e, 0x64, 0x65, + 0x72, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x08, 0x2e, 0x41, 0x64, 0x64, 0x72, 0x65, 0x73, + 0x73, 0x52, 0x06, 0x73, 0x65, 0x6e, 0x64, 0x65, 0x72, 0x12, 0x2f, 0x0a, 0x09, 0x73, 0x69, 0x67, + 0x6e, 0x61, 0x74, 0x75, 0x72, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x11, 0x2e, 0x41, + 0x63, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x53, 0x69, 0x67, 0x6e, 0x61, 0x74, 0x75, 0x72, 0x65, 0x52, + 0x09, 0x73, 0x69, 0x67, 0x6e, 0x61, 0x74, 0x75, 0x72, 0x65, 0x12, 0x24, 0x0a, 0x08, 0x63, 0x61, + 0x6c, 0x6c, 0x64, 0x61, 0x74, 0x61, 0x18, 0x03, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x08, 0x2e, 0x46, + 0x65, 0x6c, 0x74, 0x32, 0x35, 0x32, 0x52, 0x08, 0x63, 0x61, 0x6c, 0x6c, 0x64, 0x61, 0x74, 0x61, + 0x12, 0x38, 0x0a, 0x0f, 0x72, 0x65, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x5f, 0x62, 0x6f, 0x75, + 0x6e, 0x64, 0x73, 0x18, 0x04, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x0f, 0x2e, 0x52, 0x65, 0x73, 0x6f, + 0x75, 0x72, 0x63, 0x65, 0x42, 0x6f, 0x75, 0x6e, 0x64, 0x73, 0x52, 0x0e, 0x72, 0x65, 0x73, 0x6f, + 0x75, 0x72, 0x63, 0x65, 0x42, 0x6f, 0x75, 0x6e, 0x64, 0x73, 0x12, 0x10, 0x0a, 0x03, 0x74, 0x69, + 0x70, 0x18, 0x05, 0x20, 0x01, 0x28, 0x04, 0x52, 0x03, 0x74, 0x69, 0x70, 0x12, 0x2f, 0x0a, 0x0e, + 0x70, 0x61, 0x79, 0x6d, 0x61, 0x73, 0x74, 0x65, 0x72, 0x5f, 0x64, 0x61, 0x74, 0x61, 0x18, 0x06, + 0x20, 0x03, 0x28, 0x0b, 0x32, 0x08, 0x2e, 0x46, 0x65, 0x6c, 0x74, 0x32, 0x35, 0x32, 0x52, 0x0d, + 0x70, 0x61, 0x79, 0x6d, 0x61, 0x73, 0x74, 0x65, 0x72, 0x44, 0x61, 0x74, 0x61, 0x12, 0x40, 0x0a, + 0x17, 0x61, 0x63, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x5f, 0x64, 0x65, 0x70, 0x6c, 0x6f, 0x79, 0x6d, + 0x65, 0x6e, 0x74, 0x5f, 0x64, 0x61, 0x74, 0x61, 0x18, 0x07, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x08, + 0x2e, 0x46, 0x65, 0x6c, 0x74, 0x32, 0x35, 0x32, 0x52, 0x15, 0x61, 0x63, 0x63, 0x6f, 0x75, 0x6e, + 0x74, 0x44, 0x65, 0x70, 0x6c, 0x6f, 0x79, 0x6d, 0x65, 0x6e, 0x74, 0x44, 0x61, 0x74, 0x61, 0x12, + 0x50, 0x0a, 0x1c, 0x6e, 0x6f, 0x6e, 0x63, 0x65, 0x5f, 0x64, 0x61, 0x74, 0x61, 0x5f, 0x61, 0x76, + 0x61, 0x69, 0x6c, 0x61, 0x62, 0x69, 0x6c, 0x69, 0x74, 0x79, 0x5f, 0x6d, 0x6f, 0x64, 0x65, 0x18, + 0x08, 0x20, 0x01, 0x28, 0x0e, 0x32, 0x0f, 0x2e, 0x56, 0x6f, 0x6c, 0x69, 0x74, 0x69, 0x6f, 0x6e, + 0x44, 0x6f, 0x6d, 0x61, 0x69, 0x6e, 0x52, 0x19, 0x6e, 0x6f, 0x6e, 0x63, 0x65, 0x44, 0x61, 0x74, + 0x61, 0x41, 0x76, 0x61, 0x69, 0x6c, 0x61, 0x62, 0x69, 0x6c, 0x69, 0x74, 0x79, 0x4d, 0x6f, 0x64, + 0x65, 0x12, 0x4c, 0x0a, 0x1a, 0x66, 0x65, 0x65, 0x5f, 0x64, 0x61, 0x74, 0x61, 0x5f, 0x61, 0x76, + 0x61, 0x69, 0x6c, 0x61, 0x62, 0x69, 0x6c, 0x69, 0x74, 0x79, 0x5f, 0x6d, 0x6f, 0x64, 0x65, 0x18, + 0x09, 0x20, 0x01, 0x28, 0x0e, 0x32, 0x0f, 0x2e, 0x56, 0x6f, 0x6c, 0x69, 0x74, 0x69, 0x6f, 0x6e, + 0x44, 0x6f, 0x6d, 0x61, 0x69, 0x6e, 0x52, 0x17, 0x66, 0x65, 0x65, 0x44, 0x61, 0x74, 0x61, 0x41, + 0x76, 0x61, 0x69, 0x6c, 0x61, 0x62, 0x69, 0x6c, 0x69, 0x74, 0x79, 0x4d, 0x6f, 0x64, 0x65, 0x12, + 0x1e, 0x0a, 0x05, 0x6e, 0x6f, 0x6e, 0x63, 0x65, 0x18, 0x0a, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x08, + 0x2e, 0x46, 0x65, 0x6c, 0x74, 0x32, 0x35, 0x32, 0x52, 0x05, 0x6e, 0x6f, 0x6e, 0x63, 0x65, 0x1a, + 0xb3, 0x01, 0x0a, 0x0b, 0x4c, 0x31, 0x48, 0x61, 0x6e, 0x64, 0x6c, 0x65, 0x72, 0x56, 0x30, 0x12, + 0x1e, 0x0a, 0x05, 0x6e, 0x6f, 0x6e, 0x63, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x08, + 0x2e, 0x46, 0x65, 0x6c, 0x74, 0x32, 0x35, 0x32, 0x52, 0x05, 0x6e, 0x6f, 0x6e, 0x63, 0x65, 0x12, + 0x22, 0x0a, 0x07, 0x61, 0x64, 0x64, 0x72, 0x65, 0x73, 0x73, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, + 0x32, 0x08, 0x2e, 0x41, 0x64, 0x64, 0x72, 0x65, 0x73, 0x73, 0x52, 0x07, 0x61, 0x64, 0x64, 0x72, + 0x65, 0x73, 0x73, 0x12, 0x3a, 0x0a, 0x14, 0x65, 0x6e, 0x74, 0x72, 0x79, 0x5f, 0x70, 0x6f, 0x69, + 0x6e, 0x74, 0x5f, 0x73, 0x65, 0x6c, 0x65, 0x63, 0x74, 0x6f, 0x72, 0x18, 0x03, 0x20, 0x01, 0x28, + 0x0b, 0x32, 0x08, 0x2e, 0x46, 0x65, 0x6c, 0x74, 0x32, 0x35, 0x32, 0x52, 0x12, 0x65, 0x6e, 0x74, + 0x72, 0x79, 0x50, 0x6f, 0x69, 0x6e, 0x74, 0x53, 0x65, 0x6c, 0x65, 0x63, 0x74, 0x6f, 0x72, 0x12, + 0x24, 0x0a, 0x08, 0x63, 0x61, 0x6c, 0x6c, 0x64, 0x61, 0x74, 0x61, 0x18, 0x04, 0x20, 0x03, 0x28, + 0x0b, 0x32, 0x08, 0x2e, 0x46, 0x65, 0x6c, 0x74, 0x32, 0x35, 0x32, 0x52, 0x08, 0x63, 0x61, 0x6c, + 0x6c, 0x64, 0x61, 0x74, 0x61, 0x42, 0x05, 0x0a, 0x03, 0x74, 0x78, 0x6e, 0x22, 0x6c, 0x0a, 0x16, + 0x54, 0x72, 0x61, 0x6e, 0x73, 0x61, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x57, 0x69, 0x74, 0x68, 0x52, + 0x65, 0x63, 0x65, 0x69, 0x70, 0x74, 0x12, 0x2e, 0x0a, 0x0b, 0x74, 0x72, 0x61, 0x6e, 0x73, 0x61, + 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x0c, 0x2e, 0x54, 0x72, + 0x61, 0x6e, 0x73, 0x61, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x52, 0x0b, 0x74, 0x72, 0x61, 0x6e, 0x73, + 0x61, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x12, 0x22, 0x0a, 0x07, 0x72, 0x65, 0x63, 0x65, 0x69, 0x70, + 0x74, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x08, 0x2e, 0x52, 0x65, 0x63, 0x65, 0x69, 0x70, + 0x74, 0x52, 0x07, 0x72, 0x65, 0x63, 0x65, 0x69, 0x70, 0x74, 0x22, 0x3f, 0x0a, 0x13, 0x54, 0x72, + 0x61, 0x6e, 0x73, 0x61, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, + 0x74, 0x12, 0x28, 0x0a, 0x09, 0x69, 0x74, 0x65, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x18, 0x01, + 0x20, 0x01, 0x28, 0x0b, 0x32, 0x0a, 0x2e, 0x49, 0x74, 0x65, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, + 0x52, 0x09, 0x69, 0x74, 0x65, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x22, 0x9c, 0x01, 0x0a, 0x14, + 0x54, 0x72, 0x61, 0x6e, 0x73, 0x61, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x52, 0x65, 0x73, 0x70, + 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x53, 0x0a, 0x18, 0x74, 0x72, 0x61, 0x6e, 0x73, 0x61, 0x63, 0x74, + 0x69, 0x6f, 0x6e, 0x5f, 0x77, 0x69, 0x74, 0x68, 0x5f, 0x72, 0x65, 0x63, 0x65, 0x69, 0x70, 0x74, + 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x17, 0x2e, 0x54, 0x72, 0x61, 0x6e, 0x73, 0x61, 0x63, + 0x74, 0x69, 0x6f, 0x6e, 0x57, 0x69, 0x74, 0x68, 0x52, 0x65, 0x63, 0x65, 0x69, 0x70, 0x74, 0x48, + 0x00, 0x52, 0x16, 0x74, 0x72, 0x61, 0x6e, 0x73, 0x61, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x57, 0x69, + 0x74, 0x68, 0x52, 0x65, 0x63, 0x65, 0x69, 0x70, 0x74, 0x12, 0x18, 0x0a, 0x03, 0x66, 0x69, 0x6e, + 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x04, 0x2e, 0x46, 0x69, 0x6e, 0x48, 0x00, 0x52, 0x03, + 0x66, 0x69, 0x6e, 0x42, 0x15, 0x0a, 0x13, 0x74, 0x72, 0x61, 0x6e, 0x73, 0x61, 0x63, 0x74, 0x69, + 0x6f, 0x6e, 0x5f, 0x6d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x22, 0x40, 0x0a, 0x0c, 0x54, 0x72, + 0x61, 0x6e, 0x73, 0x61, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x12, 0x30, 0x0a, 0x0c, 0x74, 0x72, + 0x61, 0x6e, 0x73, 0x61, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x18, 0x01, 0x20, 0x03, 0x28, 0x0b, + 0x32, 0x0c, 0x2e, 0x54, 0x72, 0x61, 0x6e, 0x73, 0x61, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x52, 0x0c, + 0x74, 0x72, 0x61, 0x6e, 0x73, 0x61, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x42, 0x31, 0x5a, 0x2f, + 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x4e, 0x65, 0x74, 0x68, 0x65, + 0x72, 0x6d, 0x69, 0x6e, 0x64, 0x45, 0x74, 0x68, 0x2f, 0x6a, 0x75, 0x6e, 0x6f, 0x2f, 0x70, 0x32, + 0x70, 0x2f, 0x73, 0x74, 0x61, 0x72, 0x6b, 0x6e, 0x65, 0x74, 0x2f, 0x73, 0x70, 0x65, 0x63, 0x62, + 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, } var ( @@ -1803,121 +1927,130 @@ func file_p2p_proto_transaction_proto_rawDescGZIP() []byte { } var ( - file_p2p_proto_transaction_proto_msgTypes = make([]protoimpl.MessageInfo, 17) + file_p2p_proto_transaction_proto_msgTypes = make([]protoimpl.MessageInfo, 19) file_p2p_proto_transaction_proto_goTypes = []interface{}{ (*ResourceLimits)(nil), // 0: ResourceLimits (*ResourceBounds)(nil), // 1: ResourceBounds (*AccountSignature)(nil), // 2: AccountSignature (*Transaction)(nil), // 3: Transaction - (*TransactionsRequest)(nil), // 4: TransactionsRequest - (*TransactionsResponse)(nil), // 5: TransactionsResponse - (*Transaction_DeclareV0)(nil), // 6: Transaction.DeclareV0 - (*Transaction_DeclareV1)(nil), // 7: Transaction.DeclareV1 - (*Transaction_DeclareV2)(nil), // 8: Transaction.DeclareV2 - (*Transaction_DeclareV3)(nil), // 9: Transaction.DeclareV3 - (*Transaction_Deploy)(nil), // 10: Transaction.Deploy - (*Transaction_DeployAccountV1)(nil), // 11: Transaction.DeployAccountV1 - (*Transaction_DeployAccountV3)(nil), // 12: Transaction.DeployAccountV3 - (*Transaction_InvokeV0)(nil), // 13: Transaction.InvokeV0 - (*Transaction_InvokeV1)(nil), // 14: Transaction.InvokeV1 - (*Transaction_InvokeV3)(nil), // 15: Transaction.InvokeV3 - (*Transaction_L1HandlerV0)(nil), // 16: Transaction.L1HandlerV0 - (*Felt252)(nil), // 17: Felt252 - (*Hash)(nil), // 18: Hash - (*Iteration)(nil), // 19: Iteration - (*Fin)(nil), // 20: Fin - (*Address)(nil), // 21: Address + (*TransactionWithReceipt)(nil), // 4: TransactionWithReceipt + (*TransactionsRequest)(nil), // 5: TransactionsRequest + (*TransactionsResponse)(nil), // 6: TransactionsResponse + (*Transactions)(nil), // 7: Transactions + (*Transaction_DeclareV0)(nil), // 8: Transaction.DeclareV0 + (*Transaction_DeclareV1)(nil), // 9: Transaction.DeclareV1 + (*Transaction_DeclareV2)(nil), // 10: Transaction.DeclareV2 + (*Transaction_DeclareV3)(nil), // 11: Transaction.DeclareV3 + (*Transaction_Deploy)(nil), // 12: Transaction.Deploy + (*Transaction_DeployAccountV1)(nil), // 13: Transaction.DeployAccountV1 + (*Transaction_DeployAccountV3)(nil), // 14: Transaction.DeployAccountV3 + (*Transaction_InvokeV0)(nil), // 15: Transaction.InvokeV0 + (*Transaction_InvokeV1)(nil), // 16: Transaction.InvokeV1 + (*Transaction_InvokeV3)(nil), // 17: Transaction.InvokeV3 + (*Transaction_L1HandlerV0)(nil), // 18: Transaction.L1HandlerV0 + (*Felt252)(nil), // 19: Felt252 + (*Receipt)(nil), // 20: Receipt + (*Iteration)(nil), // 21: Iteration + (*Fin)(nil), // 22: Fin + (*Address)(nil), // 23: Address + (*Hash)(nil), // 24: Hash + (VolitionDomain)(0), // 25: VolitionDomain } ) var file_p2p_proto_transaction_proto_depIdxs = []int32{ - 17, // 0: ResourceLimits.max_amount:type_name -> Felt252 - 17, // 1: ResourceLimits.max_price_per_unit:type_name -> Felt252 + 19, // 0: ResourceLimits.max_amount:type_name -> Felt252 + 19, // 1: ResourceLimits.max_price_per_unit:type_name -> Felt252 0, // 2: ResourceBounds.l1_gas:type_name -> ResourceLimits 0, // 3: ResourceBounds.l2_gas:type_name -> ResourceLimits - 17, // 4: AccountSignature.parts:type_name -> Felt252 - 6, // 5: Transaction.declare_v0:type_name -> Transaction.DeclareV0 - 7, // 6: Transaction.declare_v1:type_name -> Transaction.DeclareV1 - 8, // 7: Transaction.declare_v2:type_name -> Transaction.DeclareV2 - 9, // 8: Transaction.declare_v3:type_name -> Transaction.DeclareV3 - 10, // 9: Transaction.deploy:type_name -> Transaction.Deploy - 11, // 10: Transaction.deploy_account_v1:type_name -> Transaction.DeployAccountV1 - 12, // 11: Transaction.deploy_account_v3:type_name -> Transaction.DeployAccountV3 - 13, // 12: Transaction.invoke_v0:type_name -> Transaction.InvokeV0 - 14, // 13: Transaction.invoke_v1:type_name -> Transaction.InvokeV1 - 15, // 14: Transaction.invoke_v3:type_name -> Transaction.InvokeV3 - 16, // 15: Transaction.l1_handler:type_name -> Transaction.L1HandlerV0 - 18, // 16: Transaction.transaction_hash:type_name -> Hash - 19, // 17: TransactionsRequest.iteration:type_name -> Iteration - 3, // 18: TransactionsResponse.transaction:type_name -> Transaction - 20, // 19: TransactionsResponse.fin:type_name -> Fin - 21, // 20: Transaction.DeclareV0.sender:type_name -> Address - 17, // 21: Transaction.DeclareV0.max_fee:type_name -> Felt252 - 2, // 22: Transaction.DeclareV0.signature:type_name -> AccountSignature - 18, // 23: Transaction.DeclareV0.class_hash:type_name -> Hash - 21, // 24: Transaction.DeclareV1.sender:type_name -> Address - 17, // 25: Transaction.DeclareV1.max_fee:type_name -> Felt252 - 2, // 26: Transaction.DeclareV1.signature:type_name -> AccountSignature - 18, // 27: Transaction.DeclareV1.class_hash:type_name -> Hash - 17, // 28: Transaction.DeclareV1.nonce:type_name -> Felt252 - 21, // 29: Transaction.DeclareV2.sender:type_name -> Address - 17, // 30: Transaction.DeclareV2.max_fee:type_name -> Felt252 - 2, // 31: Transaction.DeclareV2.signature:type_name -> AccountSignature - 18, // 32: Transaction.DeclareV2.class_hash:type_name -> Hash - 17, // 33: Transaction.DeclareV2.nonce:type_name -> Felt252 - 17, // 34: Transaction.DeclareV2.compiled_class_hash:type_name -> Felt252 - 21, // 35: Transaction.DeclareV3.sender:type_name -> Address - 2, // 36: Transaction.DeclareV3.signature:type_name -> AccountSignature - 18, // 37: Transaction.DeclareV3.class_hash:type_name -> Hash - 17, // 38: Transaction.DeclareV3.nonce:type_name -> Felt252 - 17, // 39: Transaction.DeclareV3.compiled_class_hash:type_name -> Felt252 - 1, // 40: Transaction.DeclareV3.resource_bounds:type_name -> ResourceBounds - 17, // 41: Transaction.DeclareV3.tip:type_name -> Felt252 - 21, // 42: Transaction.DeclareV3.paymaster_data:type_name -> Address - 21, // 43: Transaction.DeclareV3.account_deployment_data:type_name -> Address - 18, // 44: Transaction.Deploy.class_hash:type_name -> Hash - 17, // 45: Transaction.Deploy.address_salt:type_name -> Felt252 - 17, // 46: Transaction.Deploy.calldata:type_name -> Felt252 - 17, // 47: Transaction.DeployAccountV1.max_fee:type_name -> Felt252 - 2, // 48: Transaction.DeployAccountV1.signature:type_name -> AccountSignature - 18, // 49: Transaction.DeployAccountV1.class_hash:type_name -> Hash - 17, // 50: Transaction.DeployAccountV1.nonce:type_name -> Felt252 - 17, // 51: Transaction.DeployAccountV1.address_salt:type_name -> Felt252 - 17, // 52: Transaction.DeployAccountV1.calldata:type_name -> Felt252 - 2, // 53: Transaction.DeployAccountV3.signature:type_name -> AccountSignature - 18, // 54: Transaction.DeployAccountV3.class_hash:type_name -> Hash - 17, // 55: Transaction.DeployAccountV3.nonce:type_name -> Felt252 - 17, // 56: Transaction.DeployAccountV3.address_salt:type_name -> Felt252 - 17, // 57: Transaction.DeployAccountV3.calldata:type_name -> Felt252 - 1, // 58: Transaction.DeployAccountV3.resource_bounds:type_name -> ResourceBounds - 17, // 59: Transaction.DeployAccountV3.tip:type_name -> Felt252 - 21, // 60: Transaction.DeployAccountV3.paymaster_data:type_name -> Address - 17, // 61: Transaction.InvokeV0.max_fee:type_name -> Felt252 - 2, // 62: Transaction.InvokeV0.signature:type_name -> AccountSignature - 21, // 63: Transaction.InvokeV0.address:type_name -> Address - 17, // 64: Transaction.InvokeV0.entry_point_selector:type_name -> Felt252 - 17, // 65: Transaction.InvokeV0.calldata:type_name -> Felt252 - 21, // 66: Transaction.InvokeV1.sender:type_name -> Address - 17, // 67: Transaction.InvokeV1.max_fee:type_name -> Felt252 - 2, // 68: Transaction.InvokeV1.signature:type_name -> AccountSignature - 17, // 69: Transaction.InvokeV1.calldata:type_name -> Felt252 - 17, // 70: Transaction.InvokeV1.nonce:type_name -> Felt252 - 21, // 71: Transaction.InvokeV3.sender:type_name -> Address - 2, // 72: Transaction.InvokeV3.signature:type_name -> AccountSignature - 17, // 73: Transaction.InvokeV3.calldata:type_name -> Felt252 - 1, // 74: Transaction.InvokeV3.resource_bounds:type_name -> ResourceBounds - 17, // 75: Transaction.InvokeV3.tip:type_name -> Felt252 - 21, // 76: Transaction.InvokeV3.paymaster_data:type_name -> Address - 21, // 77: Transaction.InvokeV3.account_deployment_data:type_name -> Address - 17, // 78: Transaction.InvokeV3.nonce:type_name -> Felt252 - 17, // 79: Transaction.L1HandlerV0.nonce:type_name -> Felt252 - 21, // 80: Transaction.L1HandlerV0.address:type_name -> Address - 17, // 81: Transaction.L1HandlerV0.entry_point_selector:type_name -> Felt252 - 17, // 82: Transaction.L1HandlerV0.calldata:type_name -> Felt252 - 83, // [83:83] is the sub-list for method output_type - 83, // [83:83] is the sub-list for method input_type - 83, // [83:83] is the sub-list for extension type_name - 83, // [83:83] is the sub-list for extension extendee - 0, // [0:83] is the sub-list for field type_name + 19, // 4: AccountSignature.parts:type_name -> Felt252 + 8, // 5: Transaction.declare_v0:type_name -> Transaction.DeclareV0 + 9, // 6: Transaction.declare_v1:type_name -> Transaction.DeclareV1 + 10, // 7: Transaction.declare_v2:type_name -> Transaction.DeclareV2 + 11, // 8: Transaction.declare_v3:type_name -> Transaction.DeclareV3 + 12, // 9: Transaction.deploy:type_name -> Transaction.Deploy + 13, // 10: Transaction.deploy_account_v1:type_name -> Transaction.DeployAccountV1 + 14, // 11: Transaction.deploy_account_v3:type_name -> Transaction.DeployAccountV3 + 15, // 12: Transaction.invoke_v0:type_name -> Transaction.InvokeV0 + 16, // 13: Transaction.invoke_v1:type_name -> Transaction.InvokeV1 + 17, // 14: Transaction.invoke_v3:type_name -> Transaction.InvokeV3 + 18, // 15: Transaction.l1_handler:type_name -> Transaction.L1HandlerV0 + 3, // 16: TransactionWithReceipt.transaction:type_name -> Transaction + 20, // 17: TransactionWithReceipt.receipt:type_name -> Receipt + 21, // 18: TransactionsRequest.iteration:type_name -> Iteration + 4, // 19: TransactionsResponse.transaction_with_receipt:type_name -> TransactionWithReceipt + 22, // 20: TransactionsResponse.fin:type_name -> Fin + 3, // 21: Transactions.transactions:type_name -> Transaction + 23, // 22: Transaction.DeclareV0.sender:type_name -> Address + 19, // 23: Transaction.DeclareV0.max_fee:type_name -> Felt252 + 2, // 24: Transaction.DeclareV0.signature:type_name -> AccountSignature + 24, // 25: Transaction.DeclareV0.class_hash:type_name -> Hash + 23, // 26: Transaction.DeclareV1.sender:type_name -> Address + 19, // 27: Transaction.DeclareV1.max_fee:type_name -> Felt252 + 2, // 28: Transaction.DeclareV1.signature:type_name -> AccountSignature + 24, // 29: Transaction.DeclareV1.class_hash:type_name -> Hash + 19, // 30: Transaction.DeclareV1.nonce:type_name -> Felt252 + 23, // 31: Transaction.DeclareV2.sender:type_name -> Address + 19, // 32: Transaction.DeclareV2.max_fee:type_name -> Felt252 + 2, // 33: Transaction.DeclareV2.signature:type_name -> AccountSignature + 24, // 34: Transaction.DeclareV2.class_hash:type_name -> Hash + 19, // 35: Transaction.DeclareV2.nonce:type_name -> Felt252 + 24, // 36: Transaction.DeclareV2.compiled_class_hash:type_name -> Hash + 23, // 37: Transaction.DeclareV3.sender:type_name -> Address + 2, // 38: Transaction.DeclareV3.signature:type_name -> AccountSignature + 24, // 39: Transaction.DeclareV3.class_hash:type_name -> Hash + 19, // 40: Transaction.DeclareV3.nonce:type_name -> Felt252 + 24, // 41: Transaction.DeclareV3.compiled_class_hash:type_name -> Hash + 1, // 42: Transaction.DeclareV3.resource_bounds:type_name -> ResourceBounds + 19, // 43: Transaction.DeclareV3.paymaster_data:type_name -> Felt252 + 19, // 44: Transaction.DeclareV3.account_deployment_data:type_name -> Felt252 + 25, // 45: Transaction.DeclareV3.nonce_data_availability_mode:type_name -> VolitionDomain + 25, // 46: Transaction.DeclareV3.fee_data_availability_mode:type_name -> VolitionDomain + 24, // 47: Transaction.Deploy.class_hash:type_name -> Hash + 19, // 48: Transaction.Deploy.address_salt:type_name -> Felt252 + 19, // 49: Transaction.Deploy.calldata:type_name -> Felt252 + 19, // 50: Transaction.DeployAccountV1.max_fee:type_name -> Felt252 + 2, // 51: Transaction.DeployAccountV1.signature:type_name -> AccountSignature + 24, // 52: Transaction.DeployAccountV1.class_hash:type_name -> Hash + 19, // 53: Transaction.DeployAccountV1.nonce:type_name -> Felt252 + 19, // 54: Transaction.DeployAccountV1.address_salt:type_name -> Felt252 + 19, // 55: Transaction.DeployAccountV1.calldata:type_name -> Felt252 + 2, // 56: Transaction.DeployAccountV3.signature:type_name -> AccountSignature + 24, // 57: Transaction.DeployAccountV3.class_hash:type_name -> Hash + 19, // 58: Transaction.DeployAccountV3.nonce:type_name -> Felt252 + 19, // 59: Transaction.DeployAccountV3.address_salt:type_name -> Felt252 + 19, // 60: Transaction.DeployAccountV3.calldata:type_name -> Felt252 + 1, // 61: Transaction.DeployAccountV3.resource_bounds:type_name -> ResourceBounds + 19, // 62: Transaction.DeployAccountV3.paymaster_data:type_name -> Felt252 + 25, // 63: Transaction.DeployAccountV3.nonce_data_availability_mode:type_name -> VolitionDomain + 25, // 64: Transaction.DeployAccountV3.fee_data_availability_mode:type_name -> VolitionDomain + 19, // 65: Transaction.InvokeV0.max_fee:type_name -> Felt252 + 2, // 66: Transaction.InvokeV0.signature:type_name -> AccountSignature + 23, // 67: Transaction.InvokeV0.address:type_name -> Address + 19, // 68: Transaction.InvokeV0.entry_point_selector:type_name -> Felt252 + 19, // 69: Transaction.InvokeV0.calldata:type_name -> Felt252 + 23, // 70: Transaction.InvokeV1.sender:type_name -> Address + 19, // 71: Transaction.InvokeV1.max_fee:type_name -> Felt252 + 2, // 72: Transaction.InvokeV1.signature:type_name -> AccountSignature + 19, // 73: Transaction.InvokeV1.calldata:type_name -> Felt252 + 19, // 74: Transaction.InvokeV1.nonce:type_name -> Felt252 + 23, // 75: Transaction.InvokeV3.sender:type_name -> Address + 2, // 76: Transaction.InvokeV3.signature:type_name -> AccountSignature + 19, // 77: Transaction.InvokeV3.calldata:type_name -> Felt252 + 1, // 78: Transaction.InvokeV3.resource_bounds:type_name -> ResourceBounds + 19, // 79: Transaction.InvokeV3.paymaster_data:type_name -> Felt252 + 19, // 80: Transaction.InvokeV3.account_deployment_data:type_name -> Felt252 + 25, // 81: Transaction.InvokeV3.nonce_data_availability_mode:type_name -> VolitionDomain + 25, // 82: Transaction.InvokeV3.fee_data_availability_mode:type_name -> VolitionDomain + 19, // 83: Transaction.InvokeV3.nonce:type_name -> Felt252 + 19, // 84: Transaction.L1HandlerV0.nonce:type_name -> Felt252 + 23, // 85: Transaction.L1HandlerV0.address:type_name -> Address + 19, // 86: Transaction.L1HandlerV0.entry_point_selector:type_name -> Felt252 + 19, // 87: Transaction.L1HandlerV0.calldata:type_name -> Felt252 + 88, // [88:88] is the sub-list for method output_type + 88, // [88:88] is the sub-list for method input_type + 88, // [88:88] is the sub-list for extension type_name + 88, // [88:88] is the sub-list for extension extendee + 0, // [0:88] is the sub-list for field type_name } func init() { file_p2p_proto_transaction_proto_init() } @@ -1926,6 +2059,7 @@ func file_p2p_proto_transaction_proto_init() { return } file_p2p_proto_common_proto_init() + file_p2p_proto_receipt_proto_init() if !protoimpl.UnsafeEnabled { file_p2p_proto_transaction_proto_msgTypes[0].Exporter = func(v interface{}, i int) interface{} { switch v := v.(*ResourceLimits); i { @@ -1976,7 +2110,7 @@ func file_p2p_proto_transaction_proto_init() { } } file_p2p_proto_transaction_proto_msgTypes[4].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*TransactionsRequest); i { + switch v := v.(*TransactionWithReceipt); i { case 0: return &v.state case 1: @@ -1988,7 +2122,7 @@ func file_p2p_proto_transaction_proto_init() { } } file_p2p_proto_transaction_proto_msgTypes[5].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*TransactionsResponse); i { + switch v := v.(*TransactionsRequest); i { case 0: return &v.state case 1: @@ -2000,7 +2134,7 @@ func file_p2p_proto_transaction_proto_init() { } } file_p2p_proto_transaction_proto_msgTypes[6].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*Transaction_DeclareV0); i { + switch v := v.(*TransactionsResponse); i { case 0: return &v.state case 1: @@ -2012,7 +2146,7 @@ func file_p2p_proto_transaction_proto_init() { } } file_p2p_proto_transaction_proto_msgTypes[7].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*Transaction_DeclareV1); i { + switch v := v.(*Transactions); i { case 0: return &v.state case 1: @@ -2024,7 +2158,7 @@ func file_p2p_proto_transaction_proto_init() { } } file_p2p_proto_transaction_proto_msgTypes[8].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*Transaction_DeclareV2); i { + switch v := v.(*Transaction_DeclareV0); i { case 0: return &v.state case 1: @@ -2036,7 +2170,7 @@ func file_p2p_proto_transaction_proto_init() { } } file_p2p_proto_transaction_proto_msgTypes[9].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*Transaction_DeclareV3); i { + switch v := v.(*Transaction_DeclareV1); i { case 0: return &v.state case 1: @@ -2048,7 +2182,7 @@ func file_p2p_proto_transaction_proto_init() { } } file_p2p_proto_transaction_proto_msgTypes[10].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*Transaction_Deploy); i { + switch v := v.(*Transaction_DeclareV2); i { case 0: return &v.state case 1: @@ -2060,7 +2194,7 @@ func file_p2p_proto_transaction_proto_init() { } } file_p2p_proto_transaction_proto_msgTypes[11].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*Transaction_DeployAccountV1); i { + switch v := v.(*Transaction_DeclareV3); i { case 0: return &v.state case 1: @@ -2072,7 +2206,7 @@ func file_p2p_proto_transaction_proto_init() { } } file_p2p_proto_transaction_proto_msgTypes[12].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*Transaction_DeployAccountV3); i { + switch v := v.(*Transaction_Deploy); i { case 0: return &v.state case 1: @@ -2084,7 +2218,7 @@ func file_p2p_proto_transaction_proto_init() { } } file_p2p_proto_transaction_proto_msgTypes[13].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*Transaction_InvokeV0); i { + switch v := v.(*Transaction_DeployAccountV1); i { case 0: return &v.state case 1: @@ -2096,7 +2230,7 @@ func file_p2p_proto_transaction_proto_init() { } } file_p2p_proto_transaction_proto_msgTypes[14].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*Transaction_InvokeV1); i { + switch v := v.(*Transaction_DeployAccountV3); i { case 0: return &v.state case 1: @@ -2108,7 +2242,7 @@ func file_p2p_proto_transaction_proto_init() { } } file_p2p_proto_transaction_proto_msgTypes[15].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*Transaction_InvokeV3); i { + switch v := v.(*Transaction_InvokeV0); i { case 0: return &v.state case 1: @@ -2120,6 +2254,30 @@ func file_p2p_proto_transaction_proto_init() { } } file_p2p_proto_transaction_proto_msgTypes[16].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*Transaction_InvokeV1); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_p2p_proto_transaction_proto_msgTypes[17].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*Transaction_InvokeV3); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_p2p_proto_transaction_proto_msgTypes[18].Exporter = func(v interface{}, i int) interface{} { switch v := v.(*Transaction_L1HandlerV0); i { case 0: return &v.state @@ -2145,8 +2303,8 @@ func file_p2p_proto_transaction_proto_init() { (*Transaction_InvokeV3_)(nil), (*Transaction_L1Handler)(nil), } - file_p2p_proto_transaction_proto_msgTypes[5].OneofWrappers = []interface{}{ - (*TransactionsResponse_Transaction)(nil), + file_p2p_proto_transaction_proto_msgTypes[6].OneofWrappers = []interface{}{ + (*TransactionsResponse_TransactionWithReceipt)(nil), (*TransactionsResponse_Fin)(nil), } type x struct{} @@ -2155,7 +2313,7 @@ func file_p2p_proto_transaction_proto_init() { GoPackagePath: reflect.TypeOf(x{}).PkgPath(), RawDescriptor: file_p2p_proto_transaction_proto_rawDesc, NumEnums: 0, - NumMessages: 17, + NumMessages: 19, NumExtensions: 0, NumServices: 0, }, diff --git a/p2p/sync.go b/p2p/sync.go index 11a5ff392c..ddc6f76c36 100644 --- a/p2p/sync.go +++ b/p2p/sync.go @@ -87,26 +87,22 @@ func (s *syncService) start(ctx context.Context) { s.log.Debugw("Continuous iteration", "i", i) - iterCtx, cancel := context.WithCancel(ctx) - cancelIteration := func() { - // fmt.Println("Called by:") - // debug.PrintStack() - time.Sleep(time.Second * 4) - cancel() - } + iterCtx, cancelIteration := context.WithCancel(ctx) - var err error - randHeight, err = s.randomNodeHeight(iterCtx) - if err != nil { - cancelIteration() - if errors.Is(err, errNoPeers) { - s.log.Infow("No peers available", "retrying in", retryDuration.String()) - s.sleep(retryDuration) - } else { - s.logError("Failed to get random node height", err) + /* + var err error + randHeight, err = s.randomNodeHeight(iterCtx) + if err != nil { + cancelIteration() + if errors.Is(err, errNoPeers) { + s.log.Infow("No peers available", "retrying in", retryDuration.String()) + s.sleep(retryDuration) + } else { + s.logError("Failed to get random node height", err) + } + continue } - continue - } + */ var nextHeight int if curHeight, err := s.blockchain.Height(); err == nil { //nolint:govet @@ -115,17 +111,18 @@ func (s *syncService) start(ctx context.Context) { s.log.Errorw("Failed to get current height", "err", err) } - blockBehind := randHeight - (nextHeight - 1) - if blockBehind <= 0 { - s.log.Infow("Random node height is the same or less as local height", " retrying in", retryDuration.String(), - "Random node height", randHeight, "Current height", nextHeight-1) - cancelIteration() - s.sleep(retryDuration) - continue - } + /* + blockBehind := randHeight - (nextHeight - 1) + if blockBehind <= 0 { + s.log.Infow("Random node height is the same or less as local height", " retrying in", retryDuration.String(), + "Random node height", randHeight, "Current height", nextHeight-1) + cancelIteration() + s.sleep(retryDuration) + continue + } + */ - s.log.Infow("Start Pipeline", "Random node height", randHeight, "Current height", nextHeight-1, "Start", nextHeight, "End", - nextHeight+min(blockBehind, maxBlocks)) + s.log.Infow("Start Pipeline", "Random node height", randHeight, "Current height", nextHeight-1, "Start", nextHeight) // todo change iteration to fetch several objects uint64(min(blockBehind, maxBlocks)) blockNumber := uint64(nextHeight) @@ -136,16 +133,6 @@ func (s *syncService) start(ctx context.Context) { continue } - /* - blockBodiesCh, err := s.genBlockBodies(iterCtx, commonIt) - if err != nil { - s.logError("Failed to get block bodies", err) - cancelIteration() - continue - } - - */ - txsCh, err := s.genTransactions(iterCtx, blockNumber) if err != nil { s.logError("Failed to get transactions", err) @@ -153,12 +140,14 @@ func (s *syncService) start(ctx context.Context) { continue } - receiptsCh, err := s.genReceipts(iterCtx, blockNumber) - if err != nil { - s.logError("Failed to get receipts", err) - cancelIteration() - continue - } + /* + receiptsCh, err := s.genReceipts(iterCtx, blockNumber) + if err != nil { + s.logError("Failed to get receipts", err) + cancelIteration() + continue + } + */ eventsCh, err := s.genEvents(iterCtx, blockNumber) if err != nil { @@ -186,8 +175,8 @@ func (s *syncService) start(ctx context.Context) { pipeline.Stage(iterCtx, classesCh, specBlockPartsFunc[specClasses]), pipeline.Stage(iterCtx, stateDiffsCh, specBlockPartsFunc[specContractDiffs]), // pipeline.Stage(iterCtx, blockBodiesCh, specBlockPartsFunc[specBlockBody]), - pipeline.Stage(iterCtx, txsCh, specBlockPartsFunc[specTransactions]), - pipeline.Stage(iterCtx, receiptsCh, specBlockPartsFunc[specReceipts]), + pipeline.Stage(iterCtx, txsCh, specBlockPartsFunc[specTxWithReceipts]), + // pipeline.Stage(iterCtx, receiptsCh, specBlockPartsFunc[specReceipts]), pipeline.Stage(iterCtx, eventsCh, specBlockPartsFunc[specEvents]), ))) @@ -200,16 +189,6 @@ func (s *syncService) start(ctx context.Context) { } storeTimer := time.Now() - var str string - for k, v := range b.newClasses { - h, err := v.Hash() - if err != nil { - panic(err) - } - - str += fmt.Sprintf("key=%s, value=%s\n", k.String(), h) - } - fmt.Printf("Block %d stateUpdate: %v newClasses: %v\n", b.block.Number, b.stateUpdate.OldRoot, str) err = s.blockchain.Store(b.block, b.commitments, b.stateUpdate, b.newClasses) if err != nil { s.log.Errorw("Failed to Store Block", "number", b.block.Number, "err", err) @@ -225,7 +204,7 @@ func (s *syncService) start(ctx context.Context) { } } -func specBlockPartsFunc[T specBlockHeaderAndSigs | specBlockBody | specTransactions | specReceipts | specEvents | specClasses | specContractDiffs](i T) specBlockParts { +func specBlockPartsFunc[T specBlockHeaderAndSigs | specBlockBody | specTxWithReceipts | specReceipts | specEvents | specClasses | specContractDiffs](i T) specBlockParts { return specBlockParts(i) } @@ -266,8 +245,8 @@ func (s *syncService) processSpecBlockParts( specBlockHeadersAndSigsM := make(map[uint64]specBlockHeaderAndSigs) specBlockBodiesM := make(map[uint64]specBlockBody) specClassesM := make(map[uint64]specClasses) - specTransactionsM := make(map[uint64]specTransactions) - specReceiptsM := make(map[uint64]specReceipts) + specTransactionsM := make(map[uint64]specTxWithReceipts) + // specReceiptsM := make(map[uint64]specReceipts) specEventsM := make(map[uint64]specEvents) specContractDiffsM := make(map[uint64]specContractDiffs) @@ -287,16 +266,16 @@ func (s *syncService) processSpecBlockParts( if _, ok := specBlockBodiesM[part.blockNumber()]; !ok { specBlockBodiesM[part.blockNumber()] = p } - case specTransactions: + case specTxWithReceipts: s.log.Debugw("Received Transactions", "blockNumber", p.blockNumber()) if _, ok := specTransactionsM[part.blockNumber()]; !ok { specTransactionsM[part.blockNumber()] = p } - case specReceipts: - s.log.Debugw("Received Receipts", "blockNumber", p.blockNumber()) - if _, ok := specReceiptsM[part.blockNumber()]; !ok { - specReceiptsM[part.blockNumber()] = p - } + // case specReceipts: + // s.log.Debugw("Received Receipts", "blockNumber", p.blockNumber()) + // if _, ok := specReceiptsM[part.blockNumber()]; !ok { + // specReceiptsM[part.blockNumber()] = p + // } case specEvents: s.log.Debugw("Received Events", "blockNumber", p.blockNumber()) if _, ok := specEventsM[part.blockNumber()]; !ok { @@ -319,11 +298,11 @@ func (s *syncService) processSpecBlockParts( headerAndSig, ok1 := specBlockHeadersAndSigsM[curBlockNum] // body, ok2 := specBlockBodiesM[curBlockNum] txs, ok3 := specTransactionsM[curBlockNum] - rs, ok4 := specReceiptsM[curBlockNum] + // rs, ok4 := specReceiptsM[curBlockNum] es, ok5 := specEventsM[curBlockNum] cls, ok6 := specClassesM[curBlockNum] diffs, ok7 := specContractDiffsM[curBlockNum] - if ok1 && ok3 && ok4 && ok5 && ok6 && ok7 { + if ok1 && ok3 && ok5 && ok6 && ok7 { s.log.Debugw(fmt.Sprintf("----- Received all block parts from peers for block number %d-----", curBlockNum)) select { @@ -333,7 +312,7 @@ func (s *syncService) processSpecBlockParts( if curBlockNum > 0 { // First check cache if the header is not present, then get it from the db. if oldHeader, ok := specBlockHeadersAndSigsM[curBlockNum-1]; ok { - prevBlockRoot = p2p2core.AdaptHash(oldHeader.header.State.Root) + prevBlockRoot = p2p2core.AdaptHash(oldHeader.header.StateRoot) } else { oldHeader, err := s.blockchain.BlockHeaderByNumber(curBlockNum - 1) if err != nil { @@ -345,7 +324,7 @@ func (s *syncService) processSpecBlockParts( } orderedBlockBodiesCh <- s.adaptAndSanityCheckBlock(ctx, headerAndSig.header, diffs.contractDiffs, - cls.classes, txs.txs, rs.receipts, es.events, prevBlockRoot) + cls.classes, txs.txs, txs.receipts, es.events, prevBlockRoot) } if curBlockNum > 0 { @@ -353,7 +332,7 @@ func (s *syncService) processSpecBlockParts( } delete(specBlockBodiesM, curBlockNum) delete(specTransactionsM, curBlockNum) - delete(specReceiptsM, curBlockNum) + // delete(specReceiptsM, curBlockNum) delete(specEventsM, curBlockNum) curBlockNum++ } @@ -388,7 +367,10 @@ func (s *syncService) adaptAndSanityCheckBlock(ctx context.Context, header *spec txHashEventsM[*txH] = append(txHashEventsM[*txH], p2p2core.AdaptEvent(event)) } - coreReceipts := utils.Map(receipts, p2p2core.AdaptReceipt) + var coreReceipts []*core.TransactionReceipt + for i, r := range receipts { + coreReceipts = append(coreReceipts, p2p2core.AdaptReceipt(r, coreTxs[i].Hash())) + } coreReceipts = utils.Map(coreReceipts, func(r *core.TransactionReceipt) *core.TransactionReceipt { r.Events = txHashEventsM[*r.TransactionHash] return r @@ -567,6 +549,7 @@ func (s specReceipts) blockNumber() uint64 { return s.number } +/* //nolint:dupl func (s *syncService) genReceipts(ctx context.Context, blockNumber uint64) (<-chan specReceipts, error) { it := s.createIteratorForBlock(blockNumber) @@ -605,6 +588,7 @@ func (s *syncService) genReceipts(ctx context.Context, blockNumber uint64) (<-ch return receiptsCh, nil } +*/ type specClasses struct { number uint64 @@ -741,32 +725,38 @@ func (s *syncService) genEvents(ctx context.Context, blockNumber uint64) (<-chan return eventsCh, nil } -type specTransactions struct { - number uint64 - txs []*spec.Transaction +type specTxWithReceipts struct { + number uint64 + txs []*spec.Transaction + receipts []*spec.Receipt } -func (s specTransactions) blockNumber() uint64 { +func (s specTxWithReceipts) blockNumber() uint64 { return s.number } //nolint:dupl -func (s *syncService) genTransactions(ctx context.Context, blockNumber uint64) (<-chan specTransactions, error) { +func (s *syncService) genTransactions(ctx context.Context, blockNumber uint64) (<-chan specTxWithReceipts, error) { it := s.createIteratorForBlock(blockNumber) txsIt, err := s.client.RequestTransactions(ctx, &spec.TransactionsRequest{Iteration: it}) if err != nil { return nil, err } - txsCh := make(chan specTransactions) + txsCh := make(chan specTxWithReceipts) go func() { defer close(txsCh) - var transactions []*spec.Transaction + var ( + transactions []*spec.Transaction + receipts []*spec.Receipt + ) txsIt(func(res *spec.TransactionsResponse) bool { switch v := res.TransactionMessage.(type) { - case *spec.TransactionsResponse_Transaction: - transactions = append(transactions, res.GetTransaction()) + case *spec.TransactionsResponse_TransactionWithReceipt: + txWithReceipt := v.TransactionWithReceipt + transactions = append(transactions, txWithReceipt.Transaction) + receipts = append(receipts, txWithReceipt.Receipt) return true case *spec.TransactionsResponse_Fin: return false @@ -777,9 +767,10 @@ func (s *syncService) genTransactions(ctx context.Context, blockNumber uint64) ( }) s.log.Debugw("Transactions length", "len", len(transactions)) - spexTxs := specTransactions{ - number: blockNumber, - txs: transactions, + spexTxs := specTxWithReceipts{ + number: blockNumber, + txs: transactions, + receipts: receipts, } select { case <-ctx.Done(): From fac9668fe2b9a34923262199ab306696c6c398c4 Mon Sep 17 00:00:00 2001 From: Kirill Date: Wed, 29 May 2024 14:01:50 +0400 Subject: [PATCH 08/18] Recent changes --- .golangci.yaml | 6 ++++ Makefile | 10 +++++++ adapters/p2p2core/class.go | 1 - adapters/p2p2core/state.go | 1 + adapters/p2p2core/transaction.go | 12 ++++---- blockchain/blockchain.go | 3 ++ core/block.go | 2 +- core/state.go | 8 +++-- core/transaction.go | 21 +++++++++++++ node/node.go | 2 +- p2p/sync.go | 51 ++++++++++++++++++++++++++++++-- utils/network.go | 2 +- 12 files changed, 105 insertions(+), 14 deletions(-) diff --git a/.golangci.yaml b/.golangci.yaml index 068f99cd04..a5b49e173f 100644 --- a/.golangci.yaml +++ b/.golangci.yaml @@ -64,6 +64,10 @@ linters-settings: require-explanation: false # don't require an explanation for nolint directives require-specific: false # don't require nolint directives to be specific about which linter is being skipped + exhaustruct: + include: + - '.+/core\..+' + linters: disable-all: true enable: @@ -99,6 +103,7 @@ linters: - whitespace - tparallel - gci + - exhaustruct # don't enable: # - asciicheck @@ -125,6 +130,7 @@ issues: - funlen - lll - gosec + - exhaustruct - linters: - lll diff --git a/Makefile b/Makefile index 565fc53af3..30aa827d07 100644 --- a/Makefile +++ b/Makefile @@ -134,3 +134,13 @@ node3: --p2p-private-key="54a695e2a5d5717d5ba8730efcafe6f17251a1955733cffc55a4085fbf7f5d2c1b4009314092069ef7ca9b364ce3eb3072531c64dfb2799c6bad76720a5bdff0" \ --metrics-port=9093 +pathfinder: juno-cached + rm -rf ./p2p-dbs/node-pathfinder/ && \ + ./build/juno \ + --network=sepolia \ + --log-level=debug \ + --db-path=./p2p-dbs/node-pathfinder \ + --p2p \ + --p2p-peers=/ip4/127.0.0.1/tcp/8888/p2p/12D3KooWF1JrZWQoBiBSjsFSuLbDiDvqcmJQRLaFQLmpVkHA9duk \ + --p2p-private-key="54a695e2a5d5717d5ba8730efcafe6f17251a1955733cffc55a4085fbf7f5d2c1b4009314092069ef7ca9b364ce3eb3072531c64dfb2799c6bad76720a5bdff0" \ + --metrics-port=9094 diff --git a/adapters/p2p2core/class.go b/adapters/p2p2core/class.go index f22d50929a..2129df8ae7 100644 --- a/adapters/p2p2core/class.go +++ b/adapters/p2p2core/class.go @@ -40,7 +40,6 @@ func AdaptClass(class *spec.Class) core.Class { program := utils.Map(cairo1.Program, AdaptFelt) compiled, err := createCompiledClass(cairo1) if err != nil { - fmt.Println("Version is ", cairo1.ContractClassVersion) panic(err) } diff --git a/adapters/p2p2core/state.go b/adapters/p2p2core/state.go index 4bdbe9fa2a..c2310eec6a 100644 --- a/adapters/p2p2core/state.go +++ b/adapters/p2p2core/state.go @@ -25,6 +25,7 @@ func AdaptStateDiff(contractDiffs []*spec.ContractDiff, classes []*spec.Class) * declaredV0Classes = append(declaredV0Classes, h) case *core.Cairo1Class: declaredV1Classes[*h] = c.Compiled.Hash() + // todo add type? } } diff --git a/adapters/p2p2core/transaction.go b/adapters/p2p2core/transaction.go index 5abc8a0027..19f961f8a2 100644 --- a/adapters/p2p2core/transaction.go +++ b/adapters/p2p2core/transaction.go @@ -94,8 +94,8 @@ func AdaptTransaction(t *spec.Transaction, network *utils.Network) core.Transact core.ResourceL1Gas: adaptResourceLimits(tx.ResourceBounds.L1Gas), core.ResourceL2Gas: adaptResourceLimits(tx.ResourceBounds.L2Gas), }, - PaymasterData: nil, // Todo: P2P needs to change the pay master data to a list - AccountDeploymentData: nil, // Todo: update p2p spec to include this + PaymasterData: utils.Map(tx.PaymasterData, AdaptFelt), + AccountDeploymentData: utils.Map(tx.AccountDeploymentData, AdaptFelt), NonceDAMode: nDAMode, FeeDAMode: fDAMode, } @@ -171,7 +171,7 @@ func AdaptTransaction(t *spec.Transaction, network *utils.Network) core.Transact core.ResourceL1Gas: adaptResourceLimits(tx.ResourceBounds.L1Gas), core.ResourceL2Gas: adaptResourceLimits(tx.ResourceBounds.L2Gas), }, - PaymasterData: nil, // Todo: P2P needs to change the pay master data to a list + PaymasterData: utils.Map(tx.PaymasterData, AdaptFelt), NonceDAMode: nDAMode, FeeDAMode: fDAMode, } @@ -196,7 +196,7 @@ func AdaptTransaction(t *spec.Transaction, network *utils.Network) core.Transact case *spec.Transaction_InvokeV1_: tx := t.GetInvokeV1() invTx := &core.InvokeTransaction{ - ContractAddress: nil, // not used in v1 + ContractAddress: nil, // todo call core.ContractAddress() ? Nonce: AdaptFelt(tx.Nonce), SenderAddress: AdaptAddress(tx.Sender), CallData: utils.Map(tx.Calldata, AdaptFelt), @@ -222,7 +222,7 @@ func AdaptTransaction(t *spec.Transaction, network *utils.Network) core.Transact } invTx := &core.InvokeTransaction{ - ContractAddress: nil, // is it ok? + ContractAddress: nil, // todo call core.ContractAddress() ? CallData: utils.Map(tx.Calldata, AdaptFelt), TransactionSignature: adaptAccountSignature(tx.Signature), // MaxFee: AdaptFelt(tx.MaxFee), todo support max_fee? @@ -235,7 +235,7 @@ func AdaptTransaction(t *spec.Transaction, network *utils.Network) core.Transact core.ResourceL1Gas: adaptResourceLimits(tx.ResourceBounds.L1Gas), core.ResourceL2Gas: adaptResourceLimits(tx.ResourceBounds.L2Gas), }, - PaymasterData: nil, // Todo: P2P needs to change the pay master data to a list + PaymasterData: utils.Map(tx.PaymasterData, AdaptFelt), NonceDAMode: nDAMode, FeeDAMode: fDAMode, } diff --git a/blockchain/blockchain.go b/blockchain/blockchain.go index 36d622991c..8ccc84ff08 100644 --- a/blockchain/blockchain.go +++ b/blockchain/blockchain.go @@ -8,6 +8,8 @@ import ( "sync/atomic" "time" + "github.com/davecgh/go-spew/spew" + "github.com/Masterminds/semver/v3" "github.com/NethermindEth/juno/core" "github.com/NethermindEth/juno/core/felt" @@ -340,6 +342,7 @@ func (b *Blockchain) Store(block *core.Block, blockCommitments *core.BlockCommit if err := verifyBlock(txn, block); err != nil { return err } + spew.Dump("DUMP", block.Number, stateUpdate) if err := core.NewState(txn).Update(block.Number, stateUpdate, newClasses); err != nil { return err } diff --git a/core/block.go b/core/block.go index 44bb78a46c..8c51bdfaf1 100644 --- a/core/block.go +++ b/core/block.go @@ -88,7 +88,7 @@ func VerifyBlockHash(b *Block, network *utils.Network) (*BlockCommitments, error unverifiableRange := metaInfo.UnverifiableRange skipVerification := unverifiableRange != nil && b.Number >= unverifiableRange[0] && b.Number <= unverifiableRange[1] //nolint:gocritic - + // todo should we still keep it after p2p ? if !skipVerification { if err := VerifyTransactions(b.Transactions, network, b.ProtocolVersion); err != nil { return nil, err diff --git a/core/state.go b/core/state.go index 7c77cdefed..f45d82df95 100644 --- a/core/state.go +++ b/core/state.go @@ -199,7 +199,7 @@ func (s *State) verifyStateUpdateRoot(root *felt.Felt) error { func (s *State) Update(blockNumber uint64, update *StateUpdate, declaredClasses map[felt.Felt]Class) error { err := s.verifyStateUpdateRoot(update.OldRoot) if err != nil { - return err + return fmt.Errorf("beginning: %w", err) } // spew.Dump(blockNumber, update.StateDiff) @@ -235,7 +235,11 @@ func (s *State) Update(blockNumber uint64, update *StateUpdate, declaredClasses return err } - return s.verifyStateUpdateRoot(update.NewRoot) + err = s.verifyStateUpdateRoot(update.NewRoot) + if err != nil { + return fmt.Errorf("end: %w", err) + } + return nil } var ( diff --git a/core/transaction.go b/core/transaction.go index 1f22c5dcb2..dbbbf6e6c3 100644 --- a/core/transaction.go +++ b/core/transaction.go @@ -413,6 +413,7 @@ func TransactionHash(transaction Transaction, n *utils.Network) (*felt.Felt, err case *DeployTransaction: // deploy transactions are deprecated after re-genesis therefore we don't verify // transaction hash + return deployTransactionHash(t, n) return t.TransactionHash, nil case *L1HandlerTransaction: return l1HandlerTransactionHash(t, n) @@ -423,6 +424,26 @@ func TransactionHash(transaction Transaction, n *utils.Network) (*felt.Felt, err } } +func deployTransactionHash(d *DeployTransaction, n *utils.Network) (*felt.Felt, error) { + snKeccakConstructor, err := crypto.StarknetKeccak([]byte("constructor")) + if err != nil { + return nil, err + } + if d.Version.Is(0) || d.Version.Is(1) { + return crypto.PedersenArray( + new(felt.Felt).SetBytes([]byte("deploy")), + d.Version.AsFelt(), + d.ContractAddress, + snKeccakConstructor, + crypto.PedersenArray(d.ConstructorCallData...), + new(felt.Felt), + n.L2ChainIDFelt(), + ), nil + } + + return nil, fmt.Errorf("Invalid deploy tx hash") +} + var ( invokeFelt = new(felt.Felt).SetBytes([]byte("invoke")) declareFelt = new(felt.Felt).SetBytes([]byte("declare")) diff --git a/node/node.go b/node/node.go index de880617cf..dbc3454adf 100644 --- a/node/node.go +++ b/node/node.go @@ -148,7 +148,7 @@ func New(cfg *Config, version string) (*Node, error) { //nolint:gocyclo,funlen var p2pService *p2p.Service if cfg.P2P { if cfg.Network != utils.Sepolia { - return nil, fmt.Errorf("P2P can only be used for %v network. Provided network: %v", utils.Sepolia, cfg.Network) + // return nil, fmt.Errorf("P2P can only be used for %v network. Provided network: %v", utils.Sepolia, cfg.Network) } log.Warnw("P2P features enabled. Please note P2P is in experimental stage") diff --git a/p2p/sync.go b/p2p/sync.go index ddc6f76c36..a6e44fe39b 100644 --- a/p2p/sync.go +++ b/p2p/sync.go @@ -8,6 +8,8 @@ import ( "reflect" "time" + "github.com/davecgh/go-spew/spew" + "github.com/NethermindEth/juno/adapters/p2p2core" "github.com/NethermindEth/juno/blockchain" "github.com/NethermindEth/juno/core" @@ -189,6 +191,40 @@ func (s *syncService) start(ctx context.Context) { } storeTimer := time.Now() + if b.block.Number == 7 && false { + for k, v := range map[string]string{ + "0x903752516de5c04fe91600ca6891e325278b2dfc54880ae11a809abb364844": "0x7e2bc0b8214da5e9506f383ce72dd8e92cf7f09e8cb668522f43e77023c9f52", + "0x1a736d6ed154502257f02b1ccdf4d9d1089f80811cd6acad48e6b6a9d1f2003": "0x29787a427a423ffc5986d43e630077a176e4391fcef3ebf36014b154069ae4", + } { + key, err := new(felt.Felt).SetString(k) + if err != nil { + panic(err) + } + + value, err := new(felt.Felt).SetString(v) + if err != nil { + panic(err) + } + + b.stateUpdate.StateDiff.DeclaredV1Classes[*key] = value + } + + b.stateUpdate.StateDiff.DeclaredV0Classes = utils.Map([]string{ + "0x3ae692aaf1ded26a0b58cf42490f757563850acea887ed57b4894fee8279063", + "0x7b3e05f48f0c69e4a65ce5e076a66271a527aff2c34ce1083ec6e1526997a69", + "0x7db5c2c2676c2a5bfc892ee4f596b49514e3056a0eee8ad125870b4fb1dd909", + "0x5aa23d5bb71ddaa783da7ea79d405315bafa7cf0387a74f4593578c3e9e6570", + "0x402d6191ebe3ea289789edd160f3afa6600a389f1aad0ab7709b830653c6f08", + "0x3131fa018d520a037686ce3efddeab8f28895662f019ca3ca18a626650f7d1e", + "0x381f14e5e0db5889c981bf050fb034c0fbe0c4f070ee79346a05dbe2bf2af90", + }, func(s string) *felt.Felt { + value, err := new(felt.Felt).SetString(s) + if err != nil { + panic(err) + } + return value + }) + } err = s.blockchain.Store(b.block, b.commitments, b.stateUpdate, b.newClasses) if err != nil { s.log.Errorw("Failed to Store Block", "number", b.block.Number, "err", err) @@ -287,7 +323,7 @@ func (s *syncService) processSpecBlockParts( specClassesM[part.blockNumber()] = p } case specContractDiffs: - s.log.Debugw("Received Classes", "blockNumber", p.blockNumber()) + s.log.Debugw("Received ContractDiffs", "blockNumber", p.blockNumber()) if _, ok := specContractDiffsM[part.blockNumber()]; !ok { specContractDiffsM[part.blockNumber()] = p } @@ -369,7 +405,12 @@ func (s *syncService) adaptAndSanityCheckBlock(ctx context.Context, header *spec var coreReceipts []*core.TransactionReceipt for i, r := range receipts { - coreReceipts = append(coreReceipts, p2p2core.AdaptReceipt(r, coreTxs[i].Hash())) + txHash := coreTxs[i].Hash() + if txHash == nil { + spew.Dump(coreTxs[i]) + panic(fmt.Errorf("TX hash %d is nil", i)) + } + coreReceipts = append(coreReceipts, p2p2core.AdaptReceipt(r, txHash)) } coreReceipts = utils.Map(coreReceipts, func(r *core.TransactionReceipt) *core.TransactionReceipt { r.Events = txHashEventsM[*r.TransactionHash] @@ -404,6 +445,7 @@ func (s *syncService) adaptAndSanityCheckBlock(ctx context.Context, header *spec // Note: Parts of the State Update are created from Blockchain object as the Store and SanityCheck functions require a State // Update but there is no such message in P2P. + spew.Dump("Classes", coreBlock.Number, len(classes)) stateUpdate := &core.StateUpdate{ BlockHash: coreBlock.Hash, NewRoot: coreBlock.GlobalStateRoot, @@ -630,6 +672,7 @@ func (s *syncService) genClasses(ctx context.Context, blockNumber uint64) (<-cha number: blockNumber, classes: classes, }: + s.log.Debugw("Received classes for block", "blockNumber", blockNumber, "lenClasses", len(classes)) } }() return classesCh, nil @@ -661,6 +704,9 @@ func (s *syncService) genStateDiffs(ctx context.Context, blockNumber uint64) (<- case *spec.StateDiffsResponse_ContractDiff: contractDiffs = append(contractDiffs, v.ContractDiff) return true + case *spec.StateDiffsResponse_DeclaredClass: + s.log.Warnw("Unimplemented message StateDiffsResponse_DeclaredClass") + return true case *spec.StateDiffsResponse_Fin: return false default: @@ -805,6 +851,7 @@ var errNoPeers = errors.New("no peers available") func (s *syncService) randomPeerStream(ctx context.Context, pids ...protocol.ID) (network.Stream, error) { randPeer := s.randomPeer() if randPeer == "" { + panic(errNoPeers) return nil, errNoPeers } stream, err := s.host.NewStream(ctx, randPeer, pids...) diff --git a/utils/network.go b/utils/network.go index 7491b1af31..5bea3c8c77 100644 --- a/utils/network.go +++ b/utils/network.go @@ -194,7 +194,7 @@ func (n *Network) L2ChainIDFelt() *felt.Felt { } func (n *Network) ProtocolID() protocol.ID { - return protocol.ID(fmt.Sprintf("/starknet/%s", n.String())) + return "/starknet" // n.String() } func knownNetworkNames() []string { From 0ba0ed0008d083aa6d1cb70f50db6d43443ce92a Mon Sep 17 00:00:00 2001 From: Kirill Date: Thu, 30 May 2024 14:11:55 +0400 Subject: [PATCH 09/18] Added debug code --- adapters/p2p2core/block.go | 2 +- adapters/p2p2core/receipt.go | 2 +- blockchain/blockchain.go | 1 + core/block.go | 15 ++++ p2p/starknet/client.go | 6 +- p2p/sync.go | 128 ++++++++++++++--------------------- 6 files changed, 72 insertions(+), 82 deletions(-) diff --git a/adapters/p2p2core/block.go b/adapters/p2p2core/block.go index 705503f2eb..2cb58ad049 100644 --- a/adapters/p2p2core/block.go +++ b/adapters/p2p2core/block.go @@ -25,7 +25,7 @@ func AdaptSignature(cs *spec.ConsensusSignature) []*felt.Felt { func AdaptBlockHeader(h *spec.SignedBlockHeader) core.Header { return core.Header{ - Hash: nil, // todo: add this when building the block + Hash: AdaptHash(h.BlockHash), // todo: add this when building the block ParentHash: AdaptHash(h.ParentHash), Number: h.Number, GlobalStateRoot: AdaptHash(h.StateRoot), diff --git a/adapters/p2p2core/receipt.go b/adapters/p2p2core/receipt.go index ad6de5bda9..d53f9e54b2 100644 --- a/adapters/p2p2core/receipt.go +++ b/adapters/p2p2core/receipt.go @@ -62,7 +62,7 @@ func adaptExecutionResources(er *spec.Receipt_ExecutionResources) *core.Executio func adaptMessageToL1(m *spec.MessageToL1) *core.L2ToL1Message { return &core.L2ToL1Message{ From: AdaptFelt(m.FromAddress), - Payload: utils.Map(m.Payload, AdaptFelt), To: AdaptEthAddress(m.ToAddress), + Payload: utils.Map(m.Payload, AdaptFelt), } } diff --git a/blockchain/blockchain.go b/blockchain/blockchain.go index 8ccc84ff08..d4b7dd1c34 100644 --- a/blockchain/blockchain.go +++ b/blockchain/blockchain.go @@ -403,6 +403,7 @@ func verifyBlock(txn db.Transaction, block *core.Block) error { return fmt.Errorf("expected block #%d, got block #%d", expectedBlockNumber, block.Number) } if !block.ParentHash.Equal(expectedParentHash) { + spew.Dump("EXPECTATION FAIL", h.Number, h.Hash, h.ParentHash) return ErrParentDoesNotMatchHead } diff --git a/core/block.go b/core/block.go index 8c51bdfaf1..42112268e5 100644 --- a/core/block.go +++ b/core/block.go @@ -5,6 +5,8 @@ import ( "errors" "fmt" + "github.com/davecgh/go-spew/spew" + "github.com/NethermindEth/juno/core/crypto" "github.com/NethermindEth/juno/core/felt" "github.com/NethermindEth/juno/utils" @@ -193,6 +195,19 @@ func post07Hash(b *Block, overrideSeqAddr *felt.Felt) (*felt.Felt, *BlockCommitm return nil, nil, eErr } + spew.Dump("HASH VALUES:", + b.Number, // block number + b.GlobalStateRoot, // global state root + seqAddr, // sequencer address + b.Timestamp, // block timestamp + b.TransactionCount, // number of transactions + txCommitment, // transaction commitment + b.EventCount, // number of events + eCommitment, // event commitment + &felt.Zero, // reserved: protocol version + &felt.Zero, // reserved: extra data + b.ParentHash, // parent block hash + &BlockCommitments{TransactionCommitment: txCommitment, EventCommitment: eCommitment}) // Unlike the pre07Hash computation, we exclude the chain // id and replace the zero felt with the actual values for: // - sequencer address diff --git a/p2p/starknet/client.go b/p2p/starknet/client.go index ae6f902eca..be8b8d7d9a 100644 --- a/p2p/starknet/client.go +++ b/p2p/starknet/client.go @@ -61,7 +61,7 @@ func requestAndReceiveStream[ReqT proto.Message, ResT proto.Message](ctx context id := stream.ID() if err := sendAndCloseWrite(stream, req); err != nil { - log.Debugw("sendAndCloseWrite (stream is not closed)", "err", err, "streamID", id) + log.Errorw("sendAndCloseWrite (stream is not closed)", "err", err, "streamID", id) return nil, err } @@ -69,7 +69,7 @@ func requestAndReceiveStream[ReqT proto.Message, ResT proto.Message](ctx context defer func() { closeErr := stream.Close() if closeErr != nil { - log.Debugw("Error while closing stream", "err", closeErr) + log.Errorw("Error while closing stream", "err", closeErr) } }() @@ -77,7 +77,7 @@ func requestAndReceiveStream[ReqT proto.Message, ResT proto.Message](ctx context var zero ResT res := zero.ProtoReflect().New().Interface() if err := receiveInto(stream, res); err != nil { - if !errors.Is(err, io.EOF) { + if true || !errors.Is(err, io.EOF) { log.Debugw("Error while reading from stream", "err", err) } diff --git a/p2p/sync.go b/p2p/sync.go index 8c2fa06179..a774ddb16e 100644 --- a/p2p/sync.go +++ b/p2p/sync.go @@ -4,7 +4,9 @@ import ( "context" "errors" "fmt" + "log" "math/rand" + "os" "reflect" "time" @@ -49,28 +51,29 @@ func newSyncService(bc *blockchain.Blockchain, h host.Host, n *utils.Network, lo } } +/* func (s *syncService) randomNodeHeight(ctx context.Context) (int, error) { - return 9000, nil - //headersIt, err := s.client.RequestCurrentBlockHeader(ctx, &spec.CurrentBlockHeaderRequest{}) - //if err != nil { - // return 0, err - //} - // - //var header *spec.BlockHeader - //headersIt(func(res *spec.BlockHeadersResponse) bool { - // for _, part := range res.GetPart() { - // if _, ok := part.HeaderMessage.(*spec.BlockHeadersResponsePart_Header); ok { - // header = part.GetHeader() - // // found header - time to stop iterator - // return false - // } - // } - // - // return true - //}) - // - //return int(header.Number), nil + headersIt, err := s.client.RequestCurrentBlockHeader(ctx, &spec.CurrentBlockHeaderRequest{}) + if err != nil { + return 0, err + } + + var header *spec.BlockHeader + headersIt(func(res *spec.BlockHeadersResponse) bool { + for _, part := range res.GetPart() { + if _, ok := part.HeaderMessage.(*spec.BlockHeadersResponsePart_Header); ok { + header = part.GetHeader() + // found header - time to stop iterator + return false + } + } + + return true + }) + + return int(header.Number), nil } +*/ const retryDuration = 5 * time.Second @@ -142,15 +145,6 @@ func (s *syncService) start(ctx context.Context) { continue } - /* - receiptsCh, err := s.genReceipts(iterCtx, blockNumber) - if err != nil { - s.logError("Failed to get receipts", err) - cancelIteration() - continue - } - */ - eventsCh, err := s.genEvents(iterCtx, blockNumber) if err != nil { s.logError("Failed to get classes", err) @@ -176,9 +170,7 @@ func (s *syncService) start(ctx context.Context) { pipeline.Stage(iterCtx, headersAndSigsCh, specBlockPartsFunc[specBlockHeaderAndSigs]), pipeline.Stage(iterCtx, classesCh, specBlockPartsFunc[specClasses]), pipeline.Stage(iterCtx, stateDiffsCh, specBlockPartsFunc[specContractDiffs]), - // pipeline.Stage(iterCtx, blockBodiesCh, specBlockPartsFunc[specBlockBody]), pipeline.Stage(iterCtx, txsCh, specBlockPartsFunc[specTxWithReceipts]), - // pipeline.Stage(iterCtx, receiptsCh, specBlockPartsFunc[specReceipts]), pipeline.Stage(iterCtx, eventsCh, specBlockPartsFunc[specEvents]), ))) @@ -191,42 +183,12 @@ func (s *syncService) start(ctx context.Context) { } storeTimer := time.Now() - if b.block.Number == 7 && false { - for k, v := range map[string]string{ - "0x903752516de5c04fe91600ca6891e325278b2dfc54880ae11a809abb364844": "0x7e2bc0b8214da5e9506f383ce72dd8e92cf7f09e8cb668522f43e77023c9f52", - "0x1a736d6ed154502257f02b1ccdf4d9d1089f80811cd6acad48e6b6a9d1f2003": "0x29787a427a423ffc5986d43e630077a176e4391fcef3ebf36014b154069ae4", - } { - key, err := new(felt.Felt).SetString(k) - if err != nil { - panic(err) - } - - value, err := new(felt.Felt).SetString(v) - if err != nil { - panic(err) - } - - b.stateUpdate.StateDiff.DeclaredV1Classes[*key] = value - } - - b.stateUpdate.StateDiff.DeclaredV0Classes = utils.Map([]string{ - "0x3ae692aaf1ded26a0b58cf42490f757563850acea887ed57b4894fee8279063", - "0x7b3e05f48f0c69e4a65ce5e076a66271a527aff2c34ce1083ec6e1526997a69", - "0x7db5c2c2676c2a5bfc892ee4f596b49514e3056a0eee8ad125870b4fb1dd909", - "0x5aa23d5bb71ddaa783da7ea79d405315bafa7cf0387a74f4593578c3e9e6570", - "0x402d6191ebe3ea289789edd160f3afa6600a389f1aad0ab7709b830653c6f08", - "0x3131fa018d520a037686ce3efddeab8f28895662f019ca3ca18a626650f7d1e", - "0x381f14e5e0db5889c981bf050fb034c0fbe0c4f070ee79346a05dbe2bf2af90", - }, func(s string) *felt.Felt { - value, err := new(felt.Felt).SetString(s) - if err != nil { - panic(err) - } - return value - }) - } err = s.blockchain.Store(b.block, b.commitments, b.stateUpdate, b.newClasses) if err != nil { + if err == blockchain.ErrParentDoesNotMatchHead { + spew.Dump(b.block.Number, b.block.Hash, b.block.ParentHash) + log.Fatal("Parent does NOT match head", err) + } s.log.Errorw("Failed to Store Block", "number", b.block.Number, "err", err) cancelIteration() break @@ -307,13 +269,8 @@ func (s *syncService) processSpecBlockParts( if _, ok := specTransactionsM[part.blockNumber()]; !ok { specTransactionsM[part.blockNumber()] = p } - // case specReceipts: - // s.log.Debugw("Received Receipts", "blockNumber", p.blockNumber()) - // if _, ok := specReceiptsM[part.blockNumber()]; !ok { - // specReceiptsM[part.blockNumber()] = p - // } case specEvents: - s.log.Debugw("Received Events", "blockNumber", p.blockNumber()) + s.log.Debugw("Received Events", "blockNumber", p.blockNumber(), "len", len(p.events)) if _, ok := specEventsM[part.blockNumber()]; !ok { specEventsM[part.blockNumber()] = p } @@ -331,14 +288,14 @@ func (s *syncService) processSpecBlockParts( s.log.Warnw("Unsupported part type", "blockNumber", part.blockNumber(), "type", reflect.TypeOf(p)) } - headerAndSig, ok1 := specBlockHeadersAndSigsM[curBlockNum] + headerAndSig, okHeader := specBlockHeadersAndSigsM[curBlockNum] // body, ok2 := specBlockBodiesM[curBlockNum] - txs, ok3 := specTransactionsM[curBlockNum] + txs, okTxs := specTransactionsM[curBlockNum] // rs, ok4 := specReceiptsM[curBlockNum] - es, ok5 := specEventsM[curBlockNum] - cls, ok6 := specClassesM[curBlockNum] - diffs, ok7 := specContractDiffsM[curBlockNum] - if ok1 && ok3 && ok5 && ok6 && ok7 { + es, okEvents := specEventsM[curBlockNum] + cls, okClasses := specClassesM[curBlockNum] + diffs, okDiffs := specContractDiffsM[curBlockNum] + if okHeader && okTxs && okEvents && okClasses && okDiffs { s.log.Debugw(fmt.Sprintf("----- Received all block parts from peers for block number %d-----", curBlockNum)) select { @@ -422,11 +379,26 @@ func (s *syncService) adaptAndSanityCheckBlock(ctx context.Context, header *spec coreBlock.Header = &coreHeader coreBlock.EventsBloom = core.EventsBloom(coreBlock.Receipts) + + if int(coreBlock.TransactionCount) != len(coreBlock.Transactions) { + spew.Dump("Number of transactions != count", coreBlock) + os.Exit(1) + } + if int(coreBlock.EventCount) != len(events) { + spew.Dump("Number of events != count", coreBlock, events) + os.Exit(1) + } + h, err := core.BlockHash(coreBlock) if err != nil { bodyCh <- blockBody{err: fmt.Errorf("block hash calculation error: %v", err)} return } + if !coreBlock.Hash.Equal(h) { + spew.Dump("Receipts number:", coreBlock.Receipts, events) + spew.Dump("Hash mismtach", coreBlock) + os.Exit(1) + } coreBlock.Hash = h newClasses := make(map[felt.Felt]core.Class) @@ -747,6 +719,7 @@ func (s *syncService) genEvents(ctx context.Context, blockNumber uint64) (<-chan var events []*spec.Event eventsIt(func(res *spec.EventsResponse) bool { + fmt.Println("EVENT ITERATION", res.EventMessage) switch v := res.EventMessage.(type) { case *spec.EventsResponse_Event: events = append(events, v.Event) @@ -765,6 +738,7 @@ func (s *syncService) genEvents(ctx context.Context, blockNumber uint64) (<-chan number: blockNumber, events: events, }: + spew.Dump("Received events from client", len(events), blockNumber) } }() return eventsCh, nil From f3a1f3e67664f034384beb6f8db44a3c6369a750 Mon Sep 17 00:00:00 2001 From: Kirill Date: Thu, 30 May 2024 15:40:50 +0400 Subject: [PATCH 10/18] Remove unused code --- p2p/p2p.go | 16 ++++----- p2p/starknet/client.go | 10 +++--- p2p/starknet/ids.go | 30 ++++++---------- p2p/sync.go | 78 +----------------------------------------- utils/network.go | 5 --- 5 files changed, 25 insertions(+), 114 deletions(-) diff --git a/p2p/p2p.go b/p2p/p2p.go index 4df493d03b..c6f3934ffc 100644 --- a/p2p/p2p.go +++ b/p2p/p2p.go @@ -93,7 +93,7 @@ func NewWithHost(p2phost host.Host, peers string, feederNode bool, bc *blockchai } } - p2pdht, err := makeDHT(p2phost, snNetwork, peersAddrInfoS) + p2pdht, err := makeDHT(p2phost, peersAddrInfoS) if err != nil { return nil, err } @@ -114,9 +114,9 @@ func NewWithHost(p2phost host.Host, peers string, feederNode bool, bc *blockchai return s, nil } -func makeDHT(p2phost host.Host, snNetwork *utils.Network, addrInfos []peer.AddrInfo) (*dht.IpfsDHT, error) { +func makeDHT(p2phost host.Host, addrInfos []peer.AddrInfo) (*dht.IpfsDHT, error) { return dht.New(context.Background(), p2phost, - dht.ProtocolPrefix(snNetwork.ProtocolID()), + dht.ProtocolPrefix(starknet.Prefix), dht.BootstrapPeers(addrInfos...), dht.RoutingTableRefreshPeriod(routingTableRefreshPeriod), dht.Mode(dht.ModeServer), @@ -220,15 +220,15 @@ func (s *Service) Run(ctx context.Context) error { } func (s *Service) setProtocolHandlers() { - s.SetProtocolHandler(starknet.HeadersPID(s.network), s.handler.HeadersHandler) + s.SetProtocolHandler(starknet.HeadersPID(), s.handler.HeadersHandler) // s.SetProtocolHandler(starknet.CurrentBlockHeaderPID(s.network), s.handler.CurrentBlockHeaderHandler) // s.SetProtocolHandler(starknet.ReceiptsPID(s.network), s.handler.ReceiptsHandler) // todo discuss protocol id (should it be included in HeadersPID) // s.SetProtocolHandler(starknet.BlockBodiesPID(s.network), s.handler.BlockBodiesHandler) - s.SetProtocolHandler(starknet.EventsPID(s.network), s.handler.EventsHandler) - s.SetProtocolHandler(starknet.TransactionsPID(s.network), s.handler.TransactionsHandler) - s.SetProtocolHandler(starknet.ClassesPID(s.network), s.handler.ClassesHandler) - s.SetProtocolHandler(starknet.StateDiffPID(s.network), s.handler.StateDiffHandler) + s.SetProtocolHandler(starknet.EventsPID(), s.handler.EventsHandler) + s.SetProtocolHandler(starknet.TransactionsPID(), s.handler.TransactionsHandler) + s.SetProtocolHandler(starknet.ClassesPID(), s.handler.ClassesHandler) + s.SetProtocolHandler(starknet.StateDiffPID(), s.handler.StateDiffHandler) } func (s *Service) callAndLogErr(f func() error, msg string) { diff --git a/p2p/starknet/client.go b/p2p/starknet/client.go index be8b8d7d9a..f4cadbf011 100644 --- a/p2p/starknet/client.go +++ b/p2p/starknet/client.go @@ -102,7 +102,7 @@ func (c *Client) RequestBlockHeaders( ctx context.Context, req *spec.BlockHeadersRequest, ) (iter.Seq[*spec.BlockHeadersResponse], error) { return requestAndReceiveStream[*spec.BlockHeadersRequest, *spec.BlockHeadersResponse]( - ctx, c.newStream, HeadersPID(c.network), req, c.log) + ctx, c.newStream, HeadersPID(), req, c.log) } //func (c *Client) RequestBlockBodies(ctx context.Context, req *spec.BlockBodiesRequest) (iter.Seq[*spec.BlockBodiesResponse], error) { @@ -111,15 +111,15 @@ func (c *Client) RequestBlockHeaders( //} func (c *Client) RequestEvents(ctx context.Context, req *spec.EventsRequest) (iter.Seq[*spec.EventsResponse], error) { - return requestAndReceiveStream[*spec.EventsRequest, *spec.EventsResponse](ctx, c.newStream, EventsPID(c.network), req, c.log) + return requestAndReceiveStream[*spec.EventsRequest, *spec.EventsResponse](ctx, c.newStream, EventsPID(), req, c.log) } func (c *Client) RequestClasses(ctx context.Context, req *spec.ClassesRequest) (iter.Seq[*spec.ClassesResponse], error) { - return requestAndReceiveStream[*spec.ClassesRequest, *spec.ClassesResponse](ctx, c.newStream, ClassesPID(c.network), req, c.log) + return requestAndReceiveStream[*spec.ClassesRequest, *spec.ClassesResponse](ctx, c.newStream, ClassesPID(), req, c.log) } func (c *Client) RequestStateDiffs(ctx context.Context, req *spec.StateDiffsRequest) (iter.Seq[*spec.StateDiffsResponse], error) { - return requestAndReceiveStream[*spec.StateDiffsRequest, *spec.StateDiffsResponse](ctx, c.newStream, StateDiffPID(c.network), req, c.log) + return requestAndReceiveStream[*spec.StateDiffsRequest, *spec.StateDiffsResponse](ctx, c.newStream, StateDiffPID(), req, c.log) } //func (c *Client) RequestReceipts(ctx context.Context, req *spec.ReceiptsRequest) (iter.Seq[*spec.ReceiptsResponse], error) { @@ -128,5 +128,5 @@ func (c *Client) RequestStateDiffs(ctx context.Context, req *spec.StateDiffsRequ func (c *Client) RequestTransactions(ctx context.Context, req *spec.TransactionsRequest) (iter.Seq[*spec.TransactionsResponse], error) { return requestAndReceiveStream[*spec.TransactionsRequest, *spec.TransactionsResponse]( - ctx, c.newStream, TransactionsPID(c.network), req, c.log) + ctx, c.newStream, TransactionsPID(), req, c.log) } diff --git a/p2p/starknet/ids.go b/p2p/starknet/ids.go index abf17d3a72..d1b97b0ad2 100644 --- a/p2p/starknet/ids.go +++ b/p2p/starknet/ids.go @@ -1,35 +1,27 @@ package starknet import ( - "github.com/NethermindEth/juno/utils" "github.com/libp2p/go-libp2p/core/protocol" ) -// Todo: consider merging this with HeadersPID -func CurrentBlockHeaderPID(n *utils.Network) protocol.ID { - return n.ProtocolID() + "/current_header/0" -} +const Prefix = "/starknet" -func HeadersPID(n *utils.Network) protocol.ID { - return n.ProtocolID() + "/headers/0.1.0-rc.0" +func HeadersPID() protocol.ID { + return Prefix + "/headers/0.1.0-rc.0" } -func EventsPID(n *utils.Network) protocol.ID { - return n.ProtocolID() + "/events/0.1.0-rc.0" +func EventsPID() protocol.ID { + return Prefix + "/events/0.1.0-rc.0" } -//func ReceiptsPID(n *utils.Network) protocol.ID { -// return n.ProtocolID() + "/receipts/0.1.0-rc.0" -//} - -func TransactionsPID(n *utils.Network) protocol.ID { - return n.ProtocolID() + "/transactions/0.1.0-rc.0" +func TransactionsPID() protocol.ID { + return Prefix + "/transactions/0.1.0-rc.0" } -func ClassesPID(n *utils.Network) protocol.ID { - return n.ProtocolID() + "/classes/0.1.0-rc.0" +func ClassesPID() protocol.ID { + return Prefix + "/classes/0.1.0-rc.0" } -func StateDiffPID(n *utils.Network) protocol.ID { - return n.ProtocolID() + "/state_diffs/0.1.0-rc.0" +func StateDiffPID() protocol.ID { + return Prefix + "/state_diffs/0.1.0-rc.0" } diff --git a/p2p/sync.go b/p2p/sync.go index a774ddb16e..bf2ac17070 100644 --- a/p2p/sync.go +++ b/p2p/sync.go @@ -202,7 +202,7 @@ func (s *syncService) start(ctx context.Context) { } } -func specBlockPartsFunc[T specBlockHeaderAndSigs | specBlockBody | specTxWithReceipts | specReceipts | specEvents | specClasses | specContractDiffs](i T) specBlockParts { +func specBlockPartsFunc[T specBlockHeaderAndSigs | specTxWithReceipts | specReceipts | specEvents | specClasses | specContractDiffs](i T) specBlockParts { return specBlockParts(i) } @@ -241,10 +241,8 @@ func (s *syncService) processSpecBlockParts( defer close(orderedBlockBodiesCh) specBlockHeadersAndSigsM := make(map[uint64]specBlockHeaderAndSigs) - specBlockBodiesM := make(map[uint64]specBlockBody) specClassesM := make(map[uint64]specClasses) specTransactionsM := make(map[uint64]specTxWithReceipts) - // specReceiptsM := make(map[uint64]specReceipts) specEventsM := make(map[uint64]specEvents) specContractDiffsM := make(map[uint64]specContractDiffs) @@ -259,11 +257,6 @@ func (s *syncService) processSpecBlockParts( if _, ok := specBlockHeadersAndSigsM[part.blockNumber()]; !ok { specBlockHeadersAndSigsM[part.blockNumber()] = p } - case specBlockBody: - s.log.Debugw("Received Block Body parts", "blockNumber", p.id.Number) - if _, ok := specBlockBodiesM[part.blockNumber()]; !ok { - specBlockBodiesM[part.blockNumber()] = p - } case specTxWithReceipts: s.log.Debugw("Received Transactions", "blockNumber", p.blockNumber()) if _, ok := specTransactionsM[part.blockNumber()]; !ok { @@ -289,9 +282,7 @@ func (s *syncService) processSpecBlockParts( } headerAndSig, okHeader := specBlockHeadersAndSigsM[curBlockNum] - // body, ok2 := specBlockBodiesM[curBlockNum] txs, okTxs := specTransactionsM[curBlockNum] - // rs, ok4 := specReceiptsM[curBlockNum] es, okEvents := specEventsM[curBlockNum] cls, okClasses := specClassesM[curBlockNum] diffs, okDiffs := specContractDiffsM[curBlockNum] @@ -323,9 +314,7 @@ func (s *syncService) processSpecBlockParts( if curBlockNum > 0 { delete(specBlockHeadersAndSigsM, curBlockNum-1) } - delete(specBlockBodiesM, curBlockNum) delete(specTransactionsM, curBlockNum) - // delete(specReceiptsM, curBlockNum) delete(specEventsM, curBlockNum) curBlockNum++ } @@ -488,71 +477,6 @@ func (s *syncService) genHeadersAndSigs(ctx context.Context, blockNumber uint64) return headersAndSigCh, nil } -type specBlockBody struct { - id *spec.BlockID - // proof *spec.BlockProof - classes []*spec.Class - stateDiff []*spec.ContractDiff -} - -func (s specBlockBody) blockNumber() uint64 { - return s.id.Number -} - -/* -func (s *syncService) genBlockBodies(ctx context.Context, it *spec.Iteration) (<-chan specBlockBody, error) { - blockIt, err := s.client.RequestBlockBodies(ctx, &spec.BlockBodiesRequest{Iteration: it}) - if err != nil { - return nil, err - } - - specBodiesCh := make(chan specBlockBody) - go func() { - defer close(specBodiesCh) - curBlockBody := new(specBlockBody) - // Assumes that all parts of the same block will arrive before the next block parts - // Todo: the above assumption may not be true. A peer may decide to send different parts of the block in different order - // If the above assumption is not true we should return separate channels for each of the parts. Also, see todo above specBlockBody - // on line 317 in p2p/sync.go - - blockIt(func(res *spec.BlockBodiesResponse) bool { - switch res.BodyMessage.(type) { - case *spec.BlockBodiesResponse_Classes: - if curBlockBody.id == nil { - curBlockBody.id = res.GetId() - } - curBlockBody.classes = res.GetClasses() - case *spec.BlockBodiesResponse_Diff: - if curBlockBody.id == nil { - curBlockBody.id = res.GetId() - } - curBlockBody.stateDiff = res.GetDiff() - case *spec.BlockBodiesResponse_Proof: - if curBlockBody.id == nil { - curBlockBody.id = res.GetId() - } - curBlockBody.proof = res.GetProof() - case *spec.BlockBodiesResponse_Fin: - if curBlockBody.id != nil { - select { - case <-ctx.Done(): - return false - default: - specBodiesCh <- *curBlockBody - curBlockBody = new(specBlockBody) - } - } - } - - return true - }) - }() - - return specBodiesCh, nil -} - -*/ - type specReceipts struct { number uint64 receipts []*spec.Receipt diff --git a/utils/network.go b/utils/network.go index 5bea3c8c77..843f29349c 100644 --- a/utils/network.go +++ b/utils/network.go @@ -8,7 +8,6 @@ import ( "github.com/NethermindEth/juno/core/felt" "github.com/ethereum/go-ethereum/common" - "github.com/libp2p/go-libp2p/core/protocol" "github.com/spf13/pflag" ) @@ -193,10 +192,6 @@ func (n *Network) L2ChainIDFelt() *felt.Felt { return new(felt.Felt).SetBytes([]byte(n.L2ChainID)) } -func (n *Network) ProtocolID() protocol.ID { - return "/starknet" // n.String() -} - func knownNetworkNames() []string { networks := []Network{Mainnet, Sepolia, SepoliaIntegration} From a856d29ecce18514cf8aecd78c6bcfd152ebccc6 Mon Sep 17 00:00:00 2001 From: Kirill Date: Fri, 31 May 2024 21:21:59 +0400 Subject: [PATCH 11/18] Add spec.StateDiffsResponse_DeclaredClass message --- p2p/starknet/handlers.go | 21 +++++++++++++++++++++ 1 file changed, 21 insertions(+) diff --git a/p2p/starknet/handlers.go b/p2p/starknet/handlers.go index 886810cab9..6abbaedf02 100644 --- a/p2p/starknet/handlers.go +++ b/p2p/starknet/handlers.go @@ -392,6 +392,27 @@ func (h *Handler) onStateDiffRequest(req *spec.StateDiffsRequest) (iter.Seq[prot }) } + for _, classHash := range diff.DeclaredV0Classes { + responses = append(responses, &spec.StateDiffsResponse{ + StateDiffMessage: &spec.StateDiffsResponse_DeclaredClass{ + DeclaredClass: &spec.DeclaredClass{ + ClassHash: core2p2p.AdaptHash(classHash), + CompiledClassHash: nil, // for cairo0 it's nil + }, + }, + }) + } + for classHash, compiledHash := range diff.DeclaredV1Classes { + responses = append(responses, &spec.StateDiffsResponse{ + StateDiffMessage: &spec.StateDiffsResponse_DeclaredClass{ + DeclaredClass: &spec.DeclaredClass{ + ClassHash: core2p2p.AdaptHash(&classHash), + CompiledClassHash: core2p2p.AdaptHash(compiledHash), + }, + }, + }) + } + return responses, nil }) } From 0d4e20fdc538a0f107c66fcb55dcdb083dd9f835 Mon Sep 17 00:00:00 2001 From: Kirill Date: Mon, 3 Jun 2024 22:54:33 +0400 Subject: [PATCH 12/18] Remove debugging print & unused code, fix replaced classes. --- Makefile | 1 - adapters/core2p2p/state.go | 2 +- adapters/p2p2core/state.go | 16 ++++++++++++++-- p2p/starknet/block_bodies.go | 1 - p2p/starknet/handlers.go | 27 +-------------------------- p2p/sync.go | 10 ++++++++-- 6 files changed, 24 insertions(+), 33 deletions(-) diff --git a/Makefile b/Makefile index 30aa827d07..e2bae30eec 100644 --- a/Makefile +++ b/Makefile @@ -135,7 +135,6 @@ node3: --metrics-port=9093 pathfinder: juno-cached - rm -rf ./p2p-dbs/node-pathfinder/ && \ ./build/juno \ --network=sepolia \ --log-level=debug \ diff --git a/adapters/core2p2p/state.go b/adapters/core2p2p/state.go index 1b53db6a9c..ef4d023541 100644 --- a/adapters/core2p2p/state.go +++ b/adapters/core2p2p/state.go @@ -6,7 +6,7 @@ import ( "github.com/NethermindEth/juno/utils" ) -func AdaptContractDiff(addr, nonce, classHash *felt.Felt, replaced *bool, storageDiff map[felt.Felt]*felt.Felt) *spec.ContractDiff { +func AdaptContractDiff(addr, nonce, classHash *felt.Felt, storageDiff map[felt.Felt]*felt.Felt) *spec.ContractDiff { return &spec.ContractDiff{ Address: AdaptAddress(addr), Nonce: AdaptFelt(nonce), diff --git a/adapters/p2p2core/state.go b/adapters/p2p2core/state.go index c2310eec6a..40369451c4 100644 --- a/adapters/p2p2core/state.go +++ b/adapters/p2p2core/state.go @@ -1,15 +1,18 @@ package p2p2core import ( + "errors" "fmt" + "github.com/NethermindEth/juno/db" + "github.com/NethermindEth/juno/core" "github.com/NethermindEth/juno/core/felt" "github.com/NethermindEth/juno/p2p/starknet/spec" "github.com/NethermindEth/juno/utils" ) -func AdaptStateDiff(contractDiffs []*spec.ContractDiff, classes []*spec.Class) *core.StateDiff { +func AdaptStateDiff(reader core.StateReader, contractDiffs []*spec.ContractDiff, classes []*spec.Class) *core.StateDiff { var ( declaredV0Classes []*felt.Felt declaredV1Classes = make(map[felt.Felt]*felt.Felt) @@ -48,7 +51,16 @@ func AdaptStateDiff(contractDiffs []*spec.ContractDiff, classes []*spec.Class) * classHash: diff.ClassHash, } - if false { + stateClassHash, err := reader.ContractClassHash(address) + if err != nil { + if errors.Is(err, db.ErrKeyNotFound) { + stateClassHash = &felt.Zero + } else { + panic(err) + } + } + + if !stateClassHash.IsZero() { replacedClasses = append(replacedClasses, addrToClsHash) } else { deployedContracts = append(deployedContracts, addrToClsHash) diff --git a/p2p/starknet/block_bodies.go b/p2p/starknet/block_bodies.go index 77a1c57582..6e7a698593 100644 --- a/p2p/starknet/block_bodies.go +++ b/p2p/starknet/block_bodies.go @@ -132,7 +132,6 @@ type contractDiff struct { storageDiffs map[felt.Felt]*felt.Felt nonce *felt.Felt classHash *felt.Felt // set only if contract deployed or replaced - replaced *bool // set only if contract deployed or replaced } func (b *blockBodyIterator) diff() (proto.Message, bool) { diff --git a/p2p/starknet/handlers.go b/p2p/starknet/handlers.go index 6abbaedf02..54f73c67c4 100644 --- a/p2p/starknet/handlers.go +++ b/p2p/starknet/handlers.go @@ -256,29 +256,6 @@ func (h *Handler) onEventsRequest(req *spec.EventsRequest) (iter.Seq[proto.Messa }) } -/* -func (h *Handler) onReceiptsRequest(req *spec.ReceiptsRequest) (iter.Seq[proto.Message], error) { - finMsg := &spec.ReceiptsResponse{ReceiptMessage: &spec.ReceiptsResponse_Fin{}} - return h.processIterationRequestMulti(req.Iteration, finMsg, func(it blockDataAccessor) ([]proto.Message, error) { - block, err := it.Block() - if err != nil { - return nil, err - } - - responses := make([]proto.Message, len(block.Receipts)) - for i, receipt := range block.Receipts { - responses[i] = &spec.ReceiptsResponse{ - ReceiptMessage: &spec.ReceiptsResponse_Receipt{ - Receipt: core2p2p.AdaptReceipt(receipt, block.Transactions[i]), - }, - } - } - - return responses, nil - }) -} -*/ - func (h *Handler) onTransactionsRequest(req *spec.TransactionsRequest) (iter.Seq[proto.Message], error) { finMsg := &spec.TransactionsResponse{ TransactionMessage: &spec.TransactionsResponse_Fin{}, @@ -365,7 +342,6 @@ func (h *Handler) onStateDiffRequest(req *spec.StateDiffsRequest) (iter.Seq[prot classHashCopy := classHash err = updateModifiedContracts(addr, func(diff *contractDiff) { diff.classHash = classHashCopy - diff.replaced = utils.Ptr(false) }) if err != nil { return nil, err @@ -376,7 +352,6 @@ func (h *Handler) onStateDiffRequest(req *spec.StateDiffsRequest) (iter.Seq[prot classHashCopy := classHash err = updateModifiedContracts(addr, func(diff *contractDiff) { diff.classHash = classHashCopy - diff.replaced = utils.Ptr(true) }) if err != nil { return nil, err @@ -387,7 +362,7 @@ func (h *Handler) onStateDiffRequest(req *spec.StateDiffsRequest) (iter.Seq[prot for _, c := range modifiedContracts { responses = append(responses, &spec.StateDiffsResponse{ StateDiffMessage: &spec.StateDiffsResponse_ContractDiff{ - ContractDiff: core2p2p.AdaptContractDiff(c.address, c.nonce, c.classHash, c.replaced, c.storageDiffs), + ContractDiff: core2p2p.AdaptContractDiff(c.address, c.nonce, c.classHash, c.storageDiffs), }, }) } diff --git a/p2p/sync.go b/p2p/sync.go index bf2ac17070..75ac655e8a 100644 --- a/p2p/sync.go +++ b/p2p/sync.go @@ -406,11 +406,18 @@ func (s *syncService) adaptAndSanityCheckBlock(ctx context.Context, header *spec // Update but there is no such message in P2P. spew.Dump("Classes", coreBlock.Number, len(classes)) + + stateReader, stateCloser, err := s.blockchain.StateAtBlockNumber(coreBlock.Number - 1) + if err != nil { + panic(err) + } + defer stateCloser() + stateUpdate := &core.StateUpdate{ BlockHash: coreBlock.Hash, NewRoot: coreBlock.GlobalStateRoot, OldRoot: prevBlockRoot, - StateDiff: p2p2core.AdaptStateDiff(contractDiffs, classes), + StateDiff: p2p2core.AdaptStateDiff(stateReader, contractDiffs, classes), } commitments, err := s.blockchain.SanityCheckNewHeight(coreBlock, stateUpdate, newClasses) @@ -643,7 +650,6 @@ func (s *syncService) genEvents(ctx context.Context, blockNumber uint64) (<-chan var events []*spec.Event eventsIt(func(res *spec.EventsResponse) bool { - fmt.Println("EVENT ITERATION", res.EventMessage) switch v := res.EventMessage.(type) { case *spec.EventsResponse_Event: events = append(events, v.Event) From 1ddbb84ccd74e6237daa0b1bf3d0f0941c39e93a Mon Sep 17 00:00:00 2001 From: Kirill Date: Tue, 4 Jun 2024 22:48:48 +0400 Subject: [PATCH 13/18] Latest fixes --- blockchain/blockchain.go | 2 +- core/block.go | 30 +++++++++++++++--------------- p2p/starknet/client.go | 13 +++++++++++-- p2p/sync.go | 31 ++++++++++++++++++++----------- 4 files changed, 47 insertions(+), 29 deletions(-) diff --git a/blockchain/blockchain.go b/blockchain/blockchain.go index d4b7dd1c34..a577d469a1 100644 --- a/blockchain/blockchain.go +++ b/blockchain/blockchain.go @@ -342,7 +342,7 @@ func (b *Blockchain) Store(block *core.Block, blockCommitments *core.BlockCommit if err := verifyBlock(txn, block); err != nil { return err } - spew.Dump("DUMP", block.Number, stateUpdate) + // spew.Dump("DUMP", block.Number, stateUpdate) if err := core.NewState(txn).Update(block.Number, stateUpdate, newClasses); err != nil { return err } diff --git a/core/block.go b/core/block.go index 42112268e5..01f60fa4c6 100644 --- a/core/block.go +++ b/core/block.go @@ -5,8 +5,6 @@ import ( "errors" "fmt" - "github.com/davecgh/go-spew/spew" - "github.com/NethermindEth/juno/core/crypto" "github.com/NethermindEth/juno/core/felt" "github.com/NethermindEth/juno/utils" @@ -195,19 +193,21 @@ func post07Hash(b *Block, overrideSeqAddr *felt.Felt) (*felt.Felt, *BlockCommitm return nil, nil, eErr } - spew.Dump("HASH VALUES:", - b.Number, // block number - b.GlobalStateRoot, // global state root - seqAddr, // sequencer address - b.Timestamp, // block timestamp - b.TransactionCount, // number of transactions - txCommitment, // transaction commitment - b.EventCount, // number of events - eCommitment, // event commitment - &felt.Zero, // reserved: protocol version - &felt.Zero, // reserved: extra data - b.ParentHash, // parent block hash - &BlockCommitments{TransactionCommitment: txCommitment, EventCommitment: eCommitment}) + /* + spew.Dump("HASH VALUES:", + b.Number, // block number + b.GlobalStateRoot, // global state root + seqAddr, // sequencer address + b.Timestamp, // block timestamp + b.TransactionCount, // number of transactions + txCommitment, // transaction commitment + b.EventCount, // number of events + eCommitment, // event commitment + &felt.Zero, // reserved: protocol version + &felt.Zero, // reserved: extra data + b.ParentHash, // parent block hash + &BlockCommitments{TransactionCommitment: txCommitment, EventCommitment: eCommitment}) + */ // Unlike the pre07Hash computation, we exclude the chain // id and replace the zero felt with the actual values for: // - sequencer address diff --git a/p2p/starknet/client.go b/p2p/starknet/client.go index f4cadbf011..72dd9815af 100644 --- a/p2p/starknet/client.go +++ b/p2p/starknet/client.go @@ -4,6 +4,7 @@ import ( "context" "errors" "io" + "time" "github.com/NethermindEth/juno/p2p/starknet/spec" "github.com/NethermindEth/juno/utils" @@ -14,7 +15,10 @@ import ( "google.golang.org/protobuf/proto" ) -const unmarshalMaxSize = 15 * utils.Megabyte +const ( + unmarshalMaxSize = 15 * utils.Megabyte + readTimeout = 5 * time.Second +) type NewStreamFunc func(ctx context.Context, pids ...protocol.ID) (network.Stream, error) @@ -59,6 +63,11 @@ func requestAndReceiveStream[ReqT proto.Message, ResT proto.Message](ctx context return nil, err } + err = stream.SetReadDeadline(time.Now().Add(readTimeout)) + if err != nil { + return nil, err + } + id := stream.ID() if err := sendAndCloseWrite(stream, req); err != nil { log.Errorw("sendAndCloseWrite (stream is not closed)", "err", err, "streamID", id) @@ -77,7 +86,7 @@ func requestAndReceiveStream[ReqT proto.Message, ResT proto.Message](ctx context var zero ResT res := zero.ProtoReflect().New().Interface() if err := receiveInto(stream, res); err != nil { - if true || !errors.Is(err, io.EOF) { + if !errors.Is(err, io.EOF) { log.Debugw("Error while reading from stream", "err", err) } diff --git a/p2p/sync.go b/p2p/sync.go index 75ac655e8a..a140aad3e4 100644 --- a/p2p/sync.go +++ b/p2p/sync.go @@ -194,8 +194,8 @@ func (s *syncService) start(ctx context.Context) { break } - s.log.Infow("Stored Block", "number", b.block.Number, "hash", b.block.Hash.ShortString(), "root", - b.block.GlobalStateRoot.ShortString()) + s.log.Infow("Stored Block", "number", b.block.Number, "hash", b.block.Hash.ShortString(), + "root", b.block.GlobalStateRoot.ShortString()) s.listener.OnSyncStepDone(junoSync.OpStore, b.block.Number, time.Since(storeTimer)) } cancelIteration() @@ -253,12 +253,12 @@ func (s *syncService) processSpecBlockParts( default: switch p := part.(type) { case specBlockHeaderAndSigs: - s.log.Debugw("Received Block Header and Signatures", "blockNumber", p.blockNumber()) + s.log.Debugw("Received Block Header with signatures", "blockNumber", p.blockNumber()) if _, ok := specBlockHeadersAndSigsM[part.blockNumber()]; !ok { specBlockHeadersAndSigsM[part.blockNumber()] = p } case specTxWithReceipts: - s.log.Debugw("Received Transactions", "blockNumber", p.blockNumber()) + s.log.Debugw("Received Transactions with receipts", "blockNumber", p.blockNumber(), "txLen", len(p.txs)) if _, ok := specTransactionsM[part.blockNumber()]; !ok { specTransactionsM[part.blockNumber()] = p } @@ -370,12 +370,24 @@ func (s *syncService) adaptAndSanityCheckBlock(ctx context.Context, header *spec coreBlock.EventsBloom = core.EventsBloom(coreBlock.Receipts) if int(coreBlock.TransactionCount) != len(coreBlock.Transactions) { - spew.Dump("Number of transactions != count", coreBlock) - os.Exit(1) + s.log.Errorw( + "Number of transactions != count", + "transactionCount", + coreBlock.TransactionCount, + "len(transactions)", + len(coreBlock.Transactions), + ) + return } if int(coreBlock.EventCount) != len(events) { - spew.Dump("Number of events != count", coreBlock, events) - os.Exit(1) + s.log.Errorw( + "Number of events != count", + "eventCount", + coreBlock.EventCount, + "len(events)", + len(events), + ) + return } h, err := core.BlockHash(coreBlock) @@ -405,8 +417,6 @@ func (s *syncService) adaptAndSanityCheckBlock(ctx context.Context, header *spec // Note: Parts of the State Update are created from Blockchain object as the Store and SanityCheck functions require a State // Update but there is no such message in P2P. - spew.Dump("Classes", coreBlock.Number, len(classes)) - stateReader, stateCloser, err := s.blockchain.StateAtBlockNumber(coreBlock.Number - 1) if err != nil { panic(err) @@ -668,7 +678,6 @@ func (s *syncService) genEvents(ctx context.Context, blockNumber uint64) (<-chan number: blockNumber, events: events, }: - spew.Dump("Received events from client", len(events), blockNumber) } }() return eventsCh, nil From 7fb2340c566656cf6b2df5e027dcf7180cfd8d16 Mon Sep 17 00:00:00 2001 From: Kirill Date: Wed, 5 Jun 2024 15:38:20 +0400 Subject: [PATCH 14/18] Fix linter issues --- adapters/core2p2p/transaction.go | 3 +- adapters/p2p2core/block.go | 37 +++-- adapters/p2p2core/class.go | 8 +- adapters/p2p2core/state.go | 3 +- adapters/p2p2core/transaction.go | 20 +-- blockchain/blockchain.go | 4 +- core/block.go | 15 -- core/state.go | 2 - core/transaction.go | 25 +--- node/node.go | 2 +- p2p/p2p.go | 4 - p2p/starknet/block_bodies.go | 236 ------------------------------- p2p/starknet/client.go | 16 --- p2p/starknet/handlers.go | 46 ++---- p2p/sync.go | 136 ++---------------- 15 files changed, 76 insertions(+), 481 deletions(-) delete mode 100644 p2p/starknet/block_bodies.go diff --git a/adapters/core2p2p/transaction.go b/adapters/core2p2p/transaction.go index 762c3a0972..d8ce842e3e 100644 --- a/adapters/core2p2p/transaction.go +++ b/adapters/core2p2p/transaction.go @@ -3,11 +3,10 @@ package core2p2p import ( "fmt" - "github.com/NethermindEth/juno/utils" - "github.com/NethermindEth/juno/core" "github.com/NethermindEth/juno/core/felt" "github.com/NethermindEth/juno/p2p/starknet/spec" + "github.com/NethermindEth/juno/utils" ) //nolint:funlen,gocyclo diff --git a/adapters/p2p2core/block.go b/adapters/p2p2core/block.go index 2cb58ad049..4b54d12f9a 100644 --- a/adapters/p2p2core/block.go +++ b/adapters/p2p2core/block.go @@ -1,10 +1,13 @@ package p2p2core import ( + "fmt" + "github.com/NethermindEth/juno/core" "github.com/NethermindEth/juno/core/felt" "github.com/NethermindEth/juno/p2p/starknet/spec" "github.com/NethermindEth/juno/utils" + "github.com/bits-and-blooms/bloom/v3" ) func AdaptEvent(e *spec.Event) *core.Event { @@ -19,13 +22,9 @@ func AdaptEvent(e *spec.Event) *core.Event { } } -func AdaptSignature(cs *spec.ConsensusSignature) []*felt.Felt { - return []*felt.Felt{AdaptFelt(cs.R), AdaptFelt(cs.S)} -} - -func AdaptBlockHeader(h *spec.SignedBlockHeader) core.Header { - return core.Header{ - Hash: AdaptHash(h.BlockHash), // todo: add this when building the block +func AdaptBlockHeader(h *spec.SignedBlockHeader, eventsBloom *bloom.BloomFilter) *core.Header { + return &core.Header{ + Hash: AdaptHash(h.BlockHash), ParentHash: AdaptHash(h.ParentHash), Number: h.Number, GlobalStateRoot: AdaptHash(h.StateRoot), @@ -34,10 +33,30 @@ func AdaptBlockHeader(h *spec.SignedBlockHeader) core.Header { EventCount: h.Events.NLeaves, Timestamp: h.Time, ProtocolVersion: h.ProtocolVersion, - EventsBloom: nil, // Todo: add this in when building the block + EventsBloom: eventsBloom, + Signatures: utils.Map(h.Signatures, adaptSignature), + L1DAMode: adaptDA(h.L1DataAvailabilityMode), + L1DataGasPrice: &core.GasPrice{ + PriceInWei: AdaptUint128(h.DataGasPriceWei), + PriceInFri: AdaptUint128(h.DataGasPriceFri), + }, // todo(kirill) check prices GasPrice: AdaptUint128(h.GasPriceWei), GasPriceSTRK: AdaptUint128(h.GasPriceFri), - Signatures: utils.Map(h.Signatures, AdaptSignature), + } +} + +func adaptSignature(cs *spec.ConsensusSignature) []*felt.Felt { + return []*felt.Felt{AdaptFelt(cs.R), AdaptFelt(cs.S)} +} + +func adaptDA(da spec.L1DataAvailabilityMode) core.L1DAMode { + switch da { + case spec.L1DataAvailabilityMode_Calldata: + return core.Calldata + case spec.L1DataAvailabilityMode_Blob: + return core.Blob + default: + panic(fmt.Errorf("unsupported DA mode %v", da)) } } diff --git a/adapters/p2p2core/class.go b/adapters/p2p2core/class.go index 2129df8ae7..1c5f72fdab 100644 --- a/adapters/p2p2core/class.go +++ b/adapters/p2p2core/class.go @@ -5,13 +5,11 @@ import ( "fmt" "github.com/NethermindEth/juno/adapters/sn2core" - - "github.com/NethermindEth/juno/core/felt" - "github.com/NethermindEth/juno/starknet" - "github.com/NethermindEth/juno/core" "github.com/NethermindEth/juno/core/crypto" + "github.com/NethermindEth/juno/core/felt" "github.com/NethermindEth/juno/p2p/starknet/spec" + "github.com/NethermindEth/juno/starknet" "github.com/NethermindEth/juno/utils" ) @@ -28,7 +26,7 @@ func AdaptClass(class *spec.Class) core.Class { Externals: utils.Map(cairo0.Externals, adaptEntryPoint), L1Handlers: utils.Map(cairo0.L1Handlers, adaptEntryPoint), Constructors: utils.Map(cairo0.Constructors, adaptEntryPoint), - Program: string(cairo0.Program), + Program: cairo0.Program, } case *spec.Class_Cairo1: cairo1 := cls.Cairo1 diff --git a/adapters/p2p2core/state.go b/adapters/p2p2core/state.go index 40369451c4..586b38f619 100644 --- a/adapters/p2p2core/state.go +++ b/adapters/p2p2core/state.go @@ -4,10 +4,9 @@ import ( "errors" "fmt" - "github.com/NethermindEth/juno/db" - "github.com/NethermindEth/juno/core" "github.com/NethermindEth/juno/core/felt" + "github.com/NethermindEth/juno/db" "github.com/NethermindEth/juno/p2p/starknet/spec" "github.com/NethermindEth/juno/utils" ) diff --git a/adapters/p2p2core/transaction.go b/adapters/p2p2core/transaction.go index e289ee0ce7..7abd23cc26 100644 --- a/adapters/p2p2core/transaction.go +++ b/adapters/p2p2core/transaction.go @@ -108,10 +108,10 @@ func AdaptTransaction(t *spec.Transaction, network *utils.Network) core.Transact } declareTx := &core.DeclareTransaction{ - TransactionHash: nil, // overridden below - ClassHash: AdaptHash(tx.ClassHash), - SenderAddress: AdaptAddress(tx.Sender), - // MaxFee: AdaptFelt(tx.MaxFee), todo either remove or add support for max_fee + TransactionHash: nil, // overridden below + ClassHash: AdaptHash(tx.ClassHash), + SenderAddress: AdaptAddress(tx.Sender), + MaxFee: nil, // in 3 version this field was removed TransactionSignature: adaptAccountSignature(tx.Signature), Nonce: AdaptFelt(tx.Nonce), Version: txVersion(3), @@ -279,12 +279,12 @@ func AdaptTransaction(t *spec.Transaction, network *utils.Network) core.Transact ContractAddress: nil, // todo call core.ContractAddress() ? CallData: utils.Map(tx.Calldata, AdaptFelt), TransactionSignature: adaptAccountSignature(tx.Signature), - // MaxFee: AdaptFelt(tx.MaxFee), todo support max_fee? - Version: txVersion(3), - Nonce: AdaptFelt(tx.Nonce), - SenderAddress: AdaptAddress(tx.Sender), - EntryPointSelector: nil, - Tip: tx.Tip, + MaxFee: nil, // in 3 version this field was removed + Version: txVersion(3), + Nonce: AdaptFelt(tx.Nonce), + SenderAddress: AdaptAddress(tx.Sender), + EntryPointSelector: nil, + Tip: tx.Tip, ResourceBounds: map[core.Resource]core.ResourceBounds{ core.ResourceL1Gas: adaptResourceLimits(tx.ResourceBounds.L1Gas), core.ResourceL2Gas: adaptResourceLimits(tx.ResourceBounds.L2Gas), diff --git a/blockchain/blockchain.go b/blockchain/blockchain.go index a577d469a1..a3f05aeeef 100644 --- a/blockchain/blockchain.go +++ b/blockchain/blockchain.go @@ -8,14 +8,13 @@ import ( "sync/atomic" "time" - "github.com/davecgh/go-spew/spew" - "github.com/Masterminds/semver/v3" "github.com/NethermindEth/juno/core" "github.com/NethermindEth/juno/core/felt" "github.com/NethermindEth/juno/db" "github.com/NethermindEth/juno/encoder" "github.com/NethermindEth/juno/utils" + "github.com/davecgh/go-spew/spew" ) //go:generate mockgen -destination=../mocks/mock_blockchain.go -package=mocks github.com/NethermindEth/juno/blockchain Reader @@ -342,7 +341,6 @@ func (b *Blockchain) Store(block *core.Block, blockCommitments *core.BlockCommit if err := verifyBlock(txn, block); err != nil { return err } - // spew.Dump("DUMP", block.Number, stateUpdate) if err := core.NewState(txn).Update(block.Number, stateUpdate, newClasses); err != nil { return err } diff --git a/core/block.go b/core/block.go index 01f60fa4c6..8c51bdfaf1 100644 --- a/core/block.go +++ b/core/block.go @@ -193,21 +193,6 @@ func post07Hash(b *Block, overrideSeqAddr *felt.Felt) (*felt.Felt, *BlockCommitm return nil, nil, eErr } - /* - spew.Dump("HASH VALUES:", - b.Number, // block number - b.GlobalStateRoot, // global state root - seqAddr, // sequencer address - b.Timestamp, // block timestamp - b.TransactionCount, // number of transactions - txCommitment, // transaction commitment - b.EventCount, // number of events - eCommitment, // event commitment - &felt.Zero, // reserved: protocol version - &felt.Zero, // reserved: extra data - b.ParentHash, // parent block hash - &BlockCommitments{TransactionCommitment: txCommitment, EventCommitment: eCommitment}) - */ // Unlike the pre07Hash computation, we exclude the chain // id and replace the zero felt with the actual values for: // - sequencer address diff --git a/core/state.go b/core/state.go index f45d82df95..1a569b9f8b 100644 --- a/core/state.go +++ b/core/state.go @@ -202,8 +202,6 @@ func (s *State) Update(blockNumber uint64, update *StateUpdate, declaredClasses return fmt.Errorf("beginning: %w", err) } - // spew.Dump(blockNumber, update.StateDiff) - // register declared classes mentioned in stateDiff.deployedContracts and stateDiff.declaredClasses for cHash, class := range declaredClasses { if err = s.putClass(&cHash, class, blockNumber); err != nil { diff --git a/core/transaction.go b/core/transaction.go index dbbbf6e6c3..ac0b8cdffb 100644 --- a/core/transaction.go +++ b/core/transaction.go @@ -263,6 +263,7 @@ type InvokeTransaction struct { // Additional information given by the sender, used to validate the transaction. TransactionSignature []*felt.Felt // The maximum fee that the sender is willing to pay for the transaction + // Available in version 1 only MaxFee *felt.Felt // The address of the contract invoked by this transaction. ContractAddress *felt.Felt @@ -313,6 +314,7 @@ type DeclareTransaction struct { // The address of the account initiating the transaction. SenderAddress *felt.Felt // The maximum fee that the sender is willing to pay for the transaction. + // Available in versions 1, 2 MaxFee *felt.Felt // Additional information given by the sender, used to validate the transaction. TransactionSignature []*felt.Felt @@ -411,9 +413,10 @@ func TransactionHash(transaction Transaction, n *utils.Network) (*felt.Felt, err case *InvokeTransaction: return invokeTransactionHash(t, n) case *DeployTransaction: + // it's not always correct assumption because p2p peers do not provide this field + // so essentially we might return nil field for non-sepolia network and p2p sync // deploy transactions are deprecated after re-genesis therefore we don't verify // transaction hash - return deployTransactionHash(t, n) return t.TransactionHash, nil case *L1HandlerTransaction: return l1HandlerTransactionHash(t, n) @@ -424,26 +427,6 @@ func TransactionHash(transaction Transaction, n *utils.Network) (*felt.Felt, err } } -func deployTransactionHash(d *DeployTransaction, n *utils.Network) (*felt.Felt, error) { - snKeccakConstructor, err := crypto.StarknetKeccak([]byte("constructor")) - if err != nil { - return nil, err - } - if d.Version.Is(0) || d.Version.Is(1) { - return crypto.PedersenArray( - new(felt.Felt).SetBytes([]byte("deploy")), - d.Version.AsFelt(), - d.ContractAddress, - snKeccakConstructor, - crypto.PedersenArray(d.ConstructorCallData...), - new(felt.Felt), - n.L2ChainIDFelt(), - ), nil - } - - return nil, fmt.Errorf("Invalid deploy tx hash") -} - var ( invokeFelt = new(felt.Felt).SetBytes([]byte("invoke")) declareFelt = new(felt.Felt).SetBytes([]byte("declare")) diff --git a/node/node.go b/node/node.go index dbc3454adf..de880617cf 100644 --- a/node/node.go +++ b/node/node.go @@ -148,7 +148,7 @@ func New(cfg *Config, version string) (*Node, error) { //nolint:gocyclo,funlen var p2pService *p2p.Service if cfg.P2P { if cfg.Network != utils.Sepolia { - // return nil, fmt.Errorf("P2P can only be used for %v network. Provided network: %v", utils.Sepolia, cfg.Network) + return nil, fmt.Errorf("P2P can only be used for %v network. Provided network: %v", utils.Sepolia, cfg.Network) } log.Warnw("P2P features enabled. Please note P2P is in experimental stage") diff --git a/p2p/p2p.go b/p2p/p2p.go index c6f3934ffc..18bc8af761 100644 --- a/p2p/p2p.go +++ b/p2p/p2p.go @@ -221,10 +221,6 @@ func (s *Service) Run(ctx context.Context) error { func (s *Service) setProtocolHandlers() { s.SetProtocolHandler(starknet.HeadersPID(), s.handler.HeadersHandler) - // s.SetProtocolHandler(starknet.CurrentBlockHeaderPID(s.network), s.handler.CurrentBlockHeaderHandler) - // s.SetProtocolHandler(starknet.ReceiptsPID(s.network), s.handler.ReceiptsHandler) - // todo discuss protocol id (should it be included in HeadersPID) - // s.SetProtocolHandler(starknet.BlockBodiesPID(s.network), s.handler.BlockBodiesHandler) s.SetProtocolHandler(starknet.EventsPID(), s.handler.EventsHandler) s.SetProtocolHandler(starknet.TransactionsPID(), s.handler.TransactionsHandler) s.SetProtocolHandler(starknet.ClassesPID(), s.handler.ClassesHandler) diff --git a/p2p/starknet/block_bodies.go b/p2p/starknet/block_bodies.go deleted file mode 100644 index 6e7a698593..0000000000 --- a/p2p/starknet/block_bodies.go +++ /dev/null @@ -1,236 +0,0 @@ -package starknet - -import ( - "crypto/rand" - "slices" - - "github.com/NethermindEth/juno/adapters/core2p2p" - "github.com/NethermindEth/juno/blockchain" - "github.com/NethermindEth/juno/core" - "github.com/NethermindEth/juno/core/felt" - "github.com/NethermindEth/juno/p2p/starknet/spec" - "github.com/NethermindEth/juno/utils" - "google.golang.org/protobuf/proto" -) - -type blockBodyStep int - -const ( - _ blockBodyStep = iota - - sendDiff // initial - sendClasses - sendProof - sendBlockFin - terminal // final step -) - -type blockBodyIterator struct { - log utils.SimpleLogger - stateReader core.StateReader - stateCloser func() error - - step blockBodyStep - header *core.Header - - stateUpdate *core.StateUpdate -} - -func newBlockBodyIterator(bcReader blockchain.Reader, header *core.Header, log utils.SimpleLogger) (*blockBodyIterator, error) { - stateUpdate, err := bcReader.StateUpdateByNumber(header.Number) - if err != nil { - return nil, err - } - - stateReader, closer, err := bcReader.StateAtBlockNumber(header.Number) - if err != nil { - return nil, err - } - - return &blockBodyIterator{ - step: sendDiff, - header: header, - log: log, - stateReader: stateReader, - stateCloser: closer, - stateUpdate: stateUpdate, - }, nil -} - -func (b *blockBodyIterator) hasNext() bool { - return slices.Contains([]blockBodyStep{ - sendDiff, - sendClasses, - sendProof, - sendBlockFin, - }, b.step) -} - -// Either BlockBodiesResponse_Diff, *_Classes, *_Proof, *_Fin -func (b *blockBodyIterator) next() (msg proto.Message, valid bool) { - switch b.step { - case sendDiff: - msg, valid = b.diff() - b.step = sendClasses - case sendClasses: - msg, valid = b.classes() - b.step = sendProof - case sendProof: - msg, valid = b.proof() - b.step = sendBlockFin - case sendBlockFin: - // fin changes step to terminal internally - msg, valid = b.fin() - case terminal: - panic("next called on terminal step") - default: - b.log.Errorw("Unknown step in blockBodyIterator", "step", b.step) - } - - return -} - -func (b *blockBodyIterator) classes() (proto.Message, bool) { - var classes []*spec.Class - - stateDiff := b.stateUpdate.StateDiff - - for _, hash := range stateDiff.DeclaredV0Classes { - cls, err := b.stateReader.Class(hash) - if err != nil { - return b.fin() - } - - classes = append(classes, core2p2p.AdaptClass(cls.Class)) - } - for classHash := range stateDiff.DeclaredV1Classes { - cls, err := b.stateReader.Class(&classHash) - if err != nil { - return b.fin() - } - classes = append(classes, core2p2p.AdaptClass(cls.Class)) - } - - /* - res := &spec.BlockBodiesResponse{ - Id: b.blockID(), - BodyMessage: &spec.BlockBodiesResponse_Classes{ - Classes: &spec.Classes{ - Domain: 0, - Classes: classes, - }, - }, - } - - */ - - return nil, true -} - -type contractDiff struct { - address *felt.Felt - storageDiffs map[felt.Felt]*felt.Felt - nonce *felt.Felt - classHash *felt.Felt // set only if contract deployed or replaced -} - -func (b *blockBodyIterator) diff() (proto.Message, bool) { - var err error - diff := b.stateUpdate.StateDiff - - modifiedContracts := make(map[felt.Felt]*contractDiff) - - initContractDiff := func(addr *felt.Felt) *contractDiff { - return &contractDiff{address: addr} - } - updateModifiedContracts := func(addr felt.Felt, f func(*contractDiff)) error { - cDiff, ok := modifiedContracts[addr] - if !ok { - cDiff = initContractDiff(&addr) - if err != nil { - return err - } - modifiedContracts[addr] = cDiff - } - - f(cDiff) - return nil - } - - for addr, n := range diff.Nonces { - err = updateModifiedContracts(addr, func(diff *contractDiff) { - diff.nonce = n - }) - if err != nil { - b.log.Errorw("Failed to update modified contract", "err", err) - return b.fin() - } - } - - for addr, sDiff := range diff.StorageDiffs { - err = updateModifiedContracts(addr, func(diff *contractDiff) { - diff.storageDiffs = sDiff - }) - if err != nil { - b.log.Errorw("Failed to update modified contract", "err", err) - return b.fin() - } - } - - /* - var contractDiffs []*spec.StateDiff_ContractDiff - for _, c := range modifiedContracts { - contractDiffs = append(contractDiffs, core2p2p.AdaptContractDiff(c.address, c.nonce, c.storageDiffs)) - } - - return &spec.BlockBodiesResponse{ - Id: b.blockID(), - BodyMessage: &spec.BlockBodiesResponse_Diff{ - Diff: &spec.StateDiff{ - Domain: 0, - ContractDiffs: contractDiffs, - ReplacedClasses: utils.ToSlice(diff.ReplacedClasses, core2p2p.AdaptAddressClassHashPair), - DeployedContracts: utils.ToSlice(diff.DeployedContracts, core2p2p.AdaptAddressClassHashPair), - }, - }, - }, true - */ - - return nil, true -} - -func (b *blockBodyIterator) fin() (proto.Message, bool) { - b.step = terminal - if err := b.stateCloser(); err != nil { - b.log.Errorw("Call to state closer failed", "err", err) - } - //return &spec.BlockBodiesResponse{ - // Id: b.blockID(), - // BodyMessage: &spec.BlockBodiesResponse_Fin{}, - //}, true - return nil, true -} - -func (b *blockBodyIterator) proof() (proto.Message, bool) { - // proof size is currently 142K - proof := make([]byte, 142*1024) //nolint:gomnd - _, err := rand.Read(proof) - if err != nil { - b.log.Errorw("Failed to generate rand proof", "err", err) - return b.fin() - } - - //return &spec.BlockBodiesResponse{ - // Id: b.blockID(), - // BodyMessage: &spec.BlockBodiesResponse_Proof{ - // Proof: &spec.BlockProof{ - // Proof: proof, - // }, - // }, - //}, true - return nil, true -} - -func (b *blockBodyIterator) blockID() *spec.BlockID { - return core2p2p.AdaptBlockID(b.header) -} diff --git a/p2p/starknet/client.go b/p2p/starknet/client.go index 72dd9815af..e273b84f7c 100644 --- a/p2p/starknet/client.go +++ b/p2p/starknet/client.go @@ -100,13 +100,6 @@ func requestAndReceiveStream[ReqT proto.Message, ResT proto.Message](ctx context }, nil } -//func (c *Client) RequestCurrentBlockHeader( -// ctx context.Context, req *spec.CurrentBlockHeaderRequest, -//) (iter.Seq[*spec.BlockHeadersResponse], error) { -// return requestAndReceiveStream[*spec.CurrentBlockHeaderRequest, *spec.BlockHeadersResponse](ctx, c.newStream, -// CurrentBlockHeaderPID(c.network), req, c.log) -//} - func (c *Client) RequestBlockHeaders( ctx context.Context, req *spec.BlockHeadersRequest, ) (iter.Seq[*spec.BlockHeadersResponse], error) { @@ -114,11 +107,6 @@ func (c *Client) RequestBlockHeaders( ctx, c.newStream, HeadersPID(), req, c.log) } -//func (c *Client) RequestBlockBodies(ctx context.Context, req *spec.BlockBodiesRequest) (iter.Seq[*spec.BlockBodiesResponse], error) { -// return requestAndReceiveStream[*spec.BlockBodiesRequest, *spec.BlockBodiesResponse]( -// ctx, c.newStream, BlockBodiesPID(c.network), req, c.log) -//} - func (c *Client) RequestEvents(ctx context.Context, req *spec.EventsRequest) (iter.Seq[*spec.EventsResponse], error) { return requestAndReceiveStream[*spec.EventsRequest, *spec.EventsResponse](ctx, c.newStream, EventsPID(), req, c.log) } @@ -131,10 +119,6 @@ func (c *Client) RequestStateDiffs(ctx context.Context, req *spec.StateDiffsRequ return requestAndReceiveStream[*spec.StateDiffsRequest, *spec.StateDiffsResponse](ctx, c.newStream, StateDiffPID(), req, c.log) } -//func (c *Client) RequestReceipts(ctx context.Context, req *spec.ReceiptsRequest) (iter.Seq[*spec.ReceiptsResponse], error) { -// return requestAndReceiveStream[*spec.ReceiptsRequest, *spec.ReceiptsResponse](ctx, c.newStream, ReceiptsPID(c.network), req, c.log) -//} - func (c *Client) RequestTransactions(ctx context.Context, req *spec.TransactionsRequest) (iter.Seq[*spec.TransactionsResponse], error) { return requestAndReceiveStream[*spec.TransactionsRequest, *spec.TransactionsResponse]( ctx, c.newStream, TransactionsPID(), req, c.log) diff --git a/p2p/starknet/handlers.go b/p2p/starknet/handlers.go index 54f73c67c4..229d185dc8 100644 --- a/p2p/starknet/handlers.go +++ b/p2p/starknet/handlers.go @@ -7,12 +7,11 @@ import ( "fmt" "sync" - "github.com/NethermindEth/juno/core/felt" - "github.com/NethermindEth/juno/adapters/core2p2p" "github.com/NethermindEth/juno/adapters/p2p2core" "github.com/NethermindEth/juno/blockchain" "github.com/NethermindEth/juno/core" + "github.com/NethermindEth/juno/core/felt" "github.com/NethermindEth/juno/p2p/starknet/spec" "github.com/NethermindEth/juno/utils" "github.com/NethermindEth/juno/utils/iter" @@ -110,18 +109,10 @@ func (h *Handler) HeadersHandler(stream network.Stream) { streamHandler[*spec.BlockHeadersRequest](h.ctx, &h.wg, stream, h.onHeadersRequest, h.log) } -//func (h *Handler) BlockBodiesHandler(stream network.Stream) { -// streamHandler[*spec.BlockBodiesRequest](h.ctx, &h.wg, stream, h.onBlockBodiesRequest, h.log) -//} - func (h *Handler) EventsHandler(stream network.Stream) { streamHandler[*spec.EventsRequest](h.ctx, &h.wg, stream, h.onEventsRequest, h.log) } -//func (h *Handler) ReceiptsHandler(stream network.Stream) { -// streamHandler[*spec.ReceiptsRequest](h.ctx, &h.wg, stream, h.onReceiptsRequest, h.log) -//} - func (h *Handler) TransactionsHandler(stream network.Stream) { streamHandler[*spec.TransactionsRequest](h.ctx, &h.wg, stream, h.onTransactionsRequest, h.log) } @@ -134,28 +125,6 @@ func (h *Handler) StateDiffHandler(stream network.Stream) { streamHandler[*spec.StateDiffsRequest](h.ctx, &h.wg, stream, h.onStateDiffRequest, h.log) } -//func (h *Handler) CurrentBlockHeaderHandler(stream network.Stream) { -// streamHandler[*spec.CurrentBlockHeaderRequest](h.ctx, &h.wg, stream, h.onCurrentBlockHeaderRequest, h.log) -//} - -//func (h *Handler) onCurrentBlockHeaderRequest(*spec.CurrentBlockHeaderRequest) (iter.Seq[proto.Message], error) { -// curHeight, err := h.bcReader.Height() -// if err != nil { -// return nil, err -// } -// -// return h.onHeadersRequest(&spec.BlockHeadersRequest{ -// Iteration: &spec.Iteration{ -// Start: &spec.Iteration_BlockNumber{ -// BlockNumber: curHeight, -// }, -// Direction: spec.Iteration_Forward, -// Limit: 1, -// Step: 1, -// }, -// }) -//} - func (h *Handler) onHeadersRequest(req *spec.BlockHeadersRequest) (iter.Seq[proto.Message], error) { finMsg := &spec.BlockHeadersResponse{ HeaderMessage: &spec.BlockHeadersResponse_Fin{}, @@ -284,6 +253,7 @@ func (h *Handler) onTransactionsRequest(req *spec.TransactionsRequest) (iter.Seq }) } +//nolint:gocyclo func (h *Handler) onStateDiffRequest(req *spec.StateDiffsRequest) (iter.Seq[proto.Message], error) { finMsg := &spec.StateDiffsResponse{ StateDiffMessage: &spec.StateDiffsResponse_Fin{}, @@ -301,6 +271,12 @@ func (h *Handler) onStateDiffRequest(req *spec.StateDiffsRequest) (iter.Seq[prot } diff := stateUpdate.StateDiff + type contractDiff struct { + address *felt.Felt + storageDiffs map[felt.Felt]*felt.Felt + nonce *felt.Felt + classHash *felt.Felt // set only if contract deployed or replaced + } modifiedContracts := make(map[felt.Felt]*contractDiff) initContractDiff := func(addr *felt.Felt) *contractDiff { @@ -412,7 +388,11 @@ func (h *Handler) onClassesRequest(req *spec.ClassesRequest) (iter.Seq[proto.Mes if err != nil { return nil, err } - defer closer() + defer func() { + if closeErr := closer(); closeErr != nil { + h.log.Errorw("Failed to close state reader", "err", closeErr) + } + }() stateDiff := stateUpdate.StateDiff diff --git a/p2p/sync.go b/p2p/sync.go index a140aad3e4..8894abc872 100644 --- a/p2p/sync.go +++ b/p2p/sync.go @@ -4,14 +4,11 @@ import ( "context" "errors" "fmt" - "log" "math/rand" "os" "reflect" "time" - "github.com/davecgh/go-spew/spew" - "github.com/NethermindEth/juno/adapters/p2p2core" "github.com/NethermindEth/juno/blockchain" "github.com/NethermindEth/juno/core" @@ -22,6 +19,7 @@ import ( junoSync "github.com/NethermindEth/juno/sync" "github.com/NethermindEth/juno/utils" "github.com/NethermindEth/juno/utils/pipeline" + "github.com/davecgh/go-spew/spew" "github.com/libp2p/go-libp2p/core/host" "github.com/libp2p/go-libp2p/core/network" "github.com/libp2p/go-libp2p/core/peer" @@ -29,8 +27,6 @@ import ( "go.uber.org/zap" ) -const maxBlocks = 100 - type syncService struct { host host.Host network *utils.Network @@ -51,33 +47,7 @@ func newSyncService(bc *blockchain.Blockchain, h host.Host, n *utils.Network, lo } } -/* -func (s *syncService) randomNodeHeight(ctx context.Context) (int, error) { - headersIt, err := s.client.RequestCurrentBlockHeader(ctx, &spec.CurrentBlockHeaderRequest{}) - if err != nil { - return 0, err - } - - var header *spec.BlockHeader - headersIt(func(res *spec.BlockHeadersResponse) bool { - for _, part := range res.GetPart() { - if _, ok := part.HeaderMessage.(*spec.BlockHeadersResponsePart_Header); ok { - header = part.GetHeader() - // found header - time to stop iterator - return false - } - } - - return true - }) - - return int(header.Number), nil -} -*/ - -const retryDuration = 5 * time.Second - -//nolint:funlen,gocyclo +//nolint:funlen func (s *syncService) start(ctx context.Context) { ctx, cancel := context.WithCancel(ctx) defer cancel() @@ -89,44 +59,17 @@ func (s *syncService) start(ctx context.Context) { if err := ctx.Err(); err != nil { break } - s.log.Debugw("Continuous iteration", "i", i) iterCtx, cancelIteration := context.WithCancel(ctx) - /* - var err error - randHeight, err = s.randomNodeHeight(iterCtx) - if err != nil { - cancelIteration() - if errors.Is(err, errNoPeers) { - s.log.Infow("No peers available", "retrying in", retryDuration.String()) - s.sleep(retryDuration) - } else { - s.logError("Failed to get random node height", err) - } - continue - } - */ - var nextHeight int - if curHeight, err := s.blockchain.Height(); err == nil { //nolint:govet + if curHeight, err := s.blockchain.Height(); err == nil { nextHeight = int(curHeight) + 1 } else if !errors.Is(db.ErrKeyNotFound, err) { s.log.Errorw("Failed to get current height", "err", err) } - /* - blockBehind := randHeight - (nextHeight - 1) - if blockBehind <= 0 { - s.log.Infow("Random node height is the same or less as local height", " retrying in", retryDuration.String(), - "Random node height", randHeight, "Current height", nextHeight-1) - cancelIteration() - s.sleep(retryDuration) - continue - } - */ - s.log.Infow("Start Pipeline", "Random node height", randHeight, "Current height", nextHeight-1, "Start", nextHeight) // todo change iteration to fetch several objects uint64(min(blockBehind, maxBlocks)) @@ -185,10 +128,6 @@ func (s *syncService) start(ctx context.Context) { storeTimer := time.Now() err = s.blockchain.Store(b.block, b.commitments, b.stateUpdate, b.newClasses) if err != nil { - if err == blockchain.ErrParentDoesNotMatchHead { - spew.Dump(b.block.Number, b.block.Hash, b.block.ParentHash) - log.Fatal("Parent does NOT match head", err) - } s.log.Errorw("Failed to Store Block", "number", b.block.Number, "err", err) cancelIteration() break @@ -202,7 +141,7 @@ func (s *syncService) start(ctx context.Context) { } } -func specBlockPartsFunc[T specBlockHeaderAndSigs | specTxWithReceipts | specReceipts | specEvents | specClasses | specContractDiffs](i T) specBlockParts { +func specBlockPartsFunc[T specBlockHeaderAndSigs | specTxWithReceipts | specEvents | specClasses | specContractDiffs](i T) specBlockParts { return specBlockParts(i) } @@ -324,6 +263,7 @@ func (s *syncService) processSpecBlockParts( return orderedBlockBodiesCh } +//nolint:gocyclo,funlen func (s *syncService) adaptAndSanityCheckBlock(ctx context.Context, header *spec.SignedBlockHeader, contractDiffs []*spec.ContractDiff, classes []*spec.Class, txs []*spec.Transaction, receipts []*spec.Receipt, events []*spec.Event, prevBlockRoot *felt.Felt, ) <-chan blockBody { @@ -364,10 +304,8 @@ func (s *syncService) adaptAndSanityCheckBlock(ctx context.Context, header *spec }) coreBlock.Receipts = coreReceipts - coreHeader := p2p2core.AdaptBlockHeader(header) - - coreBlock.Header = &coreHeader - coreBlock.EventsBloom = core.EventsBloom(coreBlock.Receipts) + eventsBloom := core.EventsBloom(coreBlock.Receipts) + coreBlock.Header = p2p2core.AdaptBlockHeader(header, eventsBloom) if int(coreBlock.TransactionCount) != len(coreBlock.Transactions) { s.log.Errorw( @@ -419,9 +357,14 @@ func (s *syncService) adaptAndSanityCheckBlock(ctx context.Context, header *spec stateReader, stateCloser, err := s.blockchain.StateAtBlockNumber(coreBlock.Number - 1) if err != nil { + // todo(kirill) change to shutdown panic(err) } - defer stateCloser() + defer func() { + if closeErr := stateCloser(); closeErr != nil { + s.log.Errorw("Failed to close state reader", "err", closeErr) + } + }() stateUpdate := &core.StateUpdate{ BlockHash: coreBlock.Hash, @@ -494,56 +437,6 @@ func (s *syncService) genHeadersAndSigs(ctx context.Context, blockNumber uint64) return headersAndSigCh, nil } -type specReceipts struct { - number uint64 - receipts []*spec.Receipt -} - -func (s specReceipts) blockNumber() uint64 { - return s.number -} - -/* -//nolint:dupl -func (s *syncService) genReceipts(ctx context.Context, blockNumber uint64) (<-chan specReceipts, error) { - it := s.createIteratorForBlock(blockNumber) - receiptsIt, err := s.client.RequestReceipts(ctx, &spec.ReceiptsRequest{Iteration: it}) - if err != nil { - return nil, err - } - - receiptsCh := make(chan specReceipts) - go func() { - defer close(receiptsCh) - - var receipts []*spec.Receipt - receiptsIt(func(res *spec.ReceiptsResponse) bool { - switch v := res.ReceiptMessage.(type) { - case *spec.ReceiptsResponse_Receipt: - receipts = append(receipts, v.Receipt) - return true - case *spec.ReceiptsResponse_Fin: - return false - default: - s.log.Warnw("Unexpected ReceiptMessage from getReceipts", "v", res.ReceiptMessage) - return false - } - }) - - select { - case <-ctx.Done(): - return - case receiptsCh <- specReceipts{ - number: blockNumber, - receipts: receipts, - }: - } - }() - - return receiptsCh, nil -} -*/ - type specClasses struct { number uint64 classes []*spec.Class @@ -693,7 +586,6 @@ func (s specTxWithReceipts) blockNumber() uint64 { return s.number } -//nolint:dupl func (s *syncService) genTransactions(ctx context.Context, blockNumber uint64) (<-chan specTxWithReceipts, error) { it := s.createIteratorForBlock(blockNumber) txsIt, err := s.client.RequestTransactions(ctx, &spec.TransactionsRequest{Iteration: it}) @@ -763,7 +655,6 @@ var errNoPeers = errors.New("no peers available") func (s *syncService) randomPeerStream(ctx context.Context, pids ...protocol.ID) (network.Stream, error) { randPeer := s.randomPeer() if randPeer == "" { - panic(errNoPeers) return nil, errNoPeers } stream, err := s.host.NewStream(ctx, randPeer, pids...) @@ -793,6 +684,7 @@ func (s *syncService) WithListener(l junoSync.EventListener) { s.listener = l } +//nolint:unused func (s *syncService) sleep(d time.Duration) { s.log.Debugw("Sleeping...", "for", d) time.Sleep(d) From dff460e7d3af46b1f4176db3dca5b87eae449f5e Mon Sep 17 00:00:00 2001 From: Kirill Date: Wed, 5 Jun 2024 15:47:03 +0400 Subject: [PATCH 15/18] Cleanup code --- adapters/core2p2p/block.go | 1 - blockchain/blockchain.go | 2 -- core/state.go | 8 ++------ p2p/p2p_test.go | 2 +- p2p/starknet/buf.gen.yaml | 5 ----- 5 files changed, 3 insertions(+), 15 deletions(-) delete mode 100644 p2p/starknet/buf.gen.yaml diff --git a/adapters/core2p2p/block.go b/adapters/core2p2p/block.go index aff50b9558..ea290e8f04 100644 --- a/adapters/core2p2p/block.go +++ b/adapters/core2p2p/block.go @@ -28,7 +28,6 @@ func AdaptSignature(sig []*felt.Felt) *spec.ConsensusSignature { } func AdaptHeader(header *core.Header, commitments *core.BlockCommitments) *spec.SignedBlockHeader { - // todo revisit return &spec.SignedBlockHeader{ BlockHash: AdaptHash(header.Hash), ParentHash: AdaptHash(header.ParentHash), diff --git a/blockchain/blockchain.go b/blockchain/blockchain.go index a3f05aeeef..36d622991c 100644 --- a/blockchain/blockchain.go +++ b/blockchain/blockchain.go @@ -14,7 +14,6 @@ import ( "github.com/NethermindEth/juno/db" "github.com/NethermindEth/juno/encoder" "github.com/NethermindEth/juno/utils" - "github.com/davecgh/go-spew/spew" ) //go:generate mockgen -destination=../mocks/mock_blockchain.go -package=mocks github.com/NethermindEth/juno/blockchain Reader @@ -401,7 +400,6 @@ func verifyBlock(txn db.Transaction, block *core.Block) error { return fmt.Errorf("expected block #%d, got block #%d", expectedBlockNumber, block.Number) } if !block.ParentHash.Equal(expectedParentHash) { - spew.Dump("EXPECTATION FAIL", h.Number, h.Hash, h.ParentHash) return ErrParentDoesNotMatchHead } diff --git a/core/state.go b/core/state.go index 1a569b9f8b..97ea2163bf 100644 --- a/core/state.go +++ b/core/state.go @@ -199,7 +199,7 @@ func (s *State) verifyStateUpdateRoot(root *felt.Felt) error { func (s *State) Update(blockNumber uint64, update *StateUpdate, declaredClasses map[felt.Felt]Class) error { err := s.verifyStateUpdateRoot(update.OldRoot) if err != nil { - return fmt.Errorf("beginning: %w", err) + return err } // register declared classes mentioned in stateDiff.deployedContracts and stateDiff.declaredClasses @@ -233,11 +233,7 @@ func (s *State) Update(blockNumber uint64, update *StateUpdate, declaredClasses return err } - err = s.verifyStateUpdateRoot(update.NewRoot) - if err != nil { - return fmt.Errorf("end: %w", err) - } - return nil + return s.verifyStateUpdateRoot(update.NewRoot) } var ( diff --git a/p2p/p2p_test.go b/p2p/p2p_test.go index e9d48634cd..5b536fa09a 100644 --- a/p2p/p2p_test.go +++ b/p2p/p2p_test.go @@ -72,7 +72,7 @@ func TestService(t *testing.T) { case evt := <-events: require.Equal(t, network.Connected, evt.Connectedness) case <-time.After(timeout): - require.True(t, false, "no classes were emitted") + require.True(t, false, "no events were emitted") } t.Run("gossip", func(t *testing.T) { diff --git a/p2p/starknet/buf.gen.yaml b/p2p/starknet/buf.gen.yaml deleted file mode 100644 index 86cf20f336..0000000000 --- a/p2p/starknet/buf.gen.yaml +++ /dev/null @@ -1,5 +0,0 @@ -version: v1beta1 -plugins: - - name: go - out: spec - opt: paths=source_relative,M=somepackage \ No newline at end of file From f8e518dd61aa92f158621d2cfa0855c669ff71e6 Mon Sep 17 00:00:00 2001 From: Kirill Date: Wed, 5 Jun 2024 17:31:34 +0400 Subject: [PATCH 16/18] Fix nil entry points in adapters --- adapters/p2p2core/class.go | 23 +++++++++++++++++------ 1 file changed, 17 insertions(+), 6 deletions(-) diff --git a/adapters/p2p2core/class.go b/adapters/p2p2core/class.go index 1c5f72fdab..8094a03006 100644 --- a/adapters/p2p2core/class.go +++ b/adapters/p2p2core/class.go @@ -20,12 +20,17 @@ func AdaptClass(class *spec.Class) core.Class { switch cls := class.Class.(type) { case *spec.Class_Cairo0: + adaptEP := func(points []*spec.EntryPoint) []core.EntryPoint { + // usage of NonNilSlice is essential because relevant core class fields are non nil + return utils.Map(utils.NonNilSlice(points), adaptEntryPoint) + } + cairo0 := cls.Cairo0 return &core.Cairo0Class{ Abi: json.RawMessage(cairo0.Abi), - Externals: utils.Map(cairo0.Externals, adaptEntryPoint), - L1Handlers: utils.Map(cairo0.L1Handlers, adaptEntryPoint), - Constructors: utils.Map(cairo0.Constructors, adaptEntryPoint), + Externals: adaptEP(cairo0.Externals), + L1Handlers: adaptEP(cairo0.L1Handlers), + Constructors: adaptEP(cairo0.Constructors), Program: cairo0.Program, } case *spec.Class_Cairo1: @@ -41,6 +46,12 @@ func AdaptClass(class *spec.Class) core.Class { panic(err) } + adaptEP := func(points []*spec.SierraEntryPoint) []core.SierraEntryPoint { + // usage of NonNilSlice is essential because relevant core class fields are non nil + return utils.Map(utils.NonNilSlice(points), adaptSierra) + } + + entryPoints := cairo1.EntryPoints return &core.Cairo1Class{ Abi: cairo1.Abi, AbiHash: abiHash, @@ -49,9 +60,9 @@ func AdaptClass(class *spec.Class) core.Class { External []core.SierraEntryPoint L1Handler []core.SierraEntryPoint }{ - Constructor: utils.Map(cairo1.EntryPoints.Constructors, adaptSierra), - External: utils.Map(cairo1.EntryPoints.Externals, adaptSierra), - L1Handler: utils.Map(cairo1.EntryPoints.L1Handlers, adaptSierra), + Constructor: adaptEP(entryPoints.Constructors), + External: adaptEP(entryPoints.Externals), + L1Handler: adaptEP(entryPoints.L1Handlers), }, Program: program, ProgramHash: crypto.PoseidonArray(program...), From 203bc1772d11fe35fb7613cf119427f8ce0111d4 Mon Sep 17 00:00:00 2001 From: Kirill Date: Wed, 12 Jun 2024 15:23:41 +0400 Subject: [PATCH 17/18] Fix stateReader for 0 block --- adapters/p2p2core/state.go | 19 +++++++++++++------ p2p/sync.go | 6 +++++- 2 files changed, 18 insertions(+), 7 deletions(-) diff --git a/adapters/p2p2core/state.go b/adapters/p2p2core/state.go index 586b38f619..a51958798c 100644 --- a/adapters/p2p2core/state.go +++ b/adapters/p2p2core/state.go @@ -50,12 +50,19 @@ func AdaptStateDiff(reader core.StateReader, contractDiffs []*spec.ContractDiff, classHash: diff.ClassHash, } - stateClassHash, err := reader.ContractClassHash(address) - if err != nil { - if errors.Is(err, db.ErrKeyNotFound) { - stateClassHash = &felt.Zero - } else { - panic(err) + var stateClassHash *felt.Felt + if reader == nil { + // zero block + stateClassHash = &felt.Zero + } else { + var err error + stateClassHash, err = reader.ContractClassHash(address) + if err != nil { + if errors.Is(err, db.ErrKeyNotFound) { + stateClassHash = &felt.Zero + } else { + panic(err) + } } } diff --git a/p2p/sync.go b/p2p/sync.go index 8894abc872..014027794a 100644 --- a/p2p/sync.go +++ b/p2p/sync.go @@ -356,11 +356,15 @@ func (s *syncService) adaptAndSanityCheckBlock(ctx context.Context, header *spec // Update but there is no such message in P2P. stateReader, stateCloser, err := s.blockchain.StateAtBlockNumber(coreBlock.Number - 1) - if err != nil { + if err != nil && !errors.Is(err, db.ErrKeyNotFound) { // todo(kirill) change to shutdown panic(err) } defer func() { + if stateCloser == nil { + return + } + if closeErr := stateCloser(); closeErr != nil { s.log.Errorw("Failed to close state reader", "err", closeErr) } From eac708d732919f3998116d93396eb7dacb67eccf Mon Sep 17 00:00:00 2001 From: Kirill Date: Mon, 8 Jul 2024 16:15:34 +0300 Subject: [PATCH 18/18] Removed debug, unused code. Removed 1 unrelevant todo comment --- adapters/core2p2p/felt.go | 1 - p2p/starknet/handlers.go | 49 --------------------------------------- p2p/sync.go | 9 +------ 3 files changed, 1 insertion(+), 58 deletions(-) diff --git a/adapters/core2p2p/felt.go b/adapters/core2p2p/felt.go index 150a9c4f85..67cf3cfc84 100644 --- a/adapters/core2p2p/felt.go +++ b/adapters/core2p2p/felt.go @@ -50,7 +50,6 @@ func AdaptUint128(f *felt.Felt) *spec.Uint128 { // bits represents value in little endian byte order // i.e. first is least significant byte bits := f.Bits() - // todo what should we do with the rest of bytes? return &spec.Uint128{ Low: bits[0], High: bits[1], diff --git a/p2p/starknet/handlers.go b/p2p/starknet/handlers.go index 229d185dc8..2893268792 100644 --- a/p2p/starknet/handlers.go +++ b/p2p/starknet/handlers.go @@ -151,55 +151,6 @@ func (h *Handler) onHeadersRequest(req *spec.BlockHeadersRequest) (iter.Seq[prot }) } -/* -func (h *Handler) onBlockBodiesRequest(req *spec.BlockBodiesRequest) (iter.Seq[proto.Message], error) { - it, err := h.newIterator(req.Iteration) - if err != nil { - return nil, err - } - - fin := newFin(&spec.BlockBodiesResponse{ - BodyMessage: &spec.BlockBodiesResponse_Fin{}, - }) - - return func(yield func(proto.Message) bool) { - outerLoop: - for it.Valid() { - header, err := it.Header() - if err != nil { - h.log.Debugw("Failed to fetch header", "blockNumber", it.BlockNumber(), "err", err) - break - } - - h.log.Debugw("Creating Block Body Iterator", "blockNumber", header.Number) - bodyIterator, err := newBlockBodyIterator(h.bcReader, header, h.log) - if err != nil { - h.log.Debugw("Failed to create block body iterator", "blockNumber", it.BlockNumber(), "err", err) - break - } - - for bodyIterator.hasNext() { - msg, ok := bodyIterator.next() - if !ok { - break - } - - if !yield(msg) { - break outerLoop - } - } - - it.Next() - } - - if finMs, ok := fin(); ok { - yield(finMs) - } - yield(finMsg) - }, nil -} -*/ - func (h *Handler) onEventsRequest(req *spec.EventsRequest) (iter.Seq[proto.Message], error) { finMsg := &spec.EventsResponse{ EventMessage: &spec.EventsResponse_Fin{}, diff --git a/p2p/sync.go b/p2p/sync.go index 014027794a..61afb503ee 100644 --- a/p2p/sync.go +++ b/p2p/sync.go @@ -5,7 +5,6 @@ import ( "errors" "fmt" "math/rand" - "os" "reflect" "time" @@ -54,7 +53,6 @@ func (s *syncService) start(ctx context.Context) { s.client = starknet.NewClient(s.randomPeerStream, s.network, s.log) - var randHeight int for i := 0; ; i++ { if err := ctx.Err(); err != nil { break @@ -70,7 +68,7 @@ func (s *syncService) start(ctx context.Context) { s.log.Errorw("Failed to get current height", "err", err) } - s.log.Infow("Start Pipeline", "Random node height", randHeight, "Current height", nextHeight-1, "Start", nextHeight) + s.log.Infow("Start Pipeline", "Current height", nextHeight-1, "Start", nextHeight) // todo change iteration to fetch several objects uint64(min(blockBehind, maxBlocks)) blockNumber := uint64(nextHeight) @@ -333,11 +331,6 @@ func (s *syncService) adaptAndSanityCheckBlock(ctx context.Context, header *spec bodyCh <- blockBody{err: fmt.Errorf("block hash calculation error: %v", err)} return } - if !coreBlock.Hash.Equal(h) { - spew.Dump("Receipts number:", coreBlock.Receipts, events) - spew.Dump("Hash mismtach", coreBlock) - os.Exit(1) - } coreBlock.Hash = h newClasses := make(map[felt.Felt]core.Class)