From f7e3967fcb0e85163fc4d0d82a96e3a34d661113 Mon Sep 17 00:00:00 2001 From: Yiyi Wang Date: Thu, 4 Dec 2025 11:51:40 +0800 Subject: [PATCH] feat: Add protosol protobuf files used for solfuzz differential fuzzing --- pkg/protosol-go/block/block.pb.go | 491 +++++++++ pkg/protosol-go/context/context.pb.go | 710 +++++++++++++ pkg/protosol-go/elf/elf.pb.go | 368 +++++++ pkg/protosol-go/invoke/invoke.pb.go | 428 ++++++++ pkg/protosol-go/metadata/metadata.pb.go | 123 +++ pkg/protosol-go/pack/pack.pb.go | 290 +++++ pkg/protosol-go/serialize/serialize.pb.go | 198 ++++ pkg/protosol-go/shred/shred.pb.go | 453 ++++++++ pkg/protosol-go/txn/txn.pb.go | 979 +++++++++++++++++ pkg/protosol-go/type/type.pb.go | 267 +++++ pkg/protosol-go/vm/vm.pb.go | 1164 +++++++++++++++++++++ 11 files changed, 5471 insertions(+) create mode 100644 pkg/protosol-go/block/block.pb.go create mode 100644 pkg/protosol-go/context/context.pb.go create mode 100644 pkg/protosol-go/elf/elf.pb.go create mode 100644 pkg/protosol-go/invoke/invoke.pb.go create mode 100644 pkg/protosol-go/metadata/metadata.pb.go create mode 100644 pkg/protosol-go/pack/pack.pb.go create mode 100644 pkg/protosol-go/serialize/serialize.pb.go create mode 100644 pkg/protosol-go/shred/shred.pb.go create mode 100644 pkg/protosol-go/txn/txn.pb.go create mode 100644 pkg/protosol-go/type/type.pb.go create mode 100644 pkg/protosol-go/vm/vm.pb.go diff --git a/pkg/protosol-go/block/block.pb.go b/pkg/protosol-go/block/block.pb.go new file mode 100644 index 00000000..4e4b71c0 --- /dev/null +++ b/pkg/protosol-go/block/block.pb.go @@ -0,0 +1,491 @@ +// Code generated by protoc-gen-go. DO NOT EDIT. +// versions: +// protoc-gen-go v1.36.10 +// protoc v6.32.1 +// source: block.proto + +package block + +import ( + protoreflect "google.golang.org/protobuf/reflect/protoreflect" + protoimpl "google.golang.org/protobuf/runtime/protoimpl" + context "github.com/Overclock-Validator/mithril/pkg/protosol-go/context" + metadata "github.com/Overclock-Validator/mithril/pkg/protosol-go/metadata" + txn "github.com/Overclock-Validator/mithril/pkg/protosol-go/txn" + reflect "reflect" + sync "sync" + unsafe "unsafe" +) + +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 CostTracker struct { + state protoimpl.MessageState `protogen:"open.v1"` + BlockCost uint64 `protobuf:"varint,1,opt,name=block_cost,json=blockCost,proto3" json:"block_cost,omitempty"` + VoteCost uint64 `protobuf:"varint,2,opt,name=vote_cost,json=voteCost,proto3" json:"vote_cost,omitempty"` + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache +} + +func (x *CostTracker) Reset() { + *x = CostTracker{} + mi := &file_block_proto_msgTypes[0] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) +} + +func (x *CostTracker) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*CostTracker) ProtoMessage() {} + +func (x *CostTracker) ProtoReflect() protoreflect.Message { + mi := &file_block_proto_msgTypes[0] + if x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use CostTracker.ProtoReflect.Descriptor instead. +func (*CostTracker) Descriptor() ([]byte, []int) { + return file_block_proto_rawDescGZIP(), []int{0} +} + +func (x *CostTracker) GetBlockCost() uint64 { + if x != nil { + return x.BlockCost + } + return 0 +} + +func (x *CostTracker) GetVoteCost() uint64 { + if x != nil { + return x.VoteCost + } + return 0 +} + +type BlockContext struct { + state protoimpl.MessageState `protogen:"open.v1"` + // All transactions in this microblock (can be 0) + Txns []*txn.SanitizedTransaction `protobuf:"bytes,1,rep,name=txns,proto3" json:"txns,omitempty"` + // Input account states + AcctStates []*context.AcctState `protobuf:"bytes,2,rep,name=acct_states,json=acctStates,proto3" json:"acct_states,omitempty"` + // The blockhash queue + BlockhashQueue [][]byte `protobuf:"bytes,3,rep,name=blockhash_queue,json=blockhashQueue,proto3" json:"blockhash_queue,omitempty"` + // Slot context (contains slot number) + SlotCtx *context.SlotContext `protobuf:"bytes,4,opt,name=slot_ctx,json=slotCtx,proto3" json:"slot_ctx,omitempty"` + // Epoch context (contains feature info) + EpochCtx *context.EpochContext `protobuf:"bytes,5,opt,name=epoch_ctx,json=epochCtx,proto3" json:"epoch_ctx,omitempty"` + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache +} + +func (x *BlockContext) Reset() { + *x = BlockContext{} + mi := &file_block_proto_msgTypes[1] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) +} + +func (x *BlockContext) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*BlockContext) ProtoMessage() {} + +func (x *BlockContext) ProtoReflect() protoreflect.Message { + mi := &file_block_proto_msgTypes[1] + if x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use BlockContext.ProtoReflect.Descriptor instead. +func (*BlockContext) Descriptor() ([]byte, []int) { + return file_block_proto_rawDescGZIP(), []int{1} +} + +func (x *BlockContext) GetTxns() []*txn.SanitizedTransaction { + if x != nil { + return x.Txns + } + return nil +} + +func (x *BlockContext) GetAcctStates() []*context.AcctState { + if x != nil { + return x.AcctStates + } + return nil +} + +func (x *BlockContext) GetBlockhashQueue() [][]byte { + if x != nil { + return x.BlockhashQueue + } + return nil +} + +func (x *BlockContext) GetSlotCtx() *context.SlotContext { + if x != nil { + return x.SlotCtx + } + return nil +} + +func (x *BlockContext) GetEpochCtx() *context.EpochContext { + if x != nil { + return x.EpochCtx + } + return nil +} + +type LeaderScheduleEffects struct { + state protoimpl.MessageState `protogen:"open.v1"` + // Epoch number for which this leader schedule applies + LeadersEpoch uint64 `protobuf:"varint,1,opt,name=leaders_epoch,json=leadersEpoch,proto3" json:"leaders_epoch,omitempty"` + // First slot number covered by this leader schedule + LeadersSlot0 uint64 `protobuf:"varint,2,opt,name=leaders_slot0,json=leadersSlot0,proto3" json:"leaders_slot0,omitempty"` + // Total number of slots covered by this leader schedule + LeadersSlotCnt uint64 `protobuf:"varint,3,opt,name=leaders_slot_cnt,json=leadersSlotCnt,proto3" json:"leaders_slot_cnt,omitempty"` + // Number of unique validator public keys in the leader schedule + LeaderPubCnt uint64 `protobuf:"varint,4,opt,name=leader_pub_cnt,json=leaderPubCnt,proto3" json:"leader_pub_cnt,omitempty"` + // Number of entries in the leader schedule (slots with assigned leaders) + LeadersSchedCnt uint64 `protobuf:"varint,5,opt,name=leaders_sched_cnt,json=leadersSchedCnt,proto3" json:"leaders_sched_cnt,omitempty"` + // Hash of the leader schedule + LeaderScheduleHash []byte `protobuf:"bytes,6,opt,name=leader_schedule_hash,json=leaderScheduleHash,proto3" json:"leader_schedule_hash,omitempty"` + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache +} + +func (x *LeaderScheduleEffects) Reset() { + *x = LeaderScheduleEffects{} + mi := &file_block_proto_msgTypes[2] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) +} + +func (x *LeaderScheduleEffects) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*LeaderScheduleEffects) ProtoMessage() {} + +func (x *LeaderScheduleEffects) ProtoReflect() protoreflect.Message { + mi := &file_block_proto_msgTypes[2] + if x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use LeaderScheduleEffects.ProtoReflect.Descriptor instead. +func (*LeaderScheduleEffects) Descriptor() ([]byte, []int) { + return file_block_proto_rawDescGZIP(), []int{2} +} + +func (x *LeaderScheduleEffects) GetLeadersEpoch() uint64 { + if x != nil { + return x.LeadersEpoch + } + return 0 +} + +func (x *LeaderScheduleEffects) GetLeadersSlot0() uint64 { + if x != nil { + return x.LeadersSlot0 + } + return 0 +} + +func (x *LeaderScheduleEffects) GetLeadersSlotCnt() uint64 { + if x != nil { + return x.LeadersSlotCnt + } + return 0 +} + +func (x *LeaderScheduleEffects) GetLeaderPubCnt() uint64 { + if x != nil { + return x.LeaderPubCnt + } + return 0 +} + +func (x *LeaderScheduleEffects) GetLeadersSchedCnt() uint64 { + if x != nil { + return x.LeadersSchedCnt + } + return 0 +} + +func (x *LeaderScheduleEffects) GetLeaderScheduleHash() []byte { + if x != nil { + return x.LeaderScheduleHash + } + return nil +} + +type BlockEffects struct { + state protoimpl.MessageState `protogen:"open.v1"` + // If block execution failed + HasError bool `protobuf:"varint,1,opt,name=has_error,json=hasError,proto3" json:"has_error,omitempty"` + // Slot capitalization + SlotCapitalization uint64 `protobuf:"varint,2,opt,name=slot_capitalization,json=slotCapitalization,proto3" json:"slot_capitalization,omitempty"` + // Bank hash + BankHash []byte `protobuf:"bytes,3,opt,name=bank_hash,json=bankHash,proto3" json:"bank_hash,omitempty"` + // The cost tracker + CostTracker *CostTracker `protobuf:"bytes,4,opt,name=cost_tracker,json=costTracker,proto3" json:"cost_tracker,omitempty"` + // Leader schedule + LeaderSchedule *LeaderScheduleEffects `protobuf:"bytes,5,opt,name=leader_schedule,json=leaderSchedule,proto3" json:"leader_schedule,omitempty"` + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache +} + +func (x *BlockEffects) Reset() { + *x = BlockEffects{} + mi := &file_block_proto_msgTypes[3] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) +} + +func (x *BlockEffects) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*BlockEffects) ProtoMessage() {} + +func (x *BlockEffects) ProtoReflect() protoreflect.Message { + mi := &file_block_proto_msgTypes[3] + if x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use BlockEffects.ProtoReflect.Descriptor instead. +func (*BlockEffects) Descriptor() ([]byte, []int) { + return file_block_proto_rawDescGZIP(), []int{3} +} + +func (x *BlockEffects) GetHasError() bool { + if x != nil { + return x.HasError + } + return false +} + +func (x *BlockEffects) GetSlotCapitalization() uint64 { + if x != nil { + return x.SlotCapitalization + } + return 0 +} + +func (x *BlockEffects) GetBankHash() []byte { + if x != nil { + return x.BankHash + } + return nil +} + +func (x *BlockEffects) GetCostTracker() *CostTracker { + if x != nil { + return x.CostTracker + } + return nil +} + +func (x *BlockEffects) GetLeaderSchedule() *LeaderScheduleEffects { + if x != nil { + return x.LeaderSchedule + } + return nil +} + +type BlockFixture struct { + state protoimpl.MessageState `protogen:"open.v1"` + Metadata *metadata.FixtureMetadata `protobuf:"bytes,1,opt,name=metadata,proto3" json:"metadata,omitempty"` + // The block input + Input *BlockContext `protobuf:"bytes,2,opt,name=input,proto3" json:"input,omitempty"` + // The output + Output *BlockEffects `protobuf:"bytes,3,opt,name=output,proto3" json:"output,omitempty"` + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache +} + +func (x *BlockFixture) Reset() { + *x = BlockFixture{} + mi := &file_block_proto_msgTypes[4] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) +} + +func (x *BlockFixture) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*BlockFixture) ProtoMessage() {} + +func (x *BlockFixture) ProtoReflect() protoreflect.Message { + mi := &file_block_proto_msgTypes[4] + if x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use BlockFixture.ProtoReflect.Descriptor instead. +func (*BlockFixture) Descriptor() ([]byte, []int) { + return file_block_proto_rawDescGZIP(), []int{4} +} + +func (x *BlockFixture) GetMetadata() *metadata.FixtureMetadata { + if x != nil { + return x.Metadata + } + return nil +} + +func (x *BlockFixture) GetInput() *BlockContext { + if x != nil { + return x.Input + } + return nil +} + +func (x *BlockFixture) GetOutput() *BlockEffects { + if x != nil { + return x.Output + } + return nil +} + +var File_block_proto protoreflect.FileDescriptor + +const file_block_proto_rawDesc = "" + + "\n" + + "\vblock.proto\x12\x16org.solana.sealevel.v1\x1a\rcontext.proto\x1a\ttxn.proto\x1a\x0emetadata.proto\"I\n" + + "\vCostTracker\x12\x1d\n" + + "\n" + + "block_cost\x18\x01 \x01(\x04R\tblockCost\x12\x1b\n" + + "\tvote_cost\x18\x02 \x01(\x04R\bvoteCost\"\xc0\x02\n" + + "\fBlockContext\x12@\n" + + "\x04txns\x18\x01 \x03(\v2,.org.solana.sealevel.v1.SanitizedTransactionR\x04txns\x12B\n" + + "\vacct_states\x18\x02 \x03(\v2!.org.solana.sealevel.v1.AcctStateR\n" + + "acctStates\x12'\n" + + "\x0fblockhash_queue\x18\x03 \x03(\fR\x0eblockhashQueue\x12>\n" + + "\bslot_ctx\x18\x04 \x01(\v2#.org.solana.sealevel.v1.SlotContextR\aslotCtx\x12A\n" + + "\tepoch_ctx\x18\x05 \x01(\v2$.org.solana.sealevel.v1.EpochContextR\bepochCtx\"\x8f\x02\n" + + "\x15LeaderScheduleEffects\x12#\n" + + "\rleaders_epoch\x18\x01 \x01(\x04R\fleadersEpoch\x12#\n" + + "\rleaders_slot0\x18\x02 \x01(\x04R\fleadersSlot0\x12(\n" + + "\x10leaders_slot_cnt\x18\x03 \x01(\x04R\x0eleadersSlotCnt\x12$\n" + + "\x0eleader_pub_cnt\x18\x04 \x01(\x04R\fleaderPubCnt\x12*\n" + + "\x11leaders_sched_cnt\x18\x05 \x01(\x04R\x0fleadersSchedCnt\x120\n" + + "\x14leader_schedule_hash\x18\x06 \x01(\fR\x12leaderScheduleHash\"\x99\x02\n" + + "\fBlockEffects\x12\x1b\n" + + "\thas_error\x18\x01 \x01(\bR\bhasError\x12/\n" + + "\x13slot_capitalization\x18\x02 \x01(\x04R\x12slotCapitalization\x12\x1b\n" + + "\tbank_hash\x18\x03 \x01(\fR\bbankHash\x12F\n" + + "\fcost_tracker\x18\x04 \x01(\v2#.org.solana.sealevel.v1.CostTrackerR\vcostTracker\x12V\n" + + "\x0fleader_schedule\x18\x05 \x01(\v2-.org.solana.sealevel.v1.LeaderScheduleEffectsR\x0eleaderSchedule\"\xcd\x01\n" + + "\fBlockFixture\x12C\n" + + "\bmetadata\x18\x01 \x01(\v2'.org.solana.sealevel.v1.FixtureMetadataR\bmetadata\x12:\n" + + "\x05input\x18\x02 \x01(\v2$.org.solana.sealevel.v1.BlockContextR\x05input\x12<\n" + + "\x06output\x18\x03 \x01(\v2$.org.solana.sealevel.v1.BlockEffectsR\x06outputb\x06proto3" + +var ( + file_block_proto_rawDescOnce sync.Once + file_block_proto_rawDescData []byte +) + +func file_block_proto_rawDescGZIP() []byte { + file_block_proto_rawDescOnce.Do(func() { + file_block_proto_rawDescData = protoimpl.X.CompressGZIP(unsafe.Slice(unsafe.StringData(file_block_proto_rawDesc), len(file_block_proto_rawDesc))) + }) + return file_block_proto_rawDescData +} + +var file_block_proto_msgTypes = make([]protoimpl.MessageInfo, 5) +var file_block_proto_goTypes = []any{ + (*CostTracker)(nil), // 0: org.solana.sealevel.v1.CostTracker + (*BlockContext)(nil), // 1: org.solana.sealevel.v1.BlockContext + (*LeaderScheduleEffects)(nil), // 2: org.solana.sealevel.v1.LeaderScheduleEffects + (*BlockEffects)(nil), // 3: org.solana.sealevel.v1.BlockEffects + (*BlockFixture)(nil), // 4: org.solana.sealevel.v1.BlockFixture + (*txn.SanitizedTransaction)(nil), // 5: org.solana.sealevel.v1.SanitizedTransaction + (*context.AcctState)(nil), // 6: org.solana.sealevel.v1.AcctState + (*context.SlotContext)(nil), // 7: org.solana.sealevel.v1.SlotContext + (*context.EpochContext)(nil), // 8: org.solana.sealevel.v1.EpochContext + (*metadata.FixtureMetadata)(nil), // 9: org.solana.sealevel.v1.FixtureMetadata +} +var file_block_proto_depIdxs = []int32{ + 5, // 0: org.solana.sealevel.v1.BlockContext.txns:type_name -> org.solana.sealevel.v1.SanitizedTransaction + 6, // 1: org.solana.sealevel.v1.BlockContext.acct_states:type_name -> org.solana.sealevel.v1.AcctState + 7, // 2: org.solana.sealevel.v1.BlockContext.slot_ctx:type_name -> org.solana.sealevel.v1.SlotContext + 8, // 3: org.solana.sealevel.v1.BlockContext.epoch_ctx:type_name -> org.solana.sealevel.v1.EpochContext + 0, // 4: org.solana.sealevel.v1.BlockEffects.cost_tracker:type_name -> org.solana.sealevel.v1.CostTracker + 2, // 5: org.solana.sealevel.v1.BlockEffects.leader_schedule:type_name -> org.solana.sealevel.v1.LeaderScheduleEffects + 9, // 6: org.solana.sealevel.v1.BlockFixture.metadata:type_name -> org.solana.sealevel.v1.FixtureMetadata + 1, // 7: org.solana.sealevel.v1.BlockFixture.input:type_name -> org.solana.sealevel.v1.BlockContext + 3, // 8: org.solana.sealevel.v1.BlockFixture.output:type_name -> org.solana.sealevel.v1.BlockEffects + 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_block_proto_init() } +func file_block_proto_init() { + if File_block_proto != nil { + return + } + type x struct{} + out := protoimpl.TypeBuilder{ + File: protoimpl.DescBuilder{ + GoPackagePath: reflect.TypeOf(x{}).PkgPath(), + RawDescriptor: unsafe.Slice(unsafe.StringData(file_block_proto_rawDesc), len(file_block_proto_rawDesc)), + NumEnums: 0, + NumMessages: 5, + NumExtensions: 0, + NumServices: 0, + }, + GoTypes: file_block_proto_goTypes, + DependencyIndexes: file_block_proto_depIdxs, + MessageInfos: file_block_proto_msgTypes, + }.Build() + File_block_proto = out.File + file_block_proto_goTypes = nil + file_block_proto_depIdxs = nil +} diff --git a/pkg/protosol-go/context/context.pb.go b/pkg/protosol-go/context/context.pb.go new file mode 100644 index 00000000..8b5c61bf --- /dev/null +++ b/pkg/protosol-go/context/context.pb.go @@ -0,0 +1,710 @@ +// Code generated by protoc-gen-go. DO NOT EDIT. +// versions: +// protoc-gen-go v1.36.10 +// protoc v6.32.1 +// source: context.proto + +package context + +import ( + protoreflect "google.golang.org/protobuf/reflect/protoreflect" + protoimpl "google.golang.org/protobuf/runtime/protoimpl" + reflect "reflect" + sync "sync" + unsafe "unsafe" +) + +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) +) + +// A set of feature flags. +type FeatureSet struct { + state protoimpl.MessageState `protogen:"open.v1"` + // Every item in this list marks an enabled feature. The value of + // each item is the first 8 bytes of the feature ID as a little- + // endian integer. + Features []uint64 `protobuf:"fixed64,1,rep,packed,name=features,proto3" json:"features,omitempty"` + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache +} + +func (x *FeatureSet) Reset() { + *x = FeatureSet{} + mi := &file_context_proto_msgTypes[0] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) +} + +func (x *FeatureSet) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*FeatureSet) ProtoMessage() {} + +func (x *FeatureSet) ProtoReflect() protoreflect.Message { + mi := &file_context_proto_msgTypes[0] + if x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use FeatureSet.ProtoReflect.Descriptor instead. +func (*FeatureSet) Descriptor() ([]byte, []int) { + return file_context_proto_rawDescGZIP(), []int{0} +} + +func (x *FeatureSet) GetFeatures() []uint64 { + if x != nil { + return x.Features + } + return nil +} + +// The complete state of an account excluding its public key. +type AcctState struct { + state protoimpl.MessageState `protogen:"open.v1"` + // The account address. (32 bytes) + Address []byte `protobuf:"bytes,1,opt,name=address,proto3" json:"address,omitempty"` + Lamports uint64 `protobuf:"varint,2,opt,name=lamports,proto3" json:"lamports,omitempty"` + // Account data is limited to 10 MiB on Solana mainnet as of 2024-Feb. + Data []byte `protobuf:"bytes,3,opt,name=data,proto3" json:"data,omitempty"` + Executable bool `protobuf:"varint,4,opt,name=executable,proto3" json:"executable,omitempty"` + // Address of the program that owns this account. (32 bytes) + Owner []byte `protobuf:"bytes,6,opt,name=owner,proto3" json:"owner,omitempty"` + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache +} + +func (x *AcctState) Reset() { + *x = AcctState{} + mi := &file_context_proto_msgTypes[1] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) +} + +func (x *AcctState) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*AcctState) ProtoMessage() {} + +func (x *AcctState) ProtoReflect() protoreflect.Message { + mi := &file_context_proto_msgTypes[1] + if x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use AcctState.ProtoReflect.Descriptor instead. +func (*AcctState) Descriptor() ([]byte, []int) { + return file_context_proto_rawDescGZIP(), []int{1} +} + +func (x *AcctState) GetAddress() []byte { + if x != nil { + return x.Address + } + return nil +} + +func (x *AcctState) GetLamports() uint64 { + if x != nil { + return x.Lamports + } + return 0 +} + +func (x *AcctState) GetData() []byte { + if x != nil { + return x.Data + } + return nil +} + +func (x *AcctState) GetExecutable() bool { + if x != nil { + return x.Executable + } + return false +} + +func (x *AcctState) GetOwner() []byte { + if x != nil { + return x.Owner + } + return nil +} + +type VoteAccount struct { + state protoimpl.MessageState `protogen:"open.v1"` + // Account state of the vote account + VoteAccount *AcctState `protobuf:"bytes,1,opt,name=vote_account,json=voteAccount,proto3" json:"vote_account,omitempty"` + // How much stake has been delegated to this account + Stake uint64 `protobuf:"varint,2,opt,name=stake,proto3" json:"stake,omitempty"` + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache +} + +func (x *VoteAccount) Reset() { + *x = VoteAccount{} + mi := &file_context_proto_msgTypes[2] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) +} + +func (x *VoteAccount) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*VoteAccount) ProtoMessage() {} + +func (x *VoteAccount) ProtoReflect() protoreflect.Message { + mi := &file_context_proto_msgTypes[2] + if x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use VoteAccount.ProtoReflect.Descriptor instead. +func (*VoteAccount) Descriptor() ([]byte, []int) { + return file_context_proto_rawDescGZIP(), []int{2} +} + +func (x *VoteAccount) GetVoteAccount() *AcctState { + if x != nil { + return x.VoteAccount + } + return nil +} + +func (x *VoteAccount) GetStake() uint64 { + if x != nil { + return x.Stake + } + return 0 +} + +// Epoch bank inflation parameters +type Inflation struct { + state protoimpl.MessageState `protogen:"open.v1"` + Initial float64 `protobuf:"fixed64,1,opt,name=initial,proto3" json:"initial,omitempty"` + Terminal float64 `protobuf:"fixed64,2,opt,name=terminal,proto3" json:"terminal,omitempty"` + Taper float64 `protobuf:"fixed64,3,opt,name=taper,proto3" json:"taper,omitempty"` + Foundation float64 `protobuf:"fixed64,4,opt,name=foundation,proto3" json:"foundation,omitempty"` + FoundationTerm float64 `protobuf:"fixed64,5,opt,name=foundation_term,json=foundationTerm,proto3" json:"foundation_term,omitempty"` + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache +} + +func (x *Inflation) Reset() { + *x = Inflation{} + mi := &file_context_proto_msgTypes[3] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) +} + +func (x *Inflation) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*Inflation) ProtoMessage() {} + +func (x *Inflation) ProtoReflect() protoreflect.Message { + mi := &file_context_proto_msgTypes[3] + if x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use Inflation.ProtoReflect.Descriptor instead. +func (*Inflation) Descriptor() ([]byte, []int) { + return file_context_proto_rawDescGZIP(), []int{3} +} + +func (x *Inflation) GetInitial() float64 { + if x != nil { + return x.Initial + } + return 0 +} + +func (x *Inflation) GetTerminal() float64 { + if x != nil { + return x.Terminal + } + return 0 +} + +func (x *Inflation) GetTaper() float64 { + if x != nil { + return x.Taper + } + return 0 +} + +func (x *Inflation) GetFoundation() float64 { + if x != nil { + return x.Foundation + } + return 0 +} + +func (x *Inflation) GetFoundationTerm() float64 { + if x != nil { + return x.FoundationTerm + } + return 0 +} + +// Fee rate governor parameters +type FeeRateGovernor struct { + state protoimpl.MessageState `protogen:"open.v1"` + TargetLamportsPerSignature uint64 `protobuf:"varint,1,opt,name=target_lamports_per_signature,json=targetLamportsPerSignature,proto3" json:"target_lamports_per_signature,omitempty"` + TargetSignaturesPerSlot uint64 `protobuf:"varint,2,opt,name=target_signatures_per_slot,json=targetSignaturesPerSlot,proto3" json:"target_signatures_per_slot,omitempty"` + MinLamportsPerSignature uint64 `protobuf:"varint,3,opt,name=min_lamports_per_signature,json=minLamportsPerSignature,proto3" json:"min_lamports_per_signature,omitempty"` + MaxLamportsPerSignature uint64 `protobuf:"varint,4,opt,name=max_lamports_per_signature,json=maxLamportsPerSignature,proto3" json:"max_lamports_per_signature,omitempty"` + BurnPercent uint32 `protobuf:"varint,5,opt,name=burn_percent,json=burnPercent,proto3" json:"burn_percent,omitempty"` + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache +} + +func (x *FeeRateGovernor) Reset() { + *x = FeeRateGovernor{} + mi := &file_context_proto_msgTypes[4] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) +} + +func (x *FeeRateGovernor) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*FeeRateGovernor) ProtoMessage() {} + +func (x *FeeRateGovernor) ProtoReflect() protoreflect.Message { + mi := &file_context_proto_msgTypes[4] + if x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use FeeRateGovernor.ProtoReflect.Descriptor instead. +func (*FeeRateGovernor) Descriptor() ([]byte, []int) { + return file_context_proto_rawDescGZIP(), []int{4} +} + +func (x *FeeRateGovernor) GetTargetLamportsPerSignature() uint64 { + if x != nil { + return x.TargetLamportsPerSignature + } + return 0 +} + +func (x *FeeRateGovernor) GetTargetSignaturesPerSlot() uint64 { + if x != nil { + return x.TargetSignaturesPerSlot + } + return 0 +} + +func (x *FeeRateGovernor) GetMinLamportsPerSignature() uint64 { + if x != nil { + return x.MinLamportsPerSignature + } + return 0 +} + +func (x *FeeRateGovernor) GetMaxLamportsPerSignature() uint64 { + if x != nil { + return x.MaxLamportsPerSignature + } + return 0 +} + +func (x *FeeRateGovernor) GetBurnPercent() uint32 { + if x != nil { + return x.BurnPercent + } + return 0 +} + +// EpochContext includes context scoped to an epoch. +// On "real" ledgers, it is created during the epoch boundary. +type EpochContext struct { + state protoimpl.MessageState `protogen:"open.v1"` + // Active feature set + Features *FeatureSet `protobuf:"bytes,1,opt,name=features,proto3" json:"features,omitempty"` + // Hashes per tick + HashesPerTick uint64 `protobuf:"varint,2,opt,name=hashes_per_tick,json=hashesPerTick,proto3" json:"hashes_per_tick,omitempty"` + // Ticks per slot + TicksPerSlot uint64 `protobuf:"varint,3,opt,name=ticks_per_slot,json=ticksPerSlot,proto3" json:"ticks_per_slot,omitempty"` + // Slots per year + SlotsPerYear float64 `protobuf:"fixed64,4,opt,name=slots_per_year,json=slotsPerYear,proto3" json:"slots_per_year,omitempty"` + // Inflation + Inflation *Inflation `protobuf:"bytes,5,opt,name=inflation,proto3" json:"inflation,omitempty"` + // Genesis creation time + GenesisCreationTime uint64 `protobuf:"varint,6,opt,name=genesis_creation_time,json=genesisCreationTime,proto3" json:"genesis_creation_time,omitempty"` + // Epoch vote accounts for epochs T-1 and T-2 + VoteAccountsT_1 []*VoteAccount `protobuf:"bytes,11,rep,name=vote_accounts_t_1,json=voteAccountsT1,proto3" json:"vote_accounts_t_1,omitempty"` + VoteAccountsT_2 []*VoteAccount `protobuf:"bytes,12,rep,name=vote_accounts_t_2,json=voteAccountsT2,proto3" json:"vote_accounts_t_2,omitempty"` + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache +} + +func (x *EpochContext) Reset() { + *x = EpochContext{} + mi := &file_context_proto_msgTypes[5] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) +} + +func (x *EpochContext) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*EpochContext) ProtoMessage() {} + +func (x *EpochContext) ProtoReflect() protoreflect.Message { + mi := &file_context_proto_msgTypes[5] + if x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use EpochContext.ProtoReflect.Descriptor instead. +func (*EpochContext) Descriptor() ([]byte, []int) { + return file_context_proto_rawDescGZIP(), []int{5} +} + +func (x *EpochContext) GetFeatures() *FeatureSet { + if x != nil { + return x.Features + } + return nil +} + +func (x *EpochContext) GetHashesPerTick() uint64 { + if x != nil { + return x.HashesPerTick + } + return 0 +} + +func (x *EpochContext) GetTicksPerSlot() uint64 { + if x != nil { + return x.TicksPerSlot + } + return 0 +} + +func (x *EpochContext) GetSlotsPerYear() float64 { + if x != nil { + return x.SlotsPerYear + } + return 0 +} + +func (x *EpochContext) GetInflation() *Inflation { + if x != nil { + return x.Inflation + } + return nil +} + +func (x *EpochContext) GetGenesisCreationTime() uint64 { + if x != nil { + return x.GenesisCreationTime + } + return 0 +} + +func (x *EpochContext) GetVoteAccountsT_1() []*VoteAccount { + if x != nil { + return x.VoteAccountsT_1 + } + return nil +} + +func (x *EpochContext) GetVoteAccountsT_2() []*VoteAccount { + if x != nil { + return x.VoteAccountsT_2 + } + return nil +} + +// SlotContext includes context scoped to a block. +// On "real" ledgers, it is created during the slot boundary. +type SlotContext struct { + state protoimpl.MessageState `protogen:"open.v1"` + // Current slot number + Slot uint64 `protobuf:"fixed64,1,opt,name=slot,proto3" json:"slot,omitempty"` + BlockHeight uint64 `protobuf:"fixed64,2,opt,name=block_height,json=blockHeight,proto3" json:"block_height,omitempty"` + // POH hash + Poh []byte `protobuf:"bytes,3,opt,name=poh,proto3" json:"poh,omitempty"` + // Parent bank hash + ParentBankHash []byte `protobuf:"bytes,4,opt,name=parent_bank_hash,json=parentBankHash,proto3" json:"parent_bank_hash,omitempty"` + // Parent lt hash + ParentLthash []byte `protobuf:"bytes,5,opt,name=parent_lthash,json=parentLthash,proto3" json:"parent_lthash,omitempty"` + // The last executed slot + PrevSlot uint64 `protobuf:"fixed64,6,opt,name=prev_slot,json=prevSlot,proto3" json:"prev_slot,omitempty"` + // Last slot lamports per signature + PrevLps uint64 `protobuf:"varint,7,opt,name=prev_lps,json=prevLps,proto3" json:"prev_lps,omitempty"` + // Previous slot's capitalization. + // TODO: I was very smart and named this incorrectly. This should be fixed in the future. + PrevEpochCapitalization uint64 `protobuf:"varint,8,opt,name=prev_epoch_capitalization,json=prevEpochCapitalization,proto3" json:"prev_epoch_capitalization,omitempty"` + // Fee rate governor + FeeRateGovernor *FeeRateGovernor `protobuf:"bytes,9,opt,name=fee_rate_governor,json=feeRateGovernor,proto3" json:"fee_rate_governor,omitempty"` + // Parent signature count (used for fee rate governor) + ParentSignatureCount uint64 `protobuf:"varint,10,opt,name=parent_signature_count,json=parentSignatureCount,proto3" json:"parent_signature_count,omitempty"` + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache +} + +func (x *SlotContext) Reset() { + *x = SlotContext{} + mi := &file_context_proto_msgTypes[6] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) +} + +func (x *SlotContext) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*SlotContext) ProtoMessage() {} + +func (x *SlotContext) ProtoReflect() protoreflect.Message { + mi := &file_context_proto_msgTypes[6] + if x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use SlotContext.ProtoReflect.Descriptor instead. +func (*SlotContext) Descriptor() ([]byte, []int) { + return file_context_proto_rawDescGZIP(), []int{6} +} + +func (x *SlotContext) GetSlot() uint64 { + if x != nil { + return x.Slot + } + return 0 +} + +func (x *SlotContext) GetBlockHeight() uint64 { + if x != nil { + return x.BlockHeight + } + return 0 +} + +func (x *SlotContext) GetPoh() []byte { + if x != nil { + return x.Poh + } + return nil +} + +func (x *SlotContext) GetParentBankHash() []byte { + if x != nil { + return x.ParentBankHash + } + return nil +} + +func (x *SlotContext) GetParentLthash() []byte { + if x != nil { + return x.ParentLthash + } + return nil +} + +func (x *SlotContext) GetPrevSlot() uint64 { + if x != nil { + return x.PrevSlot + } + return 0 +} + +func (x *SlotContext) GetPrevLps() uint64 { + if x != nil { + return x.PrevLps + } + return 0 +} + +func (x *SlotContext) GetPrevEpochCapitalization() uint64 { + if x != nil { + return x.PrevEpochCapitalization + } + return 0 +} + +func (x *SlotContext) GetFeeRateGovernor() *FeeRateGovernor { + if x != nil { + return x.FeeRateGovernor + } + return nil +} + +func (x *SlotContext) GetParentSignatureCount() uint64 { + if x != nil { + return x.ParentSignatureCount + } + return 0 +} + +var File_context_proto protoreflect.FileDescriptor + +const file_context_proto_rawDesc = "" + + "\n" + + "\rcontext.proto\x12\x16org.solana.sealevel.v1\"(\n" + + "\n" + + "FeatureSet\x12\x1a\n" + + "\bfeatures\x18\x01 \x03(\x06R\bfeatures\"\x97\x01\n" + + "\tAcctState\x12\x18\n" + + "\aaddress\x18\x01 \x01(\fR\aaddress\x12\x1a\n" + + "\blamports\x18\x02 \x01(\x04R\blamports\x12\x12\n" + + "\x04data\x18\x03 \x01(\fR\x04data\x12\x1e\n" + + "\n" + + "executable\x18\x04 \x01(\bR\n" + + "executable\x12\x14\n" + + "\x05owner\x18\x06 \x01(\fR\x05ownerJ\x04\b\x05\x10\x06J\x04\b\a\x10\b\"i\n" + + "\vVoteAccount\x12D\n" + + "\fvote_account\x18\x01 \x01(\v2!.org.solana.sealevel.v1.AcctStateR\vvoteAccount\x12\x14\n" + + "\x05stake\x18\x02 \x01(\x04R\x05stake\"\xa0\x01\n" + + "\tInflation\x12\x18\n" + + "\ainitial\x18\x01 \x01(\x01R\ainitial\x12\x1a\n" + + "\bterminal\x18\x02 \x01(\x01R\bterminal\x12\x14\n" + + "\x05taper\x18\x03 \x01(\x01R\x05taper\x12\x1e\n" + + "\n" + + "foundation\x18\x04 \x01(\x01R\n" + + "foundation\x12'\n" + + "\x0ffoundation_term\x18\x05 \x01(\x01R\x0efoundationTerm\"\xae\x02\n" + + "\x0fFeeRateGovernor\x12A\n" + + "\x1dtarget_lamports_per_signature\x18\x01 \x01(\x04R\x1atargetLamportsPerSignature\x12;\n" + + "\x1atarget_signatures_per_slot\x18\x02 \x01(\x04R\x17targetSignaturesPerSlot\x12;\n" + + "\x1amin_lamports_per_signature\x18\x03 \x01(\x04R\x17minLamportsPerSignature\x12;\n" + + "\x1amax_lamports_per_signature\x18\x04 \x01(\x04R\x17maxLamportsPerSignature\x12!\n" + + "\fburn_percent\x18\x05 \x01(\rR\vburnPercent\"\xd7\x03\n" + + "\fEpochContext\x12>\n" + + "\bfeatures\x18\x01 \x01(\v2\".org.solana.sealevel.v1.FeatureSetR\bfeatures\x12&\n" + + "\x0fhashes_per_tick\x18\x02 \x01(\x04R\rhashesPerTick\x12$\n" + + "\x0eticks_per_slot\x18\x03 \x01(\x04R\fticksPerSlot\x12$\n" + + "\x0eslots_per_year\x18\x04 \x01(\x01R\fslotsPerYear\x12?\n" + + "\tinflation\x18\x05 \x01(\v2!.org.solana.sealevel.v1.InflationR\tinflation\x122\n" + + "\x15genesis_creation_time\x18\x06 \x01(\x04R\x13genesisCreationTime\x12N\n" + + "\x11vote_accounts_t_1\x18\v \x03(\v2#.org.solana.sealevel.v1.VoteAccountR\x0evoteAccountsT1\x12N\n" + + "\x11vote_accounts_t_2\x18\f \x03(\v2#.org.solana.sealevel.v1.VoteAccountR\x0evoteAccountsT2\"\xa4\x03\n" + + "\vSlotContext\x12\x12\n" + + "\x04slot\x18\x01 \x01(\x06R\x04slot\x12!\n" + + "\fblock_height\x18\x02 \x01(\x06R\vblockHeight\x12\x10\n" + + "\x03poh\x18\x03 \x01(\fR\x03poh\x12(\n" + + "\x10parent_bank_hash\x18\x04 \x01(\fR\x0eparentBankHash\x12#\n" + + "\rparent_lthash\x18\x05 \x01(\fR\fparentLthash\x12\x1b\n" + + "\tprev_slot\x18\x06 \x01(\x06R\bprevSlot\x12\x19\n" + + "\bprev_lps\x18\a \x01(\x04R\aprevLps\x12:\n" + + "\x19prev_epoch_capitalization\x18\b \x01(\x04R\x17prevEpochCapitalization\x12S\n" + + "\x11fee_rate_governor\x18\t \x01(\v2'.org.solana.sealevel.v1.FeeRateGovernorR\x0ffeeRateGovernor\x124\n" + + "\x16parent_signature_count\x18\n" + + " \x01(\x04R\x14parentSignatureCountb\x06proto3" + +var ( + file_context_proto_rawDescOnce sync.Once + file_context_proto_rawDescData []byte +) + +func file_context_proto_rawDescGZIP() []byte { + file_context_proto_rawDescOnce.Do(func() { + file_context_proto_rawDescData = protoimpl.X.CompressGZIP(unsafe.Slice(unsafe.StringData(file_context_proto_rawDesc), len(file_context_proto_rawDesc))) + }) + return file_context_proto_rawDescData +} + +var file_context_proto_msgTypes = make([]protoimpl.MessageInfo, 7) +var file_context_proto_goTypes = []any{ + (*FeatureSet)(nil), // 0: org.solana.sealevel.v1.FeatureSet + (*AcctState)(nil), // 1: org.solana.sealevel.v1.AcctState + (*VoteAccount)(nil), // 2: org.solana.sealevel.v1.VoteAccount + (*Inflation)(nil), // 3: org.solana.sealevel.v1.Inflation + (*FeeRateGovernor)(nil), // 4: org.solana.sealevel.v1.FeeRateGovernor + (*EpochContext)(nil), // 5: org.solana.sealevel.v1.EpochContext + (*SlotContext)(nil), // 6: org.solana.sealevel.v1.SlotContext +} +var file_context_proto_depIdxs = []int32{ + 1, // 0: org.solana.sealevel.v1.VoteAccount.vote_account:type_name -> org.solana.sealevel.v1.AcctState + 0, // 1: org.solana.sealevel.v1.EpochContext.features:type_name -> org.solana.sealevel.v1.FeatureSet + 3, // 2: org.solana.sealevel.v1.EpochContext.inflation:type_name -> org.solana.sealevel.v1.Inflation + 2, // 3: org.solana.sealevel.v1.EpochContext.vote_accounts_t_1:type_name -> org.solana.sealevel.v1.VoteAccount + 2, // 4: org.solana.sealevel.v1.EpochContext.vote_accounts_t_2:type_name -> org.solana.sealevel.v1.VoteAccount + 4, // 5: org.solana.sealevel.v1.SlotContext.fee_rate_governor:type_name -> org.solana.sealevel.v1.FeeRateGovernor + 6, // [6:6] is the sub-list for method output_type + 6, // [6:6] is the sub-list for method input_type + 6, // [6:6] is the sub-list for extension type_name + 6, // [6:6] is the sub-list for extension extendee + 0, // [0:6] is the sub-list for field type_name +} + +func init() { file_context_proto_init() } +func file_context_proto_init() { + if File_context_proto != nil { + return + } + type x struct{} + out := protoimpl.TypeBuilder{ + File: protoimpl.DescBuilder{ + GoPackagePath: reflect.TypeOf(x{}).PkgPath(), + RawDescriptor: unsafe.Slice(unsafe.StringData(file_context_proto_rawDesc), len(file_context_proto_rawDesc)), + NumEnums: 0, + NumMessages: 7, + NumExtensions: 0, + NumServices: 0, + }, + GoTypes: file_context_proto_goTypes, + DependencyIndexes: file_context_proto_depIdxs, + MessageInfos: file_context_proto_msgTypes, + }.Build() + File_context_proto = out.File + file_context_proto_goTypes = nil + file_context_proto_depIdxs = nil +} diff --git a/pkg/protosol-go/elf/elf.pb.go b/pkg/protosol-go/elf/elf.pb.go new file mode 100644 index 00000000..53f5331b --- /dev/null +++ b/pkg/protosol-go/elf/elf.pb.go @@ -0,0 +1,368 @@ +// Code generated by protoc-gen-go. DO NOT EDIT. +// versions: +// protoc-gen-go v1.36.10 +// protoc v6.32.1 +// source: elf.proto + +package elf + +import ( + protoreflect "google.golang.org/protobuf/reflect/protoreflect" + protoimpl "google.golang.org/protobuf/runtime/protoimpl" + context "github.com/Overclock-Validator/mithril/pkg/protosol-go/context" + metadata "github.com/Overclock-Validator/mithril/pkg/protosol-go/metadata" + reflect "reflect" + sync "sync" + unsafe "unsafe" +) + +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 ELFBinary struct { + state protoimpl.MessageState `protogen:"open.v1"` + Data []byte `protobuf:"bytes,1,opt,name=data,proto3" json:"data,omitempty"` + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache +} + +func (x *ELFBinary) Reset() { + *x = ELFBinary{} + mi := &file_elf_proto_msgTypes[0] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) +} + +func (x *ELFBinary) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*ELFBinary) ProtoMessage() {} + +func (x *ELFBinary) ProtoReflect() protoreflect.Message { + mi := &file_elf_proto_msgTypes[0] + if x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use ELFBinary.ProtoReflect.Descriptor instead. +func (*ELFBinary) Descriptor() ([]byte, []int) { + return file_elf_proto_rawDescGZIP(), []int{0} +} + +func (x *ELFBinary) GetData() []byte { + if x != nil { + return x.Data + } + return nil +} + +// Wrapper for the ELF binary and the features that the loader should use +// Note that we currently hardcode the features to be used by the loader, +// so features isn't actually used yet. +type ELFLoaderCtx struct { + state protoimpl.MessageState `protogen:"open.v1"` + Elf *ELFBinary `protobuf:"bytes,1,opt,name=elf,proto3" json:"elf,omitempty"` + Features *context.FeatureSet `protobuf:"bytes,2,opt,name=features,proto3" json:"features,omitempty"` + DeployChecks bool `protobuf:"varint,4,opt,name=deploy_checks,json=deployChecks,proto3" json:"deploy_checks,omitempty"` + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache +} + +func (x *ELFLoaderCtx) Reset() { + *x = ELFLoaderCtx{} + mi := &file_elf_proto_msgTypes[1] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) +} + +func (x *ELFLoaderCtx) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*ELFLoaderCtx) ProtoMessage() {} + +func (x *ELFLoaderCtx) ProtoReflect() protoreflect.Message { + mi := &file_elf_proto_msgTypes[1] + if x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use ELFLoaderCtx.ProtoReflect.Descriptor instead. +func (*ELFLoaderCtx) Descriptor() ([]byte, []int) { + return file_elf_proto_rawDescGZIP(), []int{1} +} + +func (x *ELFLoaderCtx) GetElf() *ELFBinary { + if x != nil { + return x.Elf + } + return nil +} + +func (x *ELFLoaderCtx) GetFeatures() *context.FeatureSet { + if x != nil { + return x.Features + } + return nil +} + +func (x *ELFLoaderCtx) GetDeployChecks() bool { + if x != nil { + return x.DeployChecks + } + return false +} + +// Captures the results of a elf binary load. +// Structurally similar to fd_sbpf_program_t +type ELFLoaderEffects struct { + state protoimpl.MessageState `protogen:"open.v1"` + Rodata []byte `protobuf:"bytes,1,opt,name=rodata,proto3" json:"rodata,omitempty"` + RodataSz uint64 `protobuf:"varint,2,opt,name=rodata_sz,json=rodataSz,proto3" json:"rodata_sz,omitempty"` + // bytes text = 3; // not needed, just points to a region in rodata + TextCnt uint64 `protobuf:"varint,4,opt,name=text_cnt,json=textCnt,proto3" json:"text_cnt,omitempty"` + TextOff uint64 `protobuf:"varint,5,opt,name=text_off,json=textOff,proto3" json:"text_off,omitempty"` + EntryPc uint64 `protobuf:"varint,6,opt,name=entry_pc,json=entryPc,proto3" json:"entry_pc,omitempty"` + Calldests []uint64 `protobuf:"varint,7,rep,packed,name=calldests,proto3" json:"calldests,omitempty"` + Error int32 `protobuf:"varint,8,opt,name=error,proto3" json:"error,omitempty"` + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache +} + +func (x *ELFLoaderEffects) Reset() { + *x = ELFLoaderEffects{} + mi := &file_elf_proto_msgTypes[2] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) +} + +func (x *ELFLoaderEffects) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*ELFLoaderEffects) ProtoMessage() {} + +func (x *ELFLoaderEffects) ProtoReflect() protoreflect.Message { + mi := &file_elf_proto_msgTypes[2] + if x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use ELFLoaderEffects.ProtoReflect.Descriptor instead. +func (*ELFLoaderEffects) Descriptor() ([]byte, []int) { + return file_elf_proto_rawDescGZIP(), []int{2} +} + +func (x *ELFLoaderEffects) GetRodata() []byte { + if x != nil { + return x.Rodata + } + return nil +} + +func (x *ELFLoaderEffects) GetRodataSz() uint64 { + if x != nil { + return x.RodataSz + } + return 0 +} + +func (x *ELFLoaderEffects) GetTextCnt() uint64 { + if x != nil { + return x.TextCnt + } + return 0 +} + +func (x *ELFLoaderEffects) GetTextOff() uint64 { + if x != nil { + return x.TextOff + } + return 0 +} + +func (x *ELFLoaderEffects) GetEntryPc() uint64 { + if x != nil { + return x.EntryPc + } + return 0 +} + +func (x *ELFLoaderEffects) GetCalldests() []uint64 { + if x != nil { + return x.Calldests + } + return nil +} + +func (x *ELFLoaderEffects) GetError() int32 { + if x != nil { + return x.Error + } + return 0 +} + +type ELFLoaderFixture struct { + state protoimpl.MessageState `protogen:"open.v1"` + Metadata *metadata.FixtureMetadata `protobuf:"bytes,1,opt,name=metadata,proto3" json:"metadata,omitempty"` + Input *ELFLoaderCtx `protobuf:"bytes,2,opt,name=input,proto3" json:"input,omitempty"` + Output *ELFLoaderEffects `protobuf:"bytes,3,opt,name=output,proto3" json:"output,omitempty"` + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache +} + +func (x *ELFLoaderFixture) Reset() { + *x = ELFLoaderFixture{} + mi := &file_elf_proto_msgTypes[3] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) +} + +func (x *ELFLoaderFixture) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*ELFLoaderFixture) ProtoMessage() {} + +func (x *ELFLoaderFixture) ProtoReflect() protoreflect.Message { + mi := &file_elf_proto_msgTypes[3] + if x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use ELFLoaderFixture.ProtoReflect.Descriptor instead. +func (*ELFLoaderFixture) Descriptor() ([]byte, []int) { + return file_elf_proto_rawDescGZIP(), []int{3} +} + +func (x *ELFLoaderFixture) GetMetadata() *metadata.FixtureMetadata { + if x != nil { + return x.Metadata + } + return nil +} + +func (x *ELFLoaderFixture) GetInput() *ELFLoaderCtx { + if x != nil { + return x.Input + } + return nil +} + +func (x *ELFLoaderFixture) GetOutput() *ELFLoaderEffects { + if x != nil { + return x.Output + } + return nil +} + +var File_elf_proto protoreflect.FileDescriptor + +const file_elf_proto_rawDesc = "" + + "\n" + + "\telf.proto\x12\x16org.solana.sealevel.v1\x1a\rcontext.proto\x1a\x0emetadata.proto\"\x1f\n" + + "\tELFBinary\x12\x12\n" + + "\x04data\x18\x01 \x01(\fR\x04data\"\xa8\x01\n" + + "\fELFLoaderCtx\x123\n" + + "\x03elf\x18\x01 \x01(\v2!.org.solana.sealevel.v1.ELFBinaryR\x03elf\x12>\n" + + "\bfeatures\x18\x02 \x01(\v2\".org.solana.sealevel.v1.FeatureSetR\bfeatures\x12#\n" + + "\rdeploy_checks\x18\x04 \x01(\bR\fdeployChecks\"\xcc\x01\n" + + "\x10ELFLoaderEffects\x12\x16\n" + + "\x06rodata\x18\x01 \x01(\fR\x06rodata\x12\x1b\n" + + "\trodata_sz\x18\x02 \x01(\x04R\brodataSz\x12\x19\n" + + "\btext_cnt\x18\x04 \x01(\x04R\atextCnt\x12\x19\n" + + "\btext_off\x18\x05 \x01(\x04R\atextOff\x12\x19\n" + + "\bentry_pc\x18\x06 \x01(\x04R\aentryPc\x12\x1c\n" + + "\tcalldests\x18\a \x03(\x04R\tcalldests\x12\x14\n" + + "\x05error\x18\b \x01(\x05R\x05error\"\xd5\x01\n" + + "\x10ELFLoaderFixture\x12C\n" + + "\bmetadata\x18\x01 \x01(\v2'.org.solana.sealevel.v1.FixtureMetadataR\bmetadata\x12:\n" + + "\x05input\x18\x02 \x01(\v2$.org.solana.sealevel.v1.ELFLoaderCtxR\x05input\x12@\n" + + "\x06output\x18\x03 \x01(\v2(.org.solana.sealevel.v1.ELFLoaderEffectsR\x06outputb\x06proto3" + +var ( + file_elf_proto_rawDescOnce sync.Once + file_elf_proto_rawDescData []byte +) + +func file_elf_proto_rawDescGZIP() []byte { + file_elf_proto_rawDescOnce.Do(func() { + file_elf_proto_rawDescData = protoimpl.X.CompressGZIP(unsafe.Slice(unsafe.StringData(file_elf_proto_rawDesc), len(file_elf_proto_rawDesc))) + }) + return file_elf_proto_rawDescData +} + +var file_elf_proto_msgTypes = make([]protoimpl.MessageInfo, 4) +var file_elf_proto_goTypes = []any{ + (*ELFBinary)(nil), // 0: org.solana.sealevel.v1.ELFBinary + (*ELFLoaderCtx)(nil), // 1: org.solana.sealevel.v1.ELFLoaderCtx + (*ELFLoaderEffects)(nil), // 2: org.solana.sealevel.v1.ELFLoaderEffects + (*ELFLoaderFixture)(nil), // 3: org.solana.sealevel.v1.ELFLoaderFixture + (*context.FeatureSet)(nil), // 4: org.solana.sealevel.v1.FeatureSet + (*metadata.FixtureMetadata)(nil), // 5: org.solana.sealevel.v1.FixtureMetadata +} +var file_elf_proto_depIdxs = []int32{ + 0, // 0: org.solana.sealevel.v1.ELFLoaderCtx.elf:type_name -> org.solana.sealevel.v1.ELFBinary + 4, // 1: org.solana.sealevel.v1.ELFLoaderCtx.features:type_name -> org.solana.sealevel.v1.FeatureSet + 5, // 2: org.solana.sealevel.v1.ELFLoaderFixture.metadata:type_name -> org.solana.sealevel.v1.FixtureMetadata + 1, // 3: org.solana.sealevel.v1.ELFLoaderFixture.input:type_name -> org.solana.sealevel.v1.ELFLoaderCtx + 2, // 4: org.solana.sealevel.v1.ELFLoaderFixture.output:type_name -> org.solana.sealevel.v1.ELFLoaderEffects + 5, // [5:5] is the sub-list for method output_type + 5, // [5:5] is the sub-list for method input_type + 5, // [5:5] is the sub-list for extension type_name + 5, // [5:5] is the sub-list for extension extendee + 0, // [0:5] is the sub-list for field type_name +} + +func init() { file_elf_proto_init() } +func file_elf_proto_init() { + if File_elf_proto != nil { + return + } + type x struct{} + out := protoimpl.TypeBuilder{ + File: protoimpl.DescBuilder{ + GoPackagePath: reflect.TypeOf(x{}).PkgPath(), + RawDescriptor: unsafe.Slice(unsafe.StringData(file_elf_proto_rawDesc), len(file_elf_proto_rawDesc)), + NumEnums: 0, + NumMessages: 4, + NumExtensions: 0, + NumServices: 0, + }, + GoTypes: file_elf_proto_goTypes, + DependencyIndexes: file_elf_proto_depIdxs, + MessageInfos: file_elf_proto_msgTypes, + }.Build() + File_elf_proto = out.File + file_elf_proto_goTypes = nil + file_elf_proto_depIdxs = nil +} diff --git a/pkg/protosol-go/invoke/invoke.pb.go b/pkg/protosol-go/invoke/invoke.pb.go new file mode 100644 index 00000000..221109b6 --- /dev/null +++ b/pkg/protosol-go/invoke/invoke.pb.go @@ -0,0 +1,428 @@ +// Code generated by protoc-gen-go. DO NOT EDIT. +// versions: +// protoc-gen-go v1.36.10 +// protoc v6.32.1 +// source: invoke.proto + +package invoke + +import ( + protoreflect "google.golang.org/protobuf/reflect/protoreflect" + protoimpl "google.golang.org/protobuf/runtime/protoimpl" + context "github.com/Overclock-Validator/mithril/pkg/protosol-go/context" + metadata "github.com/Overclock-Validator/mithril/pkg/protosol-go/metadata" + reflect "reflect" + sync "sync" + unsafe "unsafe" +) + +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 InstrAcct struct { + state protoimpl.MessageState `protogen:"open.v1"` + // Selects an account in an external list + Index uint32 `protobuf:"varint,1,opt,name=index,proto3" json:"index,omitempty"` + IsWritable bool `protobuf:"varint,2,opt,name=is_writable,json=isWritable,proto3" json:"is_writable,omitempty"` + IsSigner bool `protobuf:"varint,3,opt,name=is_signer,json=isSigner,proto3" json:"is_signer,omitempty"` + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache +} + +func (x *InstrAcct) Reset() { + *x = InstrAcct{} + mi := &file_invoke_proto_msgTypes[0] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) +} + +func (x *InstrAcct) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*InstrAcct) ProtoMessage() {} + +func (x *InstrAcct) ProtoReflect() protoreflect.Message { + mi := &file_invoke_proto_msgTypes[0] + if x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use InstrAcct.ProtoReflect.Descriptor instead. +func (*InstrAcct) Descriptor() ([]byte, []int) { + return file_invoke_proto_rawDescGZIP(), []int{0} +} + +func (x *InstrAcct) GetIndex() uint32 { + if x != nil { + return x.Index + } + return 0 +} + +func (x *InstrAcct) GetIsWritable() bool { + if x != nil { + return x.IsWritable + } + return false +} + +func (x *InstrAcct) GetIsSigner() bool { + if x != nil { + return x.IsSigner + } + return false +} + +// The execution context of a program invocation (aka instruction). +// Contains all required information to independently replay an instruction. +// Also includes partial transaction context. +type InstrContext struct { + state protoimpl.MessageState `protogen:"open.v1"` + // The address of the program invoked. (32 bytes) + ProgramId []byte `protobuf:"bytes,1,opt,name=program_id,json=programId,proto3" json:"program_id,omitempty"` + // Account state accessed by the instruction. This may include + // indirect accesses like sysvars. + Accounts []*context.AcctState `protobuf:"bytes,3,rep,name=accounts,proto3" json:"accounts,omitempty"` + // Account access list for this instruction (refers to above accounts list) + InstrAccounts []*InstrAcct `protobuf:"bytes,4,rep,name=instr_accounts,json=instrAccounts,proto3" json:"instr_accounts,omitempty"` + // The input data passed to program execution. + Data []byte `protobuf:"bytes,5,opt,name=data,proto3" json:"data,omitempty"` + CuAvail uint64 `protobuf:"varint,6,opt,name=cu_avail,json=cuAvail,proto3" json:"cu_avail,omitempty"` + SlotContext *context.SlotContext `protobuf:"bytes,8,opt,name=slot_context,json=slotContext,proto3" json:"slot_context,omitempty"` + EpochContext *context.EpochContext `protobuf:"bytes,9,opt,name=epoch_context,json=epochContext,proto3" json:"epoch_context,omitempty"` + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache +} + +func (x *InstrContext) Reset() { + *x = InstrContext{} + mi := &file_invoke_proto_msgTypes[1] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) +} + +func (x *InstrContext) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*InstrContext) ProtoMessage() {} + +func (x *InstrContext) ProtoReflect() protoreflect.Message { + mi := &file_invoke_proto_msgTypes[1] + if x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use InstrContext.ProtoReflect.Descriptor instead. +func (*InstrContext) Descriptor() ([]byte, []int) { + return file_invoke_proto_rawDescGZIP(), []int{1} +} + +func (x *InstrContext) GetProgramId() []byte { + if x != nil { + return x.ProgramId + } + return nil +} + +func (x *InstrContext) GetAccounts() []*context.AcctState { + if x != nil { + return x.Accounts + } + return nil +} + +func (x *InstrContext) GetInstrAccounts() []*InstrAcct { + if x != nil { + return x.InstrAccounts + } + return nil +} + +func (x *InstrContext) GetData() []byte { + if x != nil { + return x.Data + } + return nil +} + +func (x *InstrContext) GetCuAvail() uint64 { + if x != nil { + return x.CuAvail + } + return 0 +} + +func (x *InstrContext) GetSlotContext() *context.SlotContext { + if x != nil { + return x.SlotContext + } + return nil +} + +func (x *InstrContext) GetEpochContext() *context.EpochContext { + if x != nil { + return x.EpochContext + } + return nil +} + +// The results of executing an InstrContext. +type InstrEffects struct { + state protoimpl.MessageState `protogen:"open.v1"` + // result is zero if the instruction executed succesfully. + // Otherwise, a non-zero error code. Error codes are not relevant to + // consensus. + Result int32 `protobuf:"varint,1,opt,name=result,proto3" json:"result,omitempty"` + // Some error cases additionally have a custom error code. Unlike + // the expected_result, this is stable across clients. + CustomErr uint32 `protobuf:"varint,2,opt,name=custom_err,json=customErr,proto3" json:"custom_err,omitempty"` + // Copies of accounts that were changed. May be in an arbitrary + // order. The pubkey of each account is unique in this list. Each + // account address modified here must also be in the + // InstrContext. + ModifiedAccounts []*context.AcctState `protobuf:"bytes,3,rep,name=modified_accounts,json=modifiedAccounts,proto3" json:"modified_accounts,omitempty"` + CuAvail uint64 `protobuf:"varint,4,opt,name=cu_avail,json=cuAvail,proto3" json:"cu_avail,omitempty"` + // Instruction return data. + ReturnData []byte `protobuf:"bytes,5,opt,name=return_data,json=returnData,proto3" json:"return_data,omitempty"` + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache +} + +func (x *InstrEffects) Reset() { + *x = InstrEffects{} + mi := &file_invoke_proto_msgTypes[2] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) +} + +func (x *InstrEffects) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*InstrEffects) ProtoMessage() {} + +func (x *InstrEffects) ProtoReflect() protoreflect.Message { + mi := &file_invoke_proto_msgTypes[2] + if x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use InstrEffects.ProtoReflect.Descriptor instead. +func (*InstrEffects) Descriptor() ([]byte, []int) { + return file_invoke_proto_rawDescGZIP(), []int{2} +} + +func (x *InstrEffects) GetResult() int32 { + if x != nil { + return x.Result + } + return 0 +} + +func (x *InstrEffects) GetCustomErr() uint32 { + if x != nil { + return x.CustomErr + } + return 0 +} + +func (x *InstrEffects) GetModifiedAccounts() []*context.AcctState { + if x != nil { + return x.ModifiedAccounts + } + return nil +} + +func (x *InstrEffects) GetCuAvail() uint64 { + if x != nil { + return x.CuAvail + } + return 0 +} + +func (x *InstrEffects) GetReturnData() []byte { + if x != nil { + return x.ReturnData + } + return nil +} + +// An instruction processing test fixture. +type InstrFixture struct { + state protoimpl.MessageState `protogen:"open.v1"` + Metadata *metadata.FixtureMetadata `protobuf:"bytes,1,opt,name=metadata,proto3" json:"metadata,omitempty"` + Input *InstrContext `protobuf:"bytes,2,opt,name=input,proto3" json:"input,omitempty"` + Output *InstrEffects `protobuf:"bytes,3,opt,name=output,proto3" json:"output,omitempty"` + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache +} + +func (x *InstrFixture) Reset() { + *x = InstrFixture{} + mi := &file_invoke_proto_msgTypes[3] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) +} + +func (x *InstrFixture) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*InstrFixture) ProtoMessage() {} + +func (x *InstrFixture) ProtoReflect() protoreflect.Message { + mi := &file_invoke_proto_msgTypes[3] + if x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use InstrFixture.ProtoReflect.Descriptor instead. +func (*InstrFixture) Descriptor() ([]byte, []int) { + return file_invoke_proto_rawDescGZIP(), []int{3} +} + +func (x *InstrFixture) GetMetadata() *metadata.FixtureMetadata { + if x != nil { + return x.Metadata + } + return nil +} + +func (x *InstrFixture) GetInput() *InstrContext { + if x != nil { + return x.Input + } + return nil +} + +func (x *InstrFixture) GetOutput() *InstrEffects { + if x != nil { + return x.Output + } + return nil +} + +var File_invoke_proto protoreflect.FileDescriptor + +const file_invoke_proto_rawDesc = "" + + "\n" + + "\finvoke.proto\x12\x16org.solana.sealevel.v1\x1a\rcontext.proto\x1a\x0emetadata.proto\"_\n" + + "\tInstrAcct\x12\x14\n" + + "\x05index\x18\x01 \x01(\rR\x05index\x12\x1f\n" + + "\vis_writable\x18\x02 \x01(\bR\n" + + "isWritable\x12\x1b\n" + + "\tis_signer\x18\x03 \x01(\bR\bisSigner\"\xf8\x02\n" + + "\fInstrContext\x12\x1d\n" + + "\n" + + "program_id\x18\x01 \x01(\fR\tprogramId\x12=\n" + + "\baccounts\x18\x03 \x03(\v2!.org.solana.sealevel.v1.AcctStateR\baccounts\x12H\n" + + "\x0einstr_accounts\x18\x04 \x03(\v2!.org.solana.sealevel.v1.InstrAcctR\rinstrAccounts\x12\x12\n" + + "\x04data\x18\x05 \x01(\fR\x04data\x12\x19\n" + + "\bcu_avail\x18\x06 \x01(\x04R\acuAvail\x12F\n" + + "\fslot_context\x18\b \x01(\v2#.org.solana.sealevel.v1.SlotContextR\vslotContext\x12I\n" + + "\repoch_context\x18\t \x01(\v2$.org.solana.sealevel.v1.EpochContextR\fepochContext\"\xd1\x01\n" + + "\fInstrEffects\x12\x16\n" + + "\x06result\x18\x01 \x01(\x05R\x06result\x12\x1d\n" + + "\n" + + "custom_err\x18\x02 \x01(\rR\tcustomErr\x12N\n" + + "\x11modified_accounts\x18\x03 \x03(\v2!.org.solana.sealevel.v1.AcctStateR\x10modifiedAccounts\x12\x19\n" + + "\bcu_avail\x18\x04 \x01(\x04R\acuAvail\x12\x1f\n" + + "\vreturn_data\x18\x05 \x01(\fR\n" + + "returnData\"\xcd\x01\n" + + "\fInstrFixture\x12C\n" + + "\bmetadata\x18\x01 \x01(\v2'.org.solana.sealevel.v1.FixtureMetadataR\bmetadata\x12:\n" + + "\x05input\x18\x02 \x01(\v2$.org.solana.sealevel.v1.InstrContextR\x05input\x12<\n" + + "\x06output\x18\x03 \x01(\v2$.org.solana.sealevel.v1.InstrEffectsR\x06outputb\x06proto3" + +var ( + file_invoke_proto_rawDescOnce sync.Once + file_invoke_proto_rawDescData []byte +) + +func file_invoke_proto_rawDescGZIP() []byte { + file_invoke_proto_rawDescOnce.Do(func() { + file_invoke_proto_rawDescData = protoimpl.X.CompressGZIP(unsafe.Slice(unsafe.StringData(file_invoke_proto_rawDesc), len(file_invoke_proto_rawDesc))) + }) + return file_invoke_proto_rawDescData +} + +var file_invoke_proto_msgTypes = make([]protoimpl.MessageInfo, 4) +var file_invoke_proto_goTypes = []any{ + (*InstrAcct)(nil), // 0: org.solana.sealevel.v1.InstrAcct + (*InstrContext)(nil), // 1: org.solana.sealevel.v1.InstrContext + (*InstrEffects)(nil), // 2: org.solana.sealevel.v1.InstrEffects + (*InstrFixture)(nil), // 3: org.solana.sealevel.v1.InstrFixture + (*context.AcctState)(nil), // 4: org.solana.sealevel.v1.AcctState + (*context.SlotContext)(nil), // 5: org.solana.sealevel.v1.SlotContext + (*context.EpochContext)(nil), // 6: org.solana.sealevel.v1.EpochContext + (*metadata.FixtureMetadata)(nil), // 7: org.solana.sealevel.v1.FixtureMetadata +} +var file_invoke_proto_depIdxs = []int32{ + 4, // 0: org.solana.sealevel.v1.InstrContext.accounts:type_name -> org.solana.sealevel.v1.AcctState + 0, // 1: org.solana.sealevel.v1.InstrContext.instr_accounts:type_name -> org.solana.sealevel.v1.InstrAcct + 5, // 2: org.solana.sealevel.v1.InstrContext.slot_context:type_name -> org.solana.sealevel.v1.SlotContext + 6, // 3: org.solana.sealevel.v1.InstrContext.epoch_context:type_name -> org.solana.sealevel.v1.EpochContext + 4, // 4: org.solana.sealevel.v1.InstrEffects.modified_accounts:type_name -> org.solana.sealevel.v1.AcctState + 7, // 5: org.solana.sealevel.v1.InstrFixture.metadata:type_name -> org.solana.sealevel.v1.FixtureMetadata + 1, // 6: org.solana.sealevel.v1.InstrFixture.input:type_name -> org.solana.sealevel.v1.InstrContext + 2, // 7: org.solana.sealevel.v1.InstrFixture.output:type_name -> org.solana.sealevel.v1.InstrEffects + 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_invoke_proto_init() } +func file_invoke_proto_init() { + if File_invoke_proto != nil { + return + } + type x struct{} + out := protoimpl.TypeBuilder{ + File: protoimpl.DescBuilder{ + GoPackagePath: reflect.TypeOf(x{}).PkgPath(), + RawDescriptor: unsafe.Slice(unsafe.StringData(file_invoke_proto_rawDesc), len(file_invoke_proto_rawDesc)), + NumEnums: 0, + NumMessages: 4, + NumExtensions: 0, + NumServices: 0, + }, + GoTypes: file_invoke_proto_goTypes, + DependencyIndexes: file_invoke_proto_depIdxs, + MessageInfos: file_invoke_proto_msgTypes, + }.Build() + File_invoke_proto = out.File + file_invoke_proto_goTypes = nil + file_invoke_proto_depIdxs = nil +} diff --git a/pkg/protosol-go/metadata/metadata.pb.go b/pkg/protosol-go/metadata/metadata.pb.go new file mode 100644 index 00000000..6001616b --- /dev/null +++ b/pkg/protosol-go/metadata/metadata.pb.go @@ -0,0 +1,123 @@ +// Code generated by protoc-gen-go. DO NOT EDIT. +// versions: +// protoc-gen-go v1.36.10 +// protoc v6.32.1 +// source: metadata.proto + +package metadata + +import ( + protoreflect "google.golang.org/protobuf/reflect/protoreflect" + protoimpl "google.golang.org/protobuf/runtime/protoimpl" + reflect "reflect" + sync "sync" + unsafe "unsafe" +) + +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) +) + +// FixtureMetadata includes the metadata for the fixture +type FixtureMetadata struct { + state protoimpl.MessageState `protogen:"open.v1"` + FnEntrypoint string `protobuf:"bytes,1,opt,name=fn_entrypoint,json=fnEntrypoint,proto3" json:"fn_entrypoint,omitempty"` + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache +} + +func (x *FixtureMetadata) Reset() { + *x = FixtureMetadata{} + mi := &file_metadata_proto_msgTypes[0] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) +} + +func (x *FixtureMetadata) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*FixtureMetadata) ProtoMessage() {} + +func (x *FixtureMetadata) ProtoReflect() protoreflect.Message { + mi := &file_metadata_proto_msgTypes[0] + if x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use FixtureMetadata.ProtoReflect.Descriptor instead. +func (*FixtureMetadata) Descriptor() ([]byte, []int) { + return file_metadata_proto_rawDescGZIP(), []int{0} +} + +func (x *FixtureMetadata) GetFnEntrypoint() string { + if x != nil { + return x.FnEntrypoint + } + return "" +} + +var File_metadata_proto protoreflect.FileDescriptor + +const file_metadata_proto_rawDesc = "" + + "\n" + + "\x0emetadata.proto\x12\x16org.solana.sealevel.v1\"6\n" + + "\x0fFixtureMetadata\x12#\n" + + "\rfn_entrypoint\x18\x01 \x01(\tR\ffnEntrypointb\x06proto3" + +var ( + file_metadata_proto_rawDescOnce sync.Once + file_metadata_proto_rawDescData []byte +) + +func file_metadata_proto_rawDescGZIP() []byte { + file_metadata_proto_rawDescOnce.Do(func() { + file_metadata_proto_rawDescData = protoimpl.X.CompressGZIP(unsafe.Slice(unsafe.StringData(file_metadata_proto_rawDesc), len(file_metadata_proto_rawDesc))) + }) + return file_metadata_proto_rawDescData +} + +var file_metadata_proto_msgTypes = make([]protoimpl.MessageInfo, 1) +var file_metadata_proto_goTypes = []any{ + (*FixtureMetadata)(nil), // 0: org.solana.sealevel.v1.FixtureMetadata +} +var file_metadata_proto_depIdxs = []int32{ + 0, // [0:0] is the sub-list for method output_type + 0, // [0:0] is the sub-list for method input_type + 0, // [0:0] is the sub-list for extension type_name + 0, // [0:0] is the sub-list for extension extendee + 0, // [0:0] is the sub-list for field type_name +} + +func init() { file_metadata_proto_init() } +func file_metadata_proto_init() { + if File_metadata_proto != nil { + return + } + type x struct{} + out := protoimpl.TypeBuilder{ + File: protoimpl.DescBuilder{ + GoPackagePath: reflect.TypeOf(x{}).PkgPath(), + RawDescriptor: unsafe.Slice(unsafe.StringData(file_metadata_proto_rawDesc), len(file_metadata_proto_rawDesc)), + NumEnums: 0, + NumMessages: 1, + NumExtensions: 0, + NumServices: 0, + }, + GoTypes: file_metadata_proto_goTypes, + DependencyIndexes: file_metadata_proto_depIdxs, + MessageInfos: file_metadata_proto_msgTypes, + }.Build() + File_metadata_proto = out.File + file_metadata_proto_goTypes = nil + file_metadata_proto_depIdxs = nil +} diff --git a/pkg/protosol-go/pack/pack.pb.go b/pkg/protosol-go/pack/pack.pb.go new file mode 100644 index 00000000..b23bf5c9 --- /dev/null +++ b/pkg/protosol-go/pack/pack.pb.go @@ -0,0 +1,290 @@ +// Code generated by protoc-gen-go. DO NOT EDIT. +// versions: +// protoc-gen-go v1.36.10 +// protoc v6.32.1 +// source: pack.proto + +package pack + +import ( + protoreflect "google.golang.org/protobuf/reflect/protoreflect" + protoimpl "google.golang.org/protobuf/runtime/protoimpl" + context "github.com/Overclock-Validator/mithril/pkg/protosol-go/context" + metadata "github.com/Overclock-Validator/mithril/pkg/protosol-go/metadata" + reflect "reflect" + sync "sync" + unsafe "unsafe" +) + +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 PackComputeBudgetContext struct { + state protoimpl.MessageState `protogen:"open.v1"` + InstrDatas [][]byte `protobuf:"bytes,1,rep,name=instr_datas,json=instrDatas,proto3" json:"instr_datas,omitempty"` + Features *context.FeatureSet `protobuf:"bytes,2,opt,name=features,proto3" json:"features,omitempty"` + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache +} + +func (x *PackComputeBudgetContext) Reset() { + *x = PackComputeBudgetContext{} + mi := &file_pack_proto_msgTypes[0] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) +} + +func (x *PackComputeBudgetContext) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*PackComputeBudgetContext) ProtoMessage() {} + +func (x *PackComputeBudgetContext) ProtoReflect() protoreflect.Message { + mi := &file_pack_proto_msgTypes[0] + if x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use PackComputeBudgetContext.ProtoReflect.Descriptor instead. +func (*PackComputeBudgetContext) Descriptor() ([]byte, []int) { + return file_pack_proto_rawDescGZIP(), []int{0} +} + +func (x *PackComputeBudgetContext) GetInstrDatas() [][]byte { + if x != nil { + return x.InstrDatas + } + return nil +} + +func (x *PackComputeBudgetContext) GetFeatures() *context.FeatureSet { + if x != nil { + return x.Features + } + return nil +} + +type PackComputeBudgetEffects struct { + state protoimpl.MessageState `protogen:"open.v1"` + ComputeUnitLimit uint64 `protobuf:"varint,1,opt,name=compute_unit_limit,json=computeUnitLimit,proto3" json:"compute_unit_limit,omitempty"` + Rewards uint64 `protobuf:"varint,2,opt,name=rewards,proto3" json:"rewards,omitempty"` + HeapSz uint32 `protobuf:"varint,3,opt,name=heap_sz,json=heapSz,proto3" json:"heap_sz,omitempty"` + LoadedAcctDataSz uint32 `protobuf:"varint,4,opt,name=loaded_acct_data_sz,json=loadedAcctDataSz,proto3" json:"loaded_acct_data_sz,omitempty"` + // To prevent empty effects when encoding a "skipped" effects + IsEmpty uint32 `protobuf:"varint,5,opt,name=is_empty,json=isEmpty,proto3" json:"is_empty,omitempty"` + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache +} + +func (x *PackComputeBudgetEffects) Reset() { + *x = PackComputeBudgetEffects{} + mi := &file_pack_proto_msgTypes[1] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) +} + +func (x *PackComputeBudgetEffects) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*PackComputeBudgetEffects) ProtoMessage() {} + +func (x *PackComputeBudgetEffects) ProtoReflect() protoreflect.Message { + mi := &file_pack_proto_msgTypes[1] + if x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use PackComputeBudgetEffects.ProtoReflect.Descriptor instead. +func (*PackComputeBudgetEffects) Descriptor() ([]byte, []int) { + return file_pack_proto_rawDescGZIP(), []int{1} +} + +func (x *PackComputeBudgetEffects) GetComputeUnitLimit() uint64 { + if x != nil { + return x.ComputeUnitLimit + } + return 0 +} + +func (x *PackComputeBudgetEffects) GetRewards() uint64 { + if x != nil { + return x.Rewards + } + return 0 +} + +func (x *PackComputeBudgetEffects) GetHeapSz() uint32 { + if x != nil { + return x.HeapSz + } + return 0 +} + +func (x *PackComputeBudgetEffects) GetLoadedAcctDataSz() uint32 { + if x != nil { + return x.LoadedAcctDataSz + } + return 0 +} + +func (x *PackComputeBudgetEffects) GetIsEmpty() uint32 { + if x != nil { + return x.IsEmpty + } + return 0 +} + +type PackComputeBudgetFixture struct { + state protoimpl.MessageState `protogen:"open.v1"` + Metadata *metadata.FixtureMetadata `protobuf:"bytes,1,opt,name=metadata,proto3" json:"metadata,omitempty"` + Input *PackComputeBudgetContext `protobuf:"bytes,2,opt,name=input,proto3" json:"input,omitempty"` + Output *PackComputeBudgetEffects `protobuf:"bytes,3,opt,name=output,proto3" json:"output,omitempty"` + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache +} + +func (x *PackComputeBudgetFixture) Reset() { + *x = PackComputeBudgetFixture{} + mi := &file_pack_proto_msgTypes[2] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) +} + +func (x *PackComputeBudgetFixture) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*PackComputeBudgetFixture) ProtoMessage() {} + +func (x *PackComputeBudgetFixture) ProtoReflect() protoreflect.Message { + mi := &file_pack_proto_msgTypes[2] + if x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use PackComputeBudgetFixture.ProtoReflect.Descriptor instead. +func (*PackComputeBudgetFixture) Descriptor() ([]byte, []int) { + return file_pack_proto_rawDescGZIP(), []int{2} +} + +func (x *PackComputeBudgetFixture) GetMetadata() *metadata.FixtureMetadata { + if x != nil { + return x.Metadata + } + return nil +} + +func (x *PackComputeBudgetFixture) GetInput() *PackComputeBudgetContext { + if x != nil { + return x.Input + } + return nil +} + +func (x *PackComputeBudgetFixture) GetOutput() *PackComputeBudgetEffects { + if x != nil { + return x.Output + } + return nil +} + +var File_pack_proto protoreflect.FileDescriptor + +const file_pack_proto_rawDesc = "" + + "\n" + + "\n" + + "pack.proto\x12\x16org.solana.sealevel.v1\x1a\x0emetadata.proto\x1a\rcontext.proto\"{\n" + + "\x18PackComputeBudgetContext\x12\x1f\n" + + "\vinstr_datas\x18\x01 \x03(\fR\n" + + "instrDatas\x12>\n" + + "\bfeatures\x18\x02 \x01(\v2\".org.solana.sealevel.v1.FeatureSetR\bfeatures\"\xc5\x01\n" + + "\x18PackComputeBudgetEffects\x12,\n" + + "\x12compute_unit_limit\x18\x01 \x01(\x04R\x10computeUnitLimit\x12\x18\n" + + "\arewards\x18\x02 \x01(\x04R\arewards\x12\x17\n" + + "\aheap_sz\x18\x03 \x01(\rR\x06heapSz\x12-\n" + + "\x13loaded_acct_data_sz\x18\x04 \x01(\rR\x10loadedAcctDataSz\x12\x19\n" + + "\bis_empty\x18\x05 \x01(\rR\aisEmpty\"\xf1\x01\n" + + "\x18PackComputeBudgetFixture\x12C\n" + + "\bmetadata\x18\x01 \x01(\v2'.org.solana.sealevel.v1.FixtureMetadataR\bmetadata\x12F\n" + + "\x05input\x18\x02 \x01(\v20.org.solana.sealevel.v1.PackComputeBudgetContextR\x05input\x12H\n" + + "\x06output\x18\x03 \x01(\v20.org.solana.sealevel.v1.PackComputeBudgetEffectsR\x06outputb\x06proto3" + +var ( + file_pack_proto_rawDescOnce sync.Once + file_pack_proto_rawDescData []byte +) + +func file_pack_proto_rawDescGZIP() []byte { + file_pack_proto_rawDescOnce.Do(func() { + file_pack_proto_rawDescData = protoimpl.X.CompressGZIP(unsafe.Slice(unsafe.StringData(file_pack_proto_rawDesc), len(file_pack_proto_rawDesc))) + }) + return file_pack_proto_rawDescData +} + +var file_pack_proto_msgTypes = make([]protoimpl.MessageInfo, 3) +var file_pack_proto_goTypes = []any{ + (*PackComputeBudgetContext)(nil), // 0: org.solana.sealevel.v1.PackComputeBudgetContext + (*PackComputeBudgetEffects)(nil), // 1: org.solana.sealevel.v1.PackComputeBudgetEffects + (*PackComputeBudgetFixture)(nil), // 2: org.solana.sealevel.v1.PackComputeBudgetFixture + (*context.FeatureSet)(nil), // 3: org.solana.sealevel.v1.FeatureSet + (*metadata.FixtureMetadata)(nil), // 4: org.solana.sealevel.v1.FixtureMetadata +} +var file_pack_proto_depIdxs = []int32{ + 3, // 0: org.solana.sealevel.v1.PackComputeBudgetContext.features:type_name -> org.solana.sealevel.v1.FeatureSet + 4, // 1: org.solana.sealevel.v1.PackComputeBudgetFixture.metadata:type_name -> org.solana.sealevel.v1.FixtureMetadata + 0, // 2: org.solana.sealevel.v1.PackComputeBudgetFixture.input:type_name -> org.solana.sealevel.v1.PackComputeBudgetContext + 1, // 3: org.solana.sealevel.v1.PackComputeBudgetFixture.output:type_name -> org.solana.sealevel.v1.PackComputeBudgetEffects + 4, // [4:4] is the sub-list for method output_type + 4, // [4:4] is the sub-list for method input_type + 4, // [4:4] is the sub-list for extension type_name + 4, // [4:4] is the sub-list for extension extendee + 0, // [0:4] is the sub-list for field type_name +} + +func init() { file_pack_proto_init() } +func file_pack_proto_init() { + if File_pack_proto != nil { + return + } + type x struct{} + out := protoimpl.TypeBuilder{ + File: protoimpl.DescBuilder{ + GoPackagePath: reflect.TypeOf(x{}).PkgPath(), + RawDescriptor: unsafe.Slice(unsafe.StringData(file_pack_proto_rawDesc), len(file_pack_proto_rawDesc)), + NumEnums: 0, + NumMessages: 3, + NumExtensions: 0, + NumServices: 0, + }, + GoTypes: file_pack_proto_goTypes, + DependencyIndexes: file_pack_proto_depIdxs, + MessageInfos: file_pack_proto_msgTypes, + }.Build() + File_pack_proto = out.File + file_pack_proto_goTypes = nil + file_pack_proto_depIdxs = nil +} diff --git a/pkg/protosol-go/serialize/serialize.pb.go b/pkg/protosol-go/serialize/serialize.pb.go new file mode 100644 index 00000000..5c54ec3e --- /dev/null +++ b/pkg/protosol-go/serialize/serialize.pb.go @@ -0,0 +1,198 @@ +// Code generated by protoc-gen-go. DO NOT EDIT. +// versions: +// protoc-gen-go v1.36.10 +// protoc v6.32.1 +// source: serialize.proto + +package serialize + +import ( + protoreflect "google.golang.org/protobuf/reflect/protoreflect" + protoimpl "google.golang.org/protobuf/runtime/protoimpl" + reflect "reflect" + sync "sync" + unsafe "unsafe" +) + +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 VmMemRegion struct { + state protoimpl.MessageState `protogen:"open.v1"` + VmAddr uint64 `protobuf:"varint,1,opt,name=vm_addr,json=vmAddr,proto3" json:"vm_addr,omitempty"` + Content []byte `protobuf:"bytes,2,opt,name=content,proto3" json:"content,omitempty"` + IsWritable bool `protobuf:"varint,3,opt,name=is_writable,json=isWritable,proto3" json:"is_writable,omitempty"` + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache +} + +func (x *VmMemRegion) Reset() { + *x = VmMemRegion{} + mi := &file_serialize_proto_msgTypes[0] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) +} + +func (x *VmMemRegion) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*VmMemRegion) ProtoMessage() {} + +func (x *VmMemRegion) ProtoReflect() protoreflect.Message { + mi := &file_serialize_proto_msgTypes[0] + if x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use VmMemRegion.ProtoReflect.Descriptor instead. +func (*VmMemRegion) Descriptor() ([]byte, []int) { + return file_serialize_proto_rawDescGZIP(), []int{0} +} + +func (x *VmMemRegion) GetVmAddr() uint64 { + if x != nil { + return x.VmAddr + } + return 0 +} + +func (x *VmMemRegion) GetContent() []byte { + if x != nil { + return x.Content + } + return nil +} + +func (x *VmMemRegion) GetIsWritable() bool { + if x != nil { + return x.IsWritable + } + return false +} + +type InstrSerializeResult struct { + state protoimpl.MessageState `protogen:"open.v1"` + Result int32 `protobuf:"varint,1,opt,name=result,proto3" json:"result,omitempty"` + Regions []*VmMemRegion `protobuf:"bytes,2,rep,name=regions,proto3" json:"regions,omitempty"` + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache +} + +func (x *InstrSerializeResult) Reset() { + *x = InstrSerializeResult{} + mi := &file_serialize_proto_msgTypes[1] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) +} + +func (x *InstrSerializeResult) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*InstrSerializeResult) ProtoMessage() {} + +func (x *InstrSerializeResult) ProtoReflect() protoreflect.Message { + mi := &file_serialize_proto_msgTypes[1] + if x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use InstrSerializeResult.ProtoReflect.Descriptor instead. +func (*InstrSerializeResult) Descriptor() ([]byte, []int) { + return file_serialize_proto_rawDescGZIP(), []int{1} +} + +func (x *InstrSerializeResult) GetResult() int32 { + if x != nil { + return x.Result + } + return 0 +} + +func (x *InstrSerializeResult) GetRegions() []*VmMemRegion { + if x != nil { + return x.Regions + } + return nil +} + +var File_serialize_proto protoreflect.FileDescriptor + +const file_serialize_proto_rawDesc = "" + + "\n" + + "\x0fserialize.proto\x12\x16org.solana.sealevel.v1\"a\n" + + "\vVmMemRegion\x12\x17\n" + + "\avm_addr\x18\x01 \x01(\x04R\x06vmAddr\x12\x18\n" + + "\acontent\x18\x02 \x01(\fR\acontent\x12\x1f\n" + + "\vis_writable\x18\x03 \x01(\bR\n" + + "isWritable\"m\n" + + "\x14InstrSerializeResult\x12\x16\n" + + "\x06result\x18\x01 \x01(\x05R\x06result\x12=\n" + + "\aregions\x18\x02 \x03(\v2#.org.solana.sealevel.v1.VmMemRegionR\aregionsb\x06proto3" + +var ( + file_serialize_proto_rawDescOnce sync.Once + file_serialize_proto_rawDescData []byte +) + +func file_serialize_proto_rawDescGZIP() []byte { + file_serialize_proto_rawDescOnce.Do(func() { + file_serialize_proto_rawDescData = protoimpl.X.CompressGZIP(unsafe.Slice(unsafe.StringData(file_serialize_proto_rawDesc), len(file_serialize_proto_rawDesc))) + }) + return file_serialize_proto_rawDescData +} + +var file_serialize_proto_msgTypes = make([]protoimpl.MessageInfo, 2) +var file_serialize_proto_goTypes = []any{ + (*VmMemRegion)(nil), // 0: org.solana.sealevel.v1.VmMemRegion + (*InstrSerializeResult)(nil), // 1: org.solana.sealevel.v1.InstrSerializeResult +} +var file_serialize_proto_depIdxs = []int32{ + 0, // 0: org.solana.sealevel.v1.InstrSerializeResult.regions:type_name -> org.solana.sealevel.v1.VmMemRegion + 1, // [1:1] is the sub-list for method output_type + 1, // [1:1] is the sub-list for method input_type + 1, // [1:1] is the sub-list for extension type_name + 1, // [1:1] is the sub-list for extension extendee + 0, // [0:1] is the sub-list for field type_name +} + +func init() { file_serialize_proto_init() } +func file_serialize_proto_init() { + if File_serialize_proto != nil { + return + } + type x struct{} + out := protoimpl.TypeBuilder{ + File: protoimpl.DescBuilder{ + GoPackagePath: reflect.TypeOf(x{}).PkgPath(), + RawDescriptor: unsafe.Slice(unsafe.StringData(file_serialize_proto_rawDesc), len(file_serialize_proto_rawDesc)), + NumEnums: 0, + NumMessages: 2, + NumExtensions: 0, + NumServices: 0, + }, + GoTypes: file_serialize_proto_goTypes, + DependencyIndexes: file_serialize_proto_depIdxs, + MessageInfos: file_serialize_proto_msgTypes, + }.Build() + File_serialize_proto = out.File + file_serialize_proto_goTypes = nil + file_serialize_proto_depIdxs = nil +} diff --git a/pkg/protosol-go/shred/shred.pb.go b/pkg/protosol-go/shred/shred.pb.go new file mode 100644 index 00000000..8e3822c2 --- /dev/null +++ b/pkg/protosol-go/shred/shred.pb.go @@ -0,0 +1,453 @@ +// Code generated by protoc-gen-go. DO NOT EDIT. +// versions: +// protoc-gen-go v1.36.10 +// protoc v6.32.1 +// source: shred.proto + +package shred + +import ( + protoreflect "google.golang.org/protobuf/reflect/protoreflect" + protoimpl "google.golang.org/protobuf/runtime/protoimpl" + reflect "reflect" + sync "sync" + unsafe "unsafe" +) + +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) +) + +// raw bytes to test shred parsing +type ShredBinary struct { + state protoimpl.MessageState `protogen:"open.v1"` + Data []byte `protobuf:"bytes,1,opt,name=data,proto3" json:"data,omitempty"` + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache +} + +func (x *ShredBinary) Reset() { + *x = ShredBinary{} + mi := &file_shred_proto_msgTypes[0] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) +} + +func (x *ShredBinary) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*ShredBinary) ProtoMessage() {} + +func (x *ShredBinary) ProtoReflect() protoreflect.Message { + mi := &file_shred_proto_msgTypes[0] + if x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use ShredBinary.ProtoReflect.Descriptor instead. +func (*ShredBinary) Descriptor() ([]byte, []int) { + return file_shred_proto_rawDescGZIP(), []int{0} +} + +func (x *ShredBinary) GetData() []byte { + if x != nil { + return x.Data + } + return nil +} + +type DataHeader struct { + state protoimpl.MessageState `protogen:"open.v1"` + ParentOff uint32 `protobuf:"varint,1,opt,name=parent_off,json=parentOff,proto3" json:"parent_off,omitempty"` + Flags uint32 `protobuf:"varint,2,opt,name=flags,proto3" json:"flags,omitempty"` + Size uint32 `protobuf:"varint,3,opt,name=size,proto3" json:"size,omitempty"` + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache +} + +func (x *DataHeader) Reset() { + *x = DataHeader{} + mi := &file_shred_proto_msgTypes[1] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) +} + +func (x *DataHeader) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*DataHeader) ProtoMessage() {} + +func (x *DataHeader) ProtoReflect() protoreflect.Message { + mi := &file_shred_proto_msgTypes[1] + if x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use DataHeader.ProtoReflect.Descriptor instead. +func (*DataHeader) Descriptor() ([]byte, []int) { + return file_shred_proto_rawDescGZIP(), []int{1} +} + +func (x *DataHeader) GetParentOff() uint32 { + if x != nil { + return x.ParentOff + } + return 0 +} + +func (x *DataHeader) GetFlags() uint32 { + if x != nil { + return x.Flags + } + return 0 +} + +func (x *DataHeader) GetSize() uint32 { + if x != nil { + return x.Size + } + return 0 +} + +type CodeHeader struct { + state protoimpl.MessageState `protogen:"open.v1"` + DataCnt uint32 `protobuf:"varint,1,opt,name=data_cnt,json=dataCnt,proto3" json:"data_cnt,omitempty"` + CodeCnt uint32 `protobuf:"varint,2,opt,name=code_cnt,json=codeCnt,proto3" json:"code_cnt,omitempty"` + Idx uint32 `protobuf:"varint,3,opt,name=idx,proto3" json:"idx,omitempty"` + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache +} + +func (x *CodeHeader) Reset() { + *x = CodeHeader{} + mi := &file_shred_proto_msgTypes[2] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) +} + +func (x *CodeHeader) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*CodeHeader) ProtoMessage() {} + +func (x *CodeHeader) ProtoReflect() protoreflect.Message { + mi := &file_shred_proto_msgTypes[2] + if x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use CodeHeader.ProtoReflect.Descriptor instead. +func (*CodeHeader) Descriptor() ([]byte, []int) { + return file_shred_proto_rawDescGZIP(), []int{2} +} + +func (x *CodeHeader) GetDataCnt() uint32 { + if x != nil { + return x.DataCnt + } + return 0 +} + +func (x *CodeHeader) GetCodeCnt() uint32 { + if x != nil { + return x.CodeCnt + } + return 0 +} + +func (x *CodeHeader) GetIdx() uint32 { + if x != nil { + return x.Idx + } + return 0 +} + +type ParsedShred struct { + state protoimpl.MessageState `protogen:"open.v1"` + Signature string `protobuf:"bytes,1,opt,name=signature,proto3" json:"signature,omitempty"` + Variant uint32 `protobuf:"varint,2,opt,name=variant,proto3" json:"variant,omitempty"` + Slot uint64 `protobuf:"varint,3,opt,name=slot,proto3" json:"slot,omitempty"` + Idx uint32 `protobuf:"varint,4,opt,name=idx,proto3" json:"idx,omitempty"` + Version uint32 `protobuf:"varint,5,opt,name=version,proto3" json:"version,omitempty"` + FecSetIdx uint32 `protobuf:"varint,6,opt,name=fec_set_idx,json=fecSetIdx,proto3" json:"fec_set_idx,omitempty"` + // Types that are valid to be assigned to ShredType: + // + // *ParsedShred_Data + // *ParsedShred_Code + ShredType isParsedShred_ShredType `protobuf_oneof:"shred_type"` + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache +} + +func (x *ParsedShred) Reset() { + *x = ParsedShred{} + mi := &file_shred_proto_msgTypes[3] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) +} + +func (x *ParsedShred) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*ParsedShred) ProtoMessage() {} + +func (x *ParsedShred) ProtoReflect() protoreflect.Message { + mi := &file_shred_proto_msgTypes[3] + if x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use ParsedShred.ProtoReflect.Descriptor instead. +func (*ParsedShred) Descriptor() ([]byte, []int) { + return file_shred_proto_rawDescGZIP(), []int{3} +} + +func (x *ParsedShred) GetSignature() string { + if x != nil { + return x.Signature + } + return "" +} + +func (x *ParsedShred) GetVariant() uint32 { + if x != nil { + return x.Variant + } + return 0 +} + +func (x *ParsedShred) GetSlot() uint64 { + if x != nil { + return x.Slot + } + return 0 +} + +func (x *ParsedShred) GetIdx() uint32 { + if x != nil { + return x.Idx + } + return 0 +} + +func (x *ParsedShred) GetVersion() uint32 { + if x != nil { + return x.Version + } + return 0 +} + +func (x *ParsedShred) GetFecSetIdx() uint32 { + if x != nil { + return x.FecSetIdx + } + return 0 +} + +func (x *ParsedShred) GetShredType() isParsedShred_ShredType { + if x != nil { + return x.ShredType + } + return nil +} + +func (x *ParsedShred) GetData() *DataHeader { + if x != nil { + if x, ok := x.ShredType.(*ParsedShred_Data); ok { + return x.Data + } + } + return nil +} + +func (x *ParsedShred) GetCode() *CodeHeader { + if x != nil { + if x, ok := x.ShredType.(*ParsedShred_Code); ok { + return x.Code + } + } + return nil +} + +type isParsedShred_ShredType interface { + isParsedShred_ShredType() +} + +type ParsedShred_Data struct { + Data *DataHeader `protobuf:"bytes,7,opt,name=data,proto3,oneof"` +} + +type ParsedShred_Code struct { + Code *CodeHeader `protobuf:"bytes,8,opt,name=code,proto3,oneof"` +} + +func (*ParsedShred_Data) isParsedShred_ShredType() {} + +func (*ParsedShred_Code) isParsedShred_ShredType() {} + +// If shred is accepted after parseing. This is all we are interested in +// between Firedancer and Agave. +type AcceptsShred struct { + state protoimpl.MessageState `protogen:"open.v1"` + Valid bool `protobuf:"varint,1,opt,name=valid,proto3" json:"valid,omitempty"` + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache +} + +func (x *AcceptsShred) Reset() { + *x = AcceptsShred{} + mi := &file_shred_proto_msgTypes[4] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) +} + +func (x *AcceptsShred) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*AcceptsShred) ProtoMessage() {} + +func (x *AcceptsShred) ProtoReflect() protoreflect.Message { + mi := &file_shred_proto_msgTypes[4] + if x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use AcceptsShred.ProtoReflect.Descriptor instead. +func (*AcceptsShred) Descriptor() ([]byte, []int) { + return file_shred_proto_rawDescGZIP(), []int{4} +} + +func (x *AcceptsShred) GetValid() bool { + if x != nil { + return x.Valid + } + return false +} + +var File_shred_proto protoreflect.FileDescriptor + +const file_shred_proto_rawDesc = "" + + "\n" + + "\vshred.proto\x12\x16org.solana.sealevel.v1\"!\n" + + "\vShredBinary\x12\x12\n" + + "\x04data\x18\x01 \x01(\fR\x04data\"U\n" + + "\n" + + "DataHeader\x12\x1d\n" + + "\n" + + "parent_off\x18\x01 \x01(\rR\tparentOff\x12\x14\n" + + "\x05flags\x18\x02 \x01(\rR\x05flags\x12\x12\n" + + "\x04size\x18\x03 \x01(\rR\x04size\"T\n" + + "\n" + + "CodeHeader\x12\x19\n" + + "\bdata_cnt\x18\x01 \x01(\rR\adataCnt\x12\x19\n" + + "\bcode_cnt\x18\x02 \x01(\rR\acodeCnt\x12\x10\n" + + "\x03idx\x18\x03 \x01(\rR\x03idx\"\xa7\x02\n" + + "\vParsedShred\x12\x1c\n" + + "\tsignature\x18\x01 \x01(\tR\tsignature\x12\x18\n" + + "\avariant\x18\x02 \x01(\rR\avariant\x12\x12\n" + + "\x04slot\x18\x03 \x01(\x04R\x04slot\x12\x10\n" + + "\x03idx\x18\x04 \x01(\rR\x03idx\x12\x18\n" + + "\aversion\x18\x05 \x01(\rR\aversion\x12\x1e\n" + + "\vfec_set_idx\x18\x06 \x01(\rR\tfecSetIdx\x128\n" + + "\x04data\x18\a \x01(\v2\".org.solana.sealevel.v1.DataHeaderH\x00R\x04data\x128\n" + + "\x04code\x18\b \x01(\v2\".org.solana.sealevel.v1.CodeHeaderH\x00R\x04codeB\f\n" + + "\n" + + "shred_type\"$\n" + + "\fAcceptsShred\x12\x14\n" + + "\x05valid\x18\x01 \x01(\bR\x05validb\x06proto3" + +var ( + file_shred_proto_rawDescOnce sync.Once + file_shred_proto_rawDescData []byte +) + +func file_shred_proto_rawDescGZIP() []byte { + file_shred_proto_rawDescOnce.Do(func() { + file_shred_proto_rawDescData = protoimpl.X.CompressGZIP(unsafe.Slice(unsafe.StringData(file_shred_proto_rawDesc), len(file_shred_proto_rawDesc))) + }) + return file_shred_proto_rawDescData +} + +var file_shred_proto_msgTypes = make([]protoimpl.MessageInfo, 5) +var file_shred_proto_goTypes = []any{ + (*ShredBinary)(nil), // 0: org.solana.sealevel.v1.ShredBinary + (*DataHeader)(nil), // 1: org.solana.sealevel.v1.DataHeader + (*CodeHeader)(nil), // 2: org.solana.sealevel.v1.CodeHeader + (*ParsedShred)(nil), // 3: org.solana.sealevel.v1.ParsedShred + (*AcceptsShred)(nil), // 4: org.solana.sealevel.v1.AcceptsShred +} +var file_shred_proto_depIdxs = []int32{ + 1, // 0: org.solana.sealevel.v1.ParsedShred.data:type_name -> org.solana.sealevel.v1.DataHeader + 2, // 1: org.solana.sealevel.v1.ParsedShred.code:type_name -> org.solana.sealevel.v1.CodeHeader + 2, // [2:2] is the sub-list for method output_type + 2, // [2:2] is the sub-list for method input_type + 2, // [2:2] is the sub-list for extension type_name + 2, // [2:2] is the sub-list for extension extendee + 0, // [0:2] is the sub-list for field type_name +} + +func init() { file_shred_proto_init() } +func file_shred_proto_init() { + if File_shred_proto != nil { + return + } + file_shred_proto_msgTypes[3].OneofWrappers = []any{ + (*ParsedShred_Data)(nil), + (*ParsedShred_Code)(nil), + } + type x struct{} + out := protoimpl.TypeBuilder{ + File: protoimpl.DescBuilder{ + GoPackagePath: reflect.TypeOf(x{}).PkgPath(), + RawDescriptor: unsafe.Slice(unsafe.StringData(file_shred_proto_rawDesc), len(file_shred_proto_rawDesc)), + NumEnums: 0, + NumMessages: 5, + NumExtensions: 0, + NumServices: 0, + }, + GoTypes: file_shred_proto_goTypes, + DependencyIndexes: file_shred_proto_depIdxs, + MessageInfos: file_shred_proto_msgTypes, + }.Build() + File_shred_proto = out.File + file_shred_proto_goTypes = nil + file_shred_proto_depIdxs = nil +} diff --git a/pkg/protosol-go/txn/txn.pb.go b/pkg/protosol-go/txn/txn.pb.go new file mode 100644 index 00000000..4ca094c8 --- /dev/null +++ b/pkg/protosol-go/txn/txn.pb.go @@ -0,0 +1,979 @@ +// Code generated by protoc-gen-go. DO NOT EDIT. +// versions: +// protoc-gen-go v1.36.10 +// protoc v6.32.1 +// source: txn.proto + +package txn + +import ( + protoreflect "google.golang.org/protobuf/reflect/protoreflect" + protoimpl "google.golang.org/protobuf/runtime/protoimpl" + context "github.com/Overclock-Validator/mithril/pkg/protosol-go/context" + metadata "github.com/Overclock-Validator/mithril/pkg/protosol-go/metadata" + reflect "reflect" + sync "sync" + unsafe "unsafe" +) + +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) +) + +// Message header contains the counts of required readonly and signatures +type MessageHeader struct { + state protoimpl.MessageState `protogen:"open.v1"` + NumRequiredSignatures uint32 `protobuf:"varint,1,opt,name=num_required_signatures,json=numRequiredSignatures,proto3" json:"num_required_signatures,omitempty"` + NumReadonlySignedAccounts uint32 `protobuf:"varint,2,opt,name=num_readonly_signed_accounts,json=numReadonlySignedAccounts,proto3" json:"num_readonly_signed_accounts,omitempty"` + NumReadonlyUnsignedAccounts uint32 `protobuf:"varint,3,opt,name=num_readonly_unsigned_accounts,json=numReadonlyUnsignedAccounts,proto3" json:"num_readonly_unsigned_accounts,omitempty"` + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache +} + +func (x *MessageHeader) Reset() { + *x = MessageHeader{} + mi := &file_txn_proto_msgTypes[0] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) +} + +func (x *MessageHeader) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*MessageHeader) ProtoMessage() {} + +func (x *MessageHeader) ProtoReflect() protoreflect.Message { + mi := &file_txn_proto_msgTypes[0] + if x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use MessageHeader.ProtoReflect.Descriptor instead. +func (*MessageHeader) Descriptor() ([]byte, []int) { + return file_txn_proto_rawDescGZIP(), []int{0} +} + +func (x *MessageHeader) GetNumRequiredSignatures() uint32 { + if x != nil { + return x.NumRequiredSignatures + } + return 0 +} + +func (x *MessageHeader) GetNumReadonlySignedAccounts() uint32 { + if x != nil { + return x.NumReadonlySignedAccounts + } + return 0 +} + +func (x *MessageHeader) GetNumReadonlyUnsignedAccounts() uint32 { + if x != nil { + return x.NumReadonlyUnsignedAccounts + } + return 0 +} + +// The instruction a transaction executes +type CompiledInstruction struct { + state protoimpl.MessageState `protogen:"open.v1"` + // Index into the message pubkey array + ProgramIdIndex uint32 `protobuf:"varint,1,opt,name=program_id_index,json=programIdIndex,proto3" json:"program_id_index,omitempty"` + // Indexes into the message pubkey array + Accounts []uint32 `protobuf:"varint,2,rep,packed,name=accounts,proto3" json:"accounts,omitempty"` + Data []byte `protobuf:"bytes,3,opt,name=data,proto3" json:"data,omitempty"` + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache +} + +func (x *CompiledInstruction) Reset() { + *x = CompiledInstruction{} + mi := &file_txn_proto_msgTypes[1] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) +} + +func (x *CompiledInstruction) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*CompiledInstruction) ProtoMessage() {} + +func (x *CompiledInstruction) ProtoReflect() protoreflect.Message { + mi := &file_txn_proto_msgTypes[1] + if x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use CompiledInstruction.ProtoReflect.Descriptor instead. +func (*CompiledInstruction) Descriptor() ([]byte, []int) { + return file_txn_proto_rawDescGZIP(), []int{1} +} + +func (x *CompiledInstruction) GetProgramIdIndex() uint32 { + if x != nil { + return x.ProgramIdIndex + } + return 0 +} + +func (x *CompiledInstruction) GetAccounts() []uint32 { + if x != nil { + return x.Accounts + } + return nil +} + +func (x *CompiledInstruction) GetData() []byte { + if x != nil { + return x.Data + } + return nil +} + +// List of address table lookups used to load additional accounts for a transaction +type MessageAddressTableLookup struct { + state protoimpl.MessageState `protogen:"open.v1"` + AccountKey []byte `protobuf:"bytes,1,opt,name=account_key,json=accountKey,proto3" json:"account_key,omitempty"` + WritableIndexes []uint32 `protobuf:"varint,2,rep,packed,name=writable_indexes,json=writableIndexes,proto3" json:"writable_indexes,omitempty"` + ReadonlyIndexes []uint32 `protobuf:"varint,3,rep,packed,name=readonly_indexes,json=readonlyIndexes,proto3" json:"readonly_indexes,omitempty"` + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache +} + +func (x *MessageAddressTableLookup) Reset() { + *x = MessageAddressTableLookup{} + mi := &file_txn_proto_msgTypes[2] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) +} + +func (x *MessageAddressTableLookup) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*MessageAddressTableLookup) ProtoMessage() {} + +func (x *MessageAddressTableLookup) ProtoReflect() protoreflect.Message { + mi := &file_txn_proto_msgTypes[2] + if x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use MessageAddressTableLookup.ProtoReflect.Descriptor instead. +func (*MessageAddressTableLookup) Descriptor() ([]byte, []int) { + return file_txn_proto_rawDescGZIP(), []int{2} +} + +func (x *MessageAddressTableLookup) GetAccountKey() []byte { + if x != nil { + return x.AccountKey + } + return nil +} + +func (x *MessageAddressTableLookup) GetWritableIndexes() []uint32 { + if x != nil { + return x.WritableIndexes + } + return nil +} + +func (x *MessageAddressTableLookup) GetReadonlyIndexes() []uint32 { + if x != nil { + return x.ReadonlyIndexes + } + return nil +} + +// Message contains the transaction data +type TransactionMessage struct { + state protoimpl.MessageState `protogen:"open.v1"` + // Whether this is a legacy message or not + IsLegacy bool `protobuf:"varint,1,opt,name=is_legacy,json=isLegacy,proto3" json:"is_legacy,omitempty"` + Header *MessageHeader `protobuf:"bytes,2,opt,name=header,proto3" json:"header,omitempty"` + // Vector of pubkeys + AccountKeys [][]byte `protobuf:"bytes,3,rep,name=account_keys,json=accountKeys,proto3" json:"account_keys,omitempty"` + // Recent blockhash provided in message + RecentBlockhash []byte `protobuf:"bytes,5,opt,name=recent_blockhash,json=recentBlockhash,proto3" json:"recent_blockhash,omitempty"` + // The instructions this transaction executes + Instructions []*CompiledInstruction `protobuf:"bytes,6,rep,name=instructions,proto3" json:"instructions,omitempty"` + // Not available in legacy message + AddressTableLookups []*MessageAddressTableLookup `protobuf:"bytes,7,rep,name=address_table_lookups,json=addressTableLookups,proto3" json:"address_table_lookups,omitempty"` + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache +} + +func (x *TransactionMessage) Reset() { + *x = TransactionMessage{} + mi := &file_txn_proto_msgTypes[3] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) +} + +func (x *TransactionMessage) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*TransactionMessage) ProtoMessage() {} + +func (x *TransactionMessage) ProtoReflect() protoreflect.Message { + mi := &file_txn_proto_msgTypes[3] + if x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use TransactionMessage.ProtoReflect.Descriptor instead. +func (*TransactionMessage) Descriptor() ([]byte, []int) { + return file_txn_proto_rawDescGZIP(), []int{3} +} + +func (x *TransactionMessage) GetIsLegacy() bool { + if x != nil { + return x.IsLegacy + } + return false +} + +func (x *TransactionMessage) GetHeader() *MessageHeader { + if x != nil { + return x.Header + } + return nil +} + +func (x *TransactionMessage) GetAccountKeys() [][]byte { + if x != nil { + return x.AccountKeys + } + return nil +} + +func (x *TransactionMessage) GetRecentBlockhash() []byte { + if x != nil { + return x.RecentBlockhash + } + return nil +} + +func (x *TransactionMessage) GetInstructions() []*CompiledInstruction { + if x != nil { + return x.Instructions + } + return nil +} + +func (x *TransactionMessage) GetAddressTableLookups() []*MessageAddressTableLookup { + if x != nil { + return x.AddressTableLookups + } + return nil +} + +// A valid verified transaction +type SanitizedTransaction struct { + state protoimpl.MessageState `protogen:"open.v1"` + // The transaction information + Message *TransactionMessage `protobuf:"bytes,1,opt,name=message,proto3" json:"message,omitempty"` + // The message hash + MessageHash []byte `protobuf:"bytes,2,opt,name=message_hash,json=messageHash,proto3" json:"message_hash,omitempty"` + // The signatures needed in the transaction + Signatures [][]byte `protobuf:"bytes,4,rep,name=signatures,proto3" json:"signatures,omitempty"` + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache +} + +func (x *SanitizedTransaction) Reset() { + *x = SanitizedTransaction{} + mi := &file_txn_proto_msgTypes[4] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) +} + +func (x *SanitizedTransaction) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*SanitizedTransaction) ProtoMessage() {} + +func (x *SanitizedTransaction) ProtoReflect() protoreflect.Message { + mi := &file_txn_proto_msgTypes[4] + if x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use SanitizedTransaction.ProtoReflect.Descriptor instead. +func (*SanitizedTransaction) Descriptor() ([]byte, []int) { + return file_txn_proto_rawDescGZIP(), []int{4} +} + +func (x *SanitizedTransaction) GetMessage() *TransactionMessage { + if x != nil { + return x.Message + } + return nil +} + +func (x *SanitizedTransaction) GetMessageHash() []byte { + if x != nil { + return x.MessageHash + } + return nil +} + +func (x *SanitizedTransaction) GetSignatures() [][]byte { + if x != nil { + return x.Signatures + } + return nil +} + +// This Transaction context be used to fuzz either `load_execute_and_commit_transactions`, +// `load_and_execute_transactions` in `bank.rs` or `load_and_execute_sanitized_transactions` +// in `svm/transaction_processor.rs` +type TxnContext struct { + state protoimpl.MessageState `protogen:"open.v1"` + // The transaction data + Tx *SanitizedTransaction `protobuf:"bytes,1,opt,name=tx,proto3" json:"tx,omitempty"` + // Data associated with transaction accounts, sysvars, etc. + AccountSharedData []*context.AcctState `protobuf:"bytes,2,rep,name=account_shared_data,json=accountSharedData,proto3" json:"account_shared_data,omitempty"` + // Up to 300 (actually 301) most recent blockhashes (ordered from oldest to newest) + BlockhashQueue [][]byte `protobuf:"bytes,3,rep,name=blockhash_queue,json=blockhashQueue,proto3" json:"blockhash_queue,omitempty"` + EpochCtx *context.EpochContext `protobuf:"bytes,4,opt,name=epoch_ctx,json=epochCtx,proto3" json:"epoch_ctx,omitempty"` + SlotCtx *context.SlotContext `protobuf:"bytes,5,opt,name=slot_ctx,json=slotCtx,proto3" json:"slot_ctx,omitempty"` + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache +} + +func (x *TxnContext) Reset() { + *x = TxnContext{} + mi := &file_txn_proto_msgTypes[5] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) +} + +func (x *TxnContext) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*TxnContext) ProtoMessage() {} + +func (x *TxnContext) ProtoReflect() protoreflect.Message { + mi := &file_txn_proto_msgTypes[5] + if x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use TxnContext.ProtoReflect.Descriptor instead. +func (*TxnContext) Descriptor() ([]byte, []int) { + return file_txn_proto_rawDescGZIP(), []int{5} +} + +func (x *TxnContext) GetTx() *SanitizedTransaction { + if x != nil { + return x.Tx + } + return nil +} + +func (x *TxnContext) GetAccountSharedData() []*context.AcctState { + if x != nil { + return x.AccountSharedData + } + return nil +} + +func (x *TxnContext) GetBlockhashQueue() [][]byte { + if x != nil { + return x.BlockhashQueue + } + return nil +} + +func (x *TxnContext) GetEpochCtx() *context.EpochContext { + if x != nil { + return x.EpochCtx + } + return nil +} + +func (x *TxnContext) GetSlotCtx() *context.SlotContext { + if x != nil { + return x.SlotCtx + } + return nil +} + +// The resulting state of an account after a transaction +type ResultingState struct { + state protoimpl.MessageState `protogen:"open.v1"` + AcctStates []*context.AcctState `protobuf:"bytes,1,rep,name=acct_states,json=acctStates,proto3" json:"acct_states,omitempty"` + RentDebits []*RentDebits `protobuf:"bytes,2,rep,name=rent_debits,json=rentDebits,proto3" json:"rent_debits,omitempty"` + TransactionRent uint64 `protobuf:"varint,3,opt,name=transaction_rent,json=transactionRent,proto3" json:"transaction_rent,omitempty"` + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache +} + +func (x *ResultingState) Reset() { + *x = ResultingState{} + mi := &file_txn_proto_msgTypes[6] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) +} + +func (x *ResultingState) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*ResultingState) ProtoMessage() {} + +func (x *ResultingState) ProtoReflect() protoreflect.Message { + mi := &file_txn_proto_msgTypes[6] + if x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use ResultingState.ProtoReflect.Descriptor instead. +func (*ResultingState) Descriptor() ([]byte, []int) { + return file_txn_proto_rawDescGZIP(), []int{6} +} + +func (x *ResultingState) GetAcctStates() []*context.AcctState { + if x != nil { + return x.AcctStates + } + return nil +} + +func (x *ResultingState) GetRentDebits() []*RentDebits { + if x != nil { + return x.RentDebits + } + return nil +} + +func (x *ResultingState) GetTransactionRent() uint64 { + if x != nil { + return x.TransactionRent + } + return 0 +} + +// The rent state for an account after a transaction +type RentDebits struct { + state protoimpl.MessageState `protogen:"open.v1"` + Pubkey []byte `protobuf:"bytes,1,opt,name=pubkey,proto3" json:"pubkey,omitempty"` + RentCollected int64 `protobuf:"varint,2,opt,name=rent_collected,json=rentCollected,proto3" json:"rent_collected,omitempty"` + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache +} + +func (x *RentDebits) Reset() { + *x = RentDebits{} + mi := &file_txn_proto_msgTypes[7] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) +} + +func (x *RentDebits) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*RentDebits) ProtoMessage() {} + +func (x *RentDebits) ProtoReflect() protoreflect.Message { + mi := &file_txn_proto_msgTypes[7] + if x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use RentDebits.ProtoReflect.Descriptor instead. +func (*RentDebits) Descriptor() ([]byte, []int) { + return file_txn_proto_rawDescGZIP(), []int{7} +} + +func (x *RentDebits) GetPubkey() []byte { + if x != nil { + return x.Pubkey + } + return nil +} + +func (x *RentDebits) GetRentCollected() int64 { + if x != nil { + return x.RentCollected + } + return 0 +} + +type FeeDetails struct { + state protoimpl.MessageState `protogen:"open.v1"` + TransactionFee uint64 `protobuf:"varint,1,opt,name=transaction_fee,json=transactionFee,proto3" json:"transaction_fee,omitempty"` + PrioritizationFee uint64 `protobuf:"varint,2,opt,name=prioritization_fee,json=prioritizationFee,proto3" json:"prioritization_fee,omitempty"` + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache +} + +func (x *FeeDetails) Reset() { + *x = FeeDetails{} + mi := &file_txn_proto_msgTypes[8] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) +} + +func (x *FeeDetails) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*FeeDetails) ProtoMessage() {} + +func (x *FeeDetails) ProtoReflect() protoreflect.Message { + mi := &file_txn_proto_msgTypes[8] + if x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use FeeDetails.ProtoReflect.Descriptor instead. +func (*FeeDetails) Descriptor() ([]byte, []int) { + return file_txn_proto_rawDescGZIP(), []int{8} +} + +func (x *FeeDetails) GetTransactionFee() uint64 { + if x != nil { + return x.TransactionFee + } + return 0 +} + +func (x *FeeDetails) GetPrioritizationFee() uint64 { + if x != nil { + return x.PrioritizationFee + } + return 0 +} + +// The execution results for a transaction +type TxnResult struct { + state protoimpl.MessageState `protogen:"open.v1"` + // Whether this transaction was executed + Executed bool `protobuf:"varint,1,opt,name=executed,proto3" json:"executed,omitempty"` + // Whether there was a sanitization error + SanitizationError bool `protobuf:"varint,2,opt,name=sanitization_error,json=sanitizationError,proto3" json:"sanitization_error,omitempty"` + // The state of each account after the transaction + ResultingState *ResultingState `protobuf:"bytes,3,opt,name=resulting_state,json=resultingState,proto3" json:"resulting_state,omitempty"` + Rent uint64 `protobuf:"varint,4,opt,name=rent,proto3" json:"rent,omitempty"` + // If an executed transaction has no error + IsOk bool `protobuf:"varint,5,opt,name=is_ok,json=isOk,proto3" json:"is_ok,omitempty"` + // The transaction status (error code) + Status uint32 `protobuf:"varint,6,opt,name=status,proto3" json:"status,omitempty"` + // The instruction error, if any + InstructionError uint32 `protobuf:"varint,7,opt,name=instruction_error,json=instructionError,proto3" json:"instruction_error,omitempty"` + // The instruction error index, if any + InstructionErrorIndex uint32 `protobuf:"varint,8,opt,name=instruction_error_index,json=instructionErrorIndex,proto3" json:"instruction_error_index,omitempty"` + // Custom error, if any + CustomError uint32 `protobuf:"varint,9,opt,name=custom_error,json=customError,proto3" json:"custom_error,omitempty"` + // The return data from this transaction, if any + ReturnData []byte `protobuf:"bytes,10,opt,name=return_data,json=returnData,proto3" json:"return_data,omitempty"` + // Number of executed compute units + ExecutedUnits uint64 `protobuf:"varint,11,opt,name=executed_units,json=executedUnits,proto3" json:"executed_units,omitempty"` + // The collected fees in this transaction + FeeDetails *FeeDetails `protobuf:"bytes,12,opt,name=fee_details,json=feeDetails,proto3" json:"fee_details,omitempty"` + // Loaded accounts data size + LoadedAccountsDataSize uint64 `protobuf:"varint,13,opt,name=loaded_accounts_data_size,json=loadedAccountsDataSize,proto3" json:"loaded_accounts_data_size,omitempty"` + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache +} + +func (x *TxnResult) Reset() { + *x = TxnResult{} + mi := &file_txn_proto_msgTypes[9] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) +} + +func (x *TxnResult) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*TxnResult) ProtoMessage() {} + +func (x *TxnResult) ProtoReflect() protoreflect.Message { + mi := &file_txn_proto_msgTypes[9] + if x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use TxnResult.ProtoReflect.Descriptor instead. +func (*TxnResult) Descriptor() ([]byte, []int) { + return file_txn_proto_rawDescGZIP(), []int{9} +} + +func (x *TxnResult) GetExecuted() bool { + if x != nil { + return x.Executed + } + return false +} + +func (x *TxnResult) GetSanitizationError() bool { + if x != nil { + return x.SanitizationError + } + return false +} + +func (x *TxnResult) GetResultingState() *ResultingState { + if x != nil { + return x.ResultingState + } + return nil +} + +func (x *TxnResult) GetRent() uint64 { + if x != nil { + return x.Rent + } + return 0 +} + +func (x *TxnResult) GetIsOk() bool { + if x != nil { + return x.IsOk + } + return false +} + +func (x *TxnResult) GetStatus() uint32 { + if x != nil { + return x.Status + } + return 0 +} + +func (x *TxnResult) GetInstructionError() uint32 { + if x != nil { + return x.InstructionError + } + return 0 +} + +func (x *TxnResult) GetInstructionErrorIndex() uint32 { + if x != nil { + return x.InstructionErrorIndex + } + return 0 +} + +func (x *TxnResult) GetCustomError() uint32 { + if x != nil { + return x.CustomError + } + return 0 +} + +func (x *TxnResult) GetReturnData() []byte { + if x != nil { + return x.ReturnData + } + return nil +} + +func (x *TxnResult) GetExecutedUnits() uint64 { + if x != nil { + return x.ExecutedUnits + } + return 0 +} + +func (x *TxnResult) GetFeeDetails() *FeeDetails { + if x != nil { + return x.FeeDetails + } + return nil +} + +func (x *TxnResult) GetLoadedAccountsDataSize() uint64 { + if x != nil { + return x.LoadedAccountsDataSize + } + return 0 +} + +// Txn fixtures +type TxnFixture struct { + state protoimpl.MessageState `protogen:"open.v1"` + Metadata *metadata.FixtureMetadata `protobuf:"bytes,1,opt,name=metadata,proto3" json:"metadata,omitempty"` + // Context + Input *TxnContext `protobuf:"bytes,2,opt,name=input,proto3" json:"input,omitempty"` + // Effects + Output *TxnResult `protobuf:"bytes,3,opt,name=output,proto3" json:"output,omitempty"` + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache +} + +func (x *TxnFixture) Reset() { + *x = TxnFixture{} + mi := &file_txn_proto_msgTypes[10] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) +} + +func (x *TxnFixture) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*TxnFixture) ProtoMessage() {} + +func (x *TxnFixture) ProtoReflect() protoreflect.Message { + mi := &file_txn_proto_msgTypes[10] + if x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use TxnFixture.ProtoReflect.Descriptor instead. +func (*TxnFixture) Descriptor() ([]byte, []int) { + return file_txn_proto_rawDescGZIP(), []int{10} +} + +func (x *TxnFixture) GetMetadata() *metadata.FixtureMetadata { + if x != nil { + return x.Metadata + } + return nil +} + +func (x *TxnFixture) GetInput() *TxnContext { + if x != nil { + return x.Input + } + return nil +} + +func (x *TxnFixture) GetOutput() *TxnResult { + if x != nil { + return x.Output + } + return nil +} + +var File_txn_proto protoreflect.FileDescriptor + +const file_txn_proto_rawDesc = "" + + "\n" + + "\ttxn.proto\x12\x16org.solana.sealevel.v1\x1a\rcontext.proto\x1a\x0emetadata.proto\"\xcd\x01\n" + + "\rMessageHeader\x126\n" + + "\x17num_required_signatures\x18\x01 \x01(\rR\x15numRequiredSignatures\x12?\n" + + "\x1cnum_readonly_signed_accounts\x18\x02 \x01(\rR\x19numReadonlySignedAccounts\x12C\n" + + "\x1enum_readonly_unsigned_accounts\x18\x03 \x01(\rR\x1bnumReadonlyUnsignedAccounts\"o\n" + + "\x13CompiledInstruction\x12(\n" + + "\x10program_id_index\x18\x01 \x01(\rR\x0eprogramIdIndex\x12\x1a\n" + + "\baccounts\x18\x02 \x03(\rR\baccounts\x12\x12\n" + + "\x04data\x18\x03 \x01(\fR\x04data\"\x92\x01\n" + + "\x19MessageAddressTableLookup\x12\x1f\n" + + "\vaccount_key\x18\x01 \x01(\fR\n" + + "accountKey\x12)\n" + + "\x10writable_indexes\x18\x02 \x03(\rR\x0fwritableIndexes\x12)\n" + + "\x10readonly_indexes\x18\x03 \x03(\rR\x0freadonlyIndexes\"\xf6\x02\n" + + "\x12TransactionMessage\x12\x1b\n" + + "\tis_legacy\x18\x01 \x01(\bR\bisLegacy\x12=\n" + + "\x06header\x18\x02 \x01(\v2%.org.solana.sealevel.v1.MessageHeaderR\x06header\x12!\n" + + "\faccount_keys\x18\x03 \x03(\fR\vaccountKeys\x12)\n" + + "\x10recent_blockhash\x18\x05 \x01(\fR\x0frecentBlockhash\x12O\n" + + "\finstructions\x18\x06 \x03(\v2+.org.solana.sealevel.v1.CompiledInstructionR\finstructions\x12e\n" + + "\x15address_table_lookups\x18\a \x03(\v21.org.solana.sealevel.v1.MessageAddressTableLookupR\x13addressTableLookups\"\x9f\x01\n" + + "\x14SanitizedTransaction\x12D\n" + + "\amessage\x18\x01 \x01(\v2*.org.solana.sealevel.v1.TransactionMessageR\amessage\x12!\n" + + "\fmessage_hash\x18\x02 \x01(\fR\vmessageHash\x12\x1e\n" + + "\n" + + "signatures\x18\x04 \x03(\fR\n" + + "signatures\"\xc9\x02\n" + + "\n" + + "TxnContext\x12<\n" + + "\x02tx\x18\x01 \x01(\v2,.org.solana.sealevel.v1.SanitizedTransactionR\x02tx\x12Q\n" + + "\x13account_shared_data\x18\x02 \x03(\v2!.org.solana.sealevel.v1.AcctStateR\x11accountSharedData\x12'\n" + + "\x0fblockhash_queue\x18\x03 \x03(\fR\x0eblockhashQueue\x12A\n" + + "\tepoch_ctx\x18\x04 \x01(\v2$.org.solana.sealevel.v1.EpochContextR\bepochCtx\x12>\n" + + "\bslot_ctx\x18\x05 \x01(\v2#.org.solana.sealevel.v1.SlotContextR\aslotCtx\"\xc4\x01\n" + + "\x0eResultingState\x12B\n" + + "\vacct_states\x18\x01 \x03(\v2!.org.solana.sealevel.v1.AcctStateR\n" + + "acctStates\x12C\n" + + "\vrent_debits\x18\x02 \x03(\v2\".org.solana.sealevel.v1.RentDebitsR\n" + + "rentDebits\x12)\n" + + "\x10transaction_rent\x18\x03 \x01(\x04R\x0ftransactionRent\"K\n" + + "\n" + + "RentDebits\x12\x16\n" + + "\x06pubkey\x18\x01 \x01(\fR\x06pubkey\x12%\n" + + "\x0erent_collected\x18\x02 \x01(\x03R\rrentCollected\"d\n" + + "\n" + + "FeeDetails\x12'\n" + + "\x0ftransaction_fee\x18\x01 \x01(\x04R\x0etransactionFee\x12-\n" + + "\x12prioritization_fee\x18\x02 \x01(\x04R\x11prioritizationFee\"\xb8\x04\n" + + "\tTxnResult\x12\x1a\n" + + "\bexecuted\x18\x01 \x01(\bR\bexecuted\x12-\n" + + "\x12sanitization_error\x18\x02 \x01(\bR\x11sanitizationError\x12O\n" + + "\x0fresulting_state\x18\x03 \x01(\v2&.org.solana.sealevel.v1.ResultingStateR\x0eresultingState\x12\x12\n" + + "\x04rent\x18\x04 \x01(\x04R\x04rent\x12\x13\n" + + "\x05is_ok\x18\x05 \x01(\bR\x04isOk\x12\x16\n" + + "\x06status\x18\x06 \x01(\rR\x06status\x12+\n" + + "\x11instruction_error\x18\a \x01(\rR\x10instructionError\x126\n" + + "\x17instruction_error_index\x18\b \x01(\rR\x15instructionErrorIndex\x12!\n" + + "\fcustom_error\x18\t \x01(\rR\vcustomError\x12\x1f\n" + + "\vreturn_data\x18\n" + + " \x01(\fR\n" + + "returnData\x12%\n" + + "\x0eexecuted_units\x18\v \x01(\x04R\rexecutedUnits\x12C\n" + + "\vfee_details\x18\f \x01(\v2\".org.solana.sealevel.v1.FeeDetailsR\n" + + "feeDetails\x129\n" + + "\x19loaded_accounts_data_size\x18\r \x01(\x04R\x16loadedAccountsDataSize\"\xc6\x01\n" + + "\n" + + "TxnFixture\x12C\n" + + "\bmetadata\x18\x01 \x01(\v2'.org.solana.sealevel.v1.FixtureMetadataR\bmetadata\x128\n" + + "\x05input\x18\x02 \x01(\v2\".org.solana.sealevel.v1.TxnContextR\x05input\x129\n" + + "\x06output\x18\x03 \x01(\v2!.org.solana.sealevel.v1.TxnResultR\x06outputb\x06proto3" + +var ( + file_txn_proto_rawDescOnce sync.Once + file_txn_proto_rawDescData []byte +) + +func file_txn_proto_rawDescGZIP() []byte { + file_txn_proto_rawDescOnce.Do(func() { + file_txn_proto_rawDescData = protoimpl.X.CompressGZIP(unsafe.Slice(unsafe.StringData(file_txn_proto_rawDesc), len(file_txn_proto_rawDesc))) + }) + return file_txn_proto_rawDescData +} + +var file_txn_proto_msgTypes = make([]protoimpl.MessageInfo, 11) +var file_txn_proto_goTypes = []any{ + (*MessageHeader)(nil), // 0: org.solana.sealevel.v1.MessageHeader + (*CompiledInstruction)(nil), // 1: org.solana.sealevel.v1.CompiledInstruction + (*MessageAddressTableLookup)(nil), // 2: org.solana.sealevel.v1.MessageAddressTableLookup + (*TransactionMessage)(nil), // 3: org.solana.sealevel.v1.TransactionMessage + (*SanitizedTransaction)(nil), // 4: org.solana.sealevel.v1.SanitizedTransaction + (*TxnContext)(nil), // 5: org.solana.sealevel.v1.TxnContext + (*ResultingState)(nil), // 6: org.solana.sealevel.v1.ResultingState + (*RentDebits)(nil), // 7: org.solana.sealevel.v1.RentDebits + (*FeeDetails)(nil), // 8: org.solana.sealevel.v1.FeeDetails + (*TxnResult)(nil), // 9: org.solana.sealevel.v1.TxnResult + (*TxnFixture)(nil), // 10: org.solana.sealevel.v1.TxnFixture + (*context.AcctState)(nil), // 11: org.solana.sealevel.v1.AcctState + (*context.EpochContext)(nil), // 12: org.solana.sealevel.v1.EpochContext + (*context.SlotContext)(nil), // 13: org.solana.sealevel.v1.SlotContext + (*metadata.FixtureMetadata)(nil), // 14: org.solana.sealevel.v1.FixtureMetadata +} +var file_txn_proto_depIdxs = []int32{ + 0, // 0: org.solana.sealevel.v1.TransactionMessage.header:type_name -> org.solana.sealevel.v1.MessageHeader + 1, // 1: org.solana.sealevel.v1.TransactionMessage.instructions:type_name -> org.solana.sealevel.v1.CompiledInstruction + 2, // 2: org.solana.sealevel.v1.TransactionMessage.address_table_lookups:type_name -> org.solana.sealevel.v1.MessageAddressTableLookup + 3, // 3: org.solana.sealevel.v1.SanitizedTransaction.message:type_name -> org.solana.sealevel.v1.TransactionMessage + 4, // 4: org.solana.sealevel.v1.TxnContext.tx:type_name -> org.solana.sealevel.v1.SanitizedTransaction + 11, // 5: org.solana.sealevel.v1.TxnContext.account_shared_data:type_name -> org.solana.sealevel.v1.AcctState + 12, // 6: org.solana.sealevel.v1.TxnContext.epoch_ctx:type_name -> org.solana.sealevel.v1.EpochContext + 13, // 7: org.solana.sealevel.v1.TxnContext.slot_ctx:type_name -> org.solana.sealevel.v1.SlotContext + 11, // 8: org.solana.sealevel.v1.ResultingState.acct_states:type_name -> org.solana.sealevel.v1.AcctState + 7, // 9: org.solana.sealevel.v1.ResultingState.rent_debits:type_name -> org.solana.sealevel.v1.RentDebits + 6, // 10: org.solana.sealevel.v1.TxnResult.resulting_state:type_name -> org.solana.sealevel.v1.ResultingState + 8, // 11: org.solana.sealevel.v1.TxnResult.fee_details:type_name -> org.solana.sealevel.v1.FeeDetails + 14, // 12: org.solana.sealevel.v1.TxnFixture.metadata:type_name -> org.solana.sealevel.v1.FixtureMetadata + 5, // 13: org.solana.sealevel.v1.TxnFixture.input:type_name -> org.solana.sealevel.v1.TxnContext + 9, // 14: org.solana.sealevel.v1.TxnFixture.output:type_name -> org.solana.sealevel.v1.TxnResult + 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_txn_proto_init() } +func file_txn_proto_init() { + if File_txn_proto != nil { + return + } + type x struct{} + out := protoimpl.TypeBuilder{ + File: protoimpl.DescBuilder{ + GoPackagePath: reflect.TypeOf(x{}).PkgPath(), + RawDescriptor: unsafe.Slice(unsafe.StringData(file_txn_proto_rawDesc), len(file_txn_proto_rawDesc)), + NumEnums: 0, + NumMessages: 11, + NumExtensions: 0, + NumServices: 0, + }, + GoTypes: file_txn_proto_goTypes, + DependencyIndexes: file_txn_proto_depIdxs, + MessageInfos: file_txn_proto_msgTypes, + }.Build() + File_txn_proto = out.File + file_txn_proto_goTypes = nil + file_txn_proto_depIdxs = nil +} diff --git a/pkg/protosol-go/type/type.pb.go b/pkg/protosol-go/type/type.pb.go new file mode 100644 index 00000000..9a4d1063 --- /dev/null +++ b/pkg/protosol-go/type/type.pb.go @@ -0,0 +1,267 @@ +// Code generated by protoc-gen-go. DO NOT EDIT. +// versions: +// protoc-gen-go v1.36.10 +// protoc v6.32.1 +// source: type.proto + +package _type + +import ( + protoreflect "google.golang.org/protobuf/reflect/protoreflect" + protoimpl "google.golang.org/protobuf/runtime/protoimpl" + metadata "github.com/Overclock-Validator/mithril/pkg/protosol-go/metadata" + reflect "reflect" + sync "sync" + unsafe "unsafe" +) + +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 TypeContext struct { + state protoimpl.MessageState `protogen:"open.v1"` + Content []byte `protobuf:"bytes,1,opt,name=content,proto3" json:"content,omitempty"` + Typename string `protobuf:"bytes,2,opt,name=typename,proto3" json:"typename,omitempty"` + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache +} + +func (x *TypeContext) Reset() { + *x = TypeContext{} + mi := &file_type_proto_msgTypes[0] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) +} + +func (x *TypeContext) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*TypeContext) ProtoMessage() {} + +func (x *TypeContext) ProtoReflect() protoreflect.Message { + mi := &file_type_proto_msgTypes[0] + if x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use TypeContext.ProtoReflect.Descriptor instead. +func (*TypeContext) Descriptor() ([]byte, []int) { + return file_type_proto_rawDescGZIP(), []int{0} +} + +func (x *TypeContext) GetContent() []byte { + if x != nil { + return x.Content + } + return nil +} + +func (x *TypeContext) GetTypename() string { + if x != nil { + return x.Typename + } + return "" +} + +type TypeEffects struct { + state protoimpl.MessageState `protogen:"open.v1"` + Result uint64 `protobuf:"varint,1,opt,name=result,proto3" json:"result,omitempty"` + Representation []byte `protobuf:"bytes,2,opt,name=representation,proto3" json:"representation,omitempty"` + Yaml []byte `protobuf:"bytes,3,opt,name=yaml,proto3" json:"yaml,omitempty"` + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache +} + +func (x *TypeEffects) Reset() { + *x = TypeEffects{} + mi := &file_type_proto_msgTypes[1] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) +} + +func (x *TypeEffects) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*TypeEffects) ProtoMessage() {} + +func (x *TypeEffects) ProtoReflect() protoreflect.Message { + mi := &file_type_proto_msgTypes[1] + if x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use TypeEffects.ProtoReflect.Descriptor instead. +func (*TypeEffects) Descriptor() ([]byte, []int) { + return file_type_proto_rawDescGZIP(), []int{1} +} + +func (x *TypeEffects) GetResult() uint64 { + if x != nil { + return x.Result + } + return 0 +} + +func (x *TypeEffects) GetRepresentation() []byte { + if x != nil { + return x.Representation + } + return nil +} + +func (x *TypeEffects) GetYaml() []byte { + if x != nil { + return x.Yaml + } + return nil +} + +type TypeFixture struct { + state protoimpl.MessageState `protogen:"open.v1"` + Metadata *metadata.FixtureMetadata `protobuf:"bytes,1,opt,name=metadata,proto3" json:"metadata,omitempty"` + Input *TypeContext `protobuf:"bytes,2,opt,name=input,proto3" json:"input,omitempty"` + Output *TypeEffects `protobuf:"bytes,3,opt,name=output,proto3" json:"output,omitempty"` + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache +} + +func (x *TypeFixture) Reset() { + *x = TypeFixture{} + mi := &file_type_proto_msgTypes[2] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) +} + +func (x *TypeFixture) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*TypeFixture) ProtoMessage() {} + +func (x *TypeFixture) ProtoReflect() protoreflect.Message { + mi := &file_type_proto_msgTypes[2] + if x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use TypeFixture.ProtoReflect.Descriptor instead. +func (*TypeFixture) Descriptor() ([]byte, []int) { + return file_type_proto_rawDescGZIP(), []int{2} +} + +func (x *TypeFixture) GetMetadata() *metadata.FixtureMetadata { + if x != nil { + return x.Metadata + } + return nil +} + +func (x *TypeFixture) GetInput() *TypeContext { + if x != nil { + return x.Input + } + return nil +} + +func (x *TypeFixture) GetOutput() *TypeEffects { + if x != nil { + return x.Output + } + return nil +} + +var File_type_proto protoreflect.FileDescriptor + +const file_type_proto_rawDesc = "" + + "\n" + + "\n" + + "type.proto\x12\x16org.solana.sealevel.v1\x1a\x0emetadata.proto\"C\n" + + "\vTypeContext\x12\x18\n" + + "\acontent\x18\x01 \x01(\fR\acontent\x12\x1a\n" + + "\btypename\x18\x02 \x01(\tR\btypename\"a\n" + + "\vTypeEffects\x12\x16\n" + + "\x06result\x18\x01 \x01(\x04R\x06result\x12&\n" + + "\x0erepresentation\x18\x02 \x01(\fR\x0erepresentation\x12\x12\n" + + "\x04yaml\x18\x03 \x01(\fR\x04yaml\"\xca\x01\n" + + "\vTypeFixture\x12C\n" + + "\bmetadata\x18\x01 \x01(\v2'.org.solana.sealevel.v1.FixtureMetadataR\bmetadata\x129\n" + + "\x05input\x18\x02 \x01(\v2#.org.solana.sealevel.v1.TypeContextR\x05input\x12;\n" + + "\x06output\x18\x03 \x01(\v2#.org.solana.sealevel.v1.TypeEffectsR\x06outputb\x06proto3" + +var ( + file_type_proto_rawDescOnce sync.Once + file_type_proto_rawDescData []byte +) + +func file_type_proto_rawDescGZIP() []byte { + file_type_proto_rawDescOnce.Do(func() { + file_type_proto_rawDescData = protoimpl.X.CompressGZIP(unsafe.Slice(unsafe.StringData(file_type_proto_rawDesc), len(file_type_proto_rawDesc))) + }) + return file_type_proto_rawDescData +} + +var file_type_proto_msgTypes = make([]protoimpl.MessageInfo, 3) +var file_type_proto_goTypes = []any{ + (*TypeContext)(nil), // 0: org.solana.sealevel.v1.TypeContext + (*TypeEffects)(nil), // 1: org.solana.sealevel.v1.TypeEffects + (*TypeFixture)(nil), // 2: org.solana.sealevel.v1.TypeFixture + (*metadata.FixtureMetadata)(nil), // 3: org.solana.sealevel.v1.FixtureMetadata +} +var file_type_proto_depIdxs = []int32{ + 3, // 0: org.solana.sealevel.v1.TypeFixture.metadata:type_name -> org.solana.sealevel.v1.FixtureMetadata + 0, // 1: org.solana.sealevel.v1.TypeFixture.input:type_name -> org.solana.sealevel.v1.TypeContext + 1, // 2: org.solana.sealevel.v1.TypeFixture.output:type_name -> org.solana.sealevel.v1.TypeEffects + 3, // [3:3] is the sub-list for method output_type + 3, // [3:3] is the sub-list for method input_type + 3, // [3:3] is the sub-list for extension type_name + 3, // [3:3] is the sub-list for extension extendee + 0, // [0:3] is the sub-list for field type_name +} + +func init() { file_type_proto_init() } +func file_type_proto_init() { + if File_type_proto != nil { + return + } + type x struct{} + out := protoimpl.TypeBuilder{ + File: protoimpl.DescBuilder{ + GoPackagePath: reflect.TypeOf(x{}).PkgPath(), + RawDescriptor: unsafe.Slice(unsafe.StringData(file_type_proto_rawDesc), len(file_type_proto_rawDesc)), + NumEnums: 0, + NumMessages: 3, + NumExtensions: 0, + NumServices: 0, + }, + GoTypes: file_type_proto_goTypes, + DependencyIndexes: file_type_proto_depIdxs, + MessageInfos: file_type_proto_msgTypes, + }.Build() + File_type_proto = out.File + file_type_proto_goTypes = nil + file_type_proto_depIdxs = nil +} diff --git a/pkg/protosol-go/vm/vm.pb.go b/pkg/protosol-go/vm/vm.pb.go new file mode 100644 index 00000000..e0158c0c --- /dev/null +++ b/pkg/protosol-go/vm/vm.pb.go @@ -0,0 +1,1164 @@ +// Code generated by protoc-gen-go. DO NOT EDIT. +// versions: +// protoc-gen-go v1.36.10 +// protoc v6.32.1 +// source: vm.proto + +package vm + +import ( + protoreflect "google.golang.org/protobuf/reflect/protoreflect" + protoimpl "google.golang.org/protobuf/runtime/protoimpl" + context "github.com/Overclock-Validator/mithril/pkg/protosol-go/context" + invoke "github.com/Overclock-Validator/mithril/pkg/protosol-go/invoke" + metadata "github.com/Overclock-Validator/mithril/pkg/protosol-go/metadata" + reflect "reflect" + sync "sync" + unsafe "unsafe" +) + +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) +) + +// We are only concerned with these error kinds as the syscall/VM fuzzers don't +// hit higher level error kinds (e.g., transaction errors) +type ErrKind int32 + +const ( + ErrKind_UNSPECIFIED ErrKind = 0 + ErrKind_EBPF ErrKind = 1 + ErrKind_SYSCALL ErrKind = 2 + ErrKind_INSTRUCTION ErrKind = 3 +) + +// Enum value maps for ErrKind. +var ( + ErrKind_name = map[int32]string{ + 0: "UNSPECIFIED", + 1: "EBPF", + 2: "SYSCALL", + 3: "INSTRUCTION", + } + ErrKind_value = map[string]int32{ + "UNSPECIFIED": 0, + "EBPF": 1, + "SYSCALL": 2, + "INSTRUCTION": 3, + } +) + +func (x ErrKind) Enum() *ErrKind { + p := new(ErrKind) + *p = x + return p +} + +func (x ErrKind) String() string { + return protoimpl.X.EnumStringOf(x.Descriptor(), protoreflect.EnumNumber(x)) +} + +func (ErrKind) Descriptor() protoreflect.EnumDescriptor { + return file_vm_proto_enumTypes[0].Descriptor() +} + +func (ErrKind) Type() protoreflect.EnumType { + return &file_vm_proto_enumTypes[0] +} + +func (x ErrKind) Number() protoreflect.EnumNumber { + return protoreflect.EnumNumber(x) +} + +// Deprecated: Use ErrKind.Descriptor instead. +func (ErrKind) EnumDescriptor() ([]byte, []int) { + return file_vm_proto_rawDescGZIP(), []int{0} +} + +// Describes an input data region. Agave's memory mapping sets up a series of +// memory mapped regions, which combine to make the input data region. +type InputDataRegion struct { + state protoimpl.MessageState `protogen:"open.v1"` + // Offset from the start of the input data segment (0x400000000) + Offset uint64 `protobuf:"varint,1,opt,name=offset,proto3" json:"offset,omitempty"` + // Content of the memory region + Content []byte `protobuf:"bytes,2,opt,name=content,proto3" json:"content,omitempty"` + // If the memory region is writable or not + IsWritable bool `protobuf:"varint,3,opt,name=is_writable,json=isWritable,proto3" json:"is_writable,omitempty"` + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache +} + +func (x *InputDataRegion) Reset() { + *x = InputDataRegion{} + mi := &file_vm_proto_msgTypes[0] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) +} + +func (x *InputDataRegion) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*InputDataRegion) ProtoMessage() {} + +func (x *InputDataRegion) ProtoReflect() protoreflect.Message { + mi := &file_vm_proto_msgTypes[0] + if x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use InputDataRegion.ProtoReflect.Descriptor instead. +func (*InputDataRegion) Descriptor() ([]byte, []int) { + return file_vm_proto_rawDescGZIP(), []int{0} +} + +func (x *InputDataRegion) GetOffset() uint64 { + if x != nil { + return x.Offset + } + return 0 +} + +func (x *InputDataRegion) GetContent() []byte { + if x != nil { + return x.Content + } + return nil +} + +func (x *InputDataRegion) GetIsWritable() bool { + if x != nil { + return x.IsWritable + } + return false +} + +// Information sufficient to allow the fuzzer to generate a fd_vm_t context for +// execution inside the VM (excluding the instruction context). +// +// TODO: this currently only includes fields necessary for executing syscalls, +// executing sBPF code will require the rest of the fields in fd_vm_t to be set. +type VmContext struct { + state protoimpl.MessageState `protogen:"open.v1"` + // Maximum heap size in bytes + HeapMax uint64 `protobuf:"varint,1,opt,name=heap_max,json=heapMax,proto3" json:"heap_max,omitempty"` + // Program read-only data + Rodata []byte `protobuf:"bytes,2,opt,name=rodata,proto3" json:"rodata,omitempty"` + // Offset of the text section from the start of the program rodata segment + // (0x100000000) + RodataTextSectionOffset uint64 `protobuf:"varint,3,opt,name=rodata_text_section_offset,json=rodataTextSectionOffset,proto3" json:"rodata_text_section_offset,omitempty"` + // Length of the text section in the program rodata region, in bytes. + RodataTextSectionLength uint64 `protobuf:"varint,4,opt,name=rodata_text_section_length,json=rodataTextSectionLength,proto3" json:"rodata_text_section_length,omitempty"` + // Registers + R0 uint64 `protobuf:"varint,6,opt,name=r0,proto3" json:"r0,omitempty"` + R1 uint64 `protobuf:"varint,7,opt,name=r1,proto3" json:"r1,omitempty"` + R2 uint64 `protobuf:"varint,8,opt,name=r2,proto3" json:"r2,omitempty"` + R3 uint64 `protobuf:"varint,9,opt,name=r3,proto3" json:"r3,omitempty"` + R4 uint64 `protobuf:"varint,10,opt,name=r4,proto3" json:"r4,omitempty"` + R5 uint64 `protobuf:"varint,11,opt,name=r5,proto3" json:"r5,omitempty"` + R6 uint64 `protobuf:"varint,12,opt,name=r6,proto3" json:"r6,omitempty"` + R7 uint64 `protobuf:"varint,13,opt,name=r7,proto3" json:"r7,omitempty"` + R8 uint64 `protobuf:"varint,14,opt,name=r8,proto3" json:"r8,omitempty"` + R9 uint64 `protobuf:"varint,15,opt,name=r9,proto3" json:"r9,omitempty"` + R10 uint64 `protobuf:"varint,16,opt,name=r10,proto3" json:"r10,omitempty"` + R11 uint64 `protobuf:"varint,17,opt,name=r11,proto3" json:"r11,omitempty"` + // for vm execution + EntryPc uint64 `protobuf:"varint,20,opt,name=entry_pc,json=entryPc,proto3" json:"entry_pc,omitempty"` + // Bitset of valid call destinations (in terms of pc). + // This model is used by the Firedancer VM for CALL_IMMs + CallWhitelist []byte `protobuf:"bytes,21,opt,name=call_whitelist,json=callWhitelist,proto3" json:"call_whitelist,omitempty"` + TracingEnabled bool `protobuf:"varint,22,opt,name=tracing_enabled,json=tracingEnabled,proto3" json:"tracing_enabled,omitempty"` + ReturnData *ReturnData `protobuf:"bytes,23,opt,name=return_data,json=returnData,proto3" json:"return_data,omitempty"` + // SBPF version + SbpfVersion uint32 `protobuf:"varint,24,opt,name=sbpf_version,json=sbpfVersion,proto3" json:"sbpf_version,omitempty"` + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache +} + +func (x *VmContext) Reset() { + *x = VmContext{} + mi := &file_vm_proto_msgTypes[1] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) +} + +func (x *VmContext) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*VmContext) ProtoMessage() {} + +func (x *VmContext) ProtoReflect() protoreflect.Message { + mi := &file_vm_proto_msgTypes[1] + if x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use VmContext.ProtoReflect.Descriptor instead. +func (*VmContext) Descriptor() ([]byte, []int) { + return file_vm_proto_rawDescGZIP(), []int{1} +} + +func (x *VmContext) GetHeapMax() uint64 { + if x != nil { + return x.HeapMax + } + return 0 +} + +func (x *VmContext) GetRodata() []byte { + if x != nil { + return x.Rodata + } + return nil +} + +func (x *VmContext) GetRodataTextSectionOffset() uint64 { + if x != nil { + return x.RodataTextSectionOffset + } + return 0 +} + +func (x *VmContext) GetRodataTextSectionLength() uint64 { + if x != nil { + return x.RodataTextSectionLength + } + return 0 +} + +func (x *VmContext) GetR0() uint64 { + if x != nil { + return x.R0 + } + return 0 +} + +func (x *VmContext) GetR1() uint64 { + if x != nil { + return x.R1 + } + return 0 +} + +func (x *VmContext) GetR2() uint64 { + if x != nil { + return x.R2 + } + return 0 +} + +func (x *VmContext) GetR3() uint64 { + if x != nil { + return x.R3 + } + return 0 +} + +func (x *VmContext) GetR4() uint64 { + if x != nil { + return x.R4 + } + return 0 +} + +func (x *VmContext) GetR5() uint64 { + if x != nil { + return x.R5 + } + return 0 +} + +func (x *VmContext) GetR6() uint64 { + if x != nil { + return x.R6 + } + return 0 +} + +func (x *VmContext) GetR7() uint64 { + if x != nil { + return x.R7 + } + return 0 +} + +func (x *VmContext) GetR8() uint64 { + if x != nil { + return x.R8 + } + return 0 +} + +func (x *VmContext) GetR9() uint64 { + if x != nil { + return x.R9 + } + return 0 +} + +func (x *VmContext) GetR10() uint64 { + if x != nil { + return x.R10 + } + return 0 +} + +func (x *VmContext) GetR11() uint64 { + if x != nil { + return x.R11 + } + return 0 +} + +func (x *VmContext) GetEntryPc() uint64 { + if x != nil { + return x.EntryPc + } + return 0 +} + +func (x *VmContext) GetCallWhitelist() []byte { + if x != nil { + return x.CallWhitelist + } + return nil +} + +func (x *VmContext) GetTracingEnabled() bool { + if x != nil { + return x.TracingEnabled + } + return false +} + +func (x *VmContext) GetReturnData() *ReturnData { + if x != nil { + return x.ReturnData + } + return nil +} + +func (x *VmContext) GetSbpfVersion() uint32 { + if x != nil { + return x.SbpfVersion + } + return 0 +} + +// A single invocation of a syscall +type SyscallInvocation struct { + state protoimpl.MessageState `protogen:"open.v1"` + // The sBPF function name of the syscall + FunctionName []byte `protobuf:"bytes,1,opt,name=function_name,json=functionName,proto3" json:"function_name,omitempty"` + // The initial portion of the heap, for example to store syscall inputs + HeapPrefix []byte `protobuf:"bytes,2,opt,name=heap_prefix,json=heapPrefix,proto3" json:"heap_prefix,omitempty"` + // The initial portion of the stack, for example to store syscall inputs + StackPrefix []byte `protobuf:"bytes,3,opt,name=stack_prefix,json=stackPrefix,proto3" json:"stack_prefix,omitempty"` + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache +} + +func (x *SyscallInvocation) Reset() { + *x = SyscallInvocation{} + mi := &file_vm_proto_msgTypes[2] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) +} + +func (x *SyscallInvocation) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*SyscallInvocation) ProtoMessage() {} + +func (x *SyscallInvocation) ProtoReflect() protoreflect.Message { + mi := &file_vm_proto_msgTypes[2] + if x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use SyscallInvocation.ProtoReflect.Descriptor instead. +func (*SyscallInvocation) Descriptor() ([]byte, []int) { + return file_vm_proto_rawDescGZIP(), []int{2} +} + +func (x *SyscallInvocation) GetFunctionName() []byte { + if x != nil { + return x.FunctionName + } + return nil +} + +func (x *SyscallInvocation) GetHeapPrefix() []byte { + if x != nil { + return x.HeapPrefix + } + return nil +} + +func (x *SyscallInvocation) GetStackPrefix() []byte { + if x != nil { + return x.StackPrefix + } + return nil +} + +// Execution context for a VM Syscall execution. +type SyscallContext struct { + state protoimpl.MessageState `protogen:"open.v1"` + VmCtx *VmContext `protobuf:"bytes,1,opt,name=vm_ctx,json=vmCtx,proto3" json:"vm_ctx,omitempty"` + // InflightInstruction - contain temporary fields that live for the duration of an instructions execution, and is needed if we have overhanging context from a previous instruction + InstrCtx *invoke.InstrContext `protobuf:"bytes,2,opt,name=instr_ctx,json=instrCtx,proto3" json:"instr_ctx,omitempty"` + SyscallInvocation *SyscallInvocation `protobuf:"bytes,3,opt,name=syscall_invocation,json=syscallInvocation,proto3" json:"syscall_invocation,omitempty"` + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache +} + +func (x *SyscallContext) Reset() { + *x = SyscallContext{} + mi := &file_vm_proto_msgTypes[3] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) +} + +func (x *SyscallContext) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*SyscallContext) ProtoMessage() {} + +func (x *SyscallContext) ProtoReflect() protoreflect.Message { + mi := &file_vm_proto_msgTypes[3] + if x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use SyscallContext.ProtoReflect.Descriptor instead. +func (*SyscallContext) Descriptor() ([]byte, []int) { + return file_vm_proto_rawDescGZIP(), []int{3} +} + +func (x *SyscallContext) GetVmCtx() *VmContext { + if x != nil { + return x.VmCtx + } + return nil +} + +func (x *SyscallContext) GetInstrCtx() *invoke.InstrContext { + if x != nil { + return x.InstrCtx + } + return nil +} + +func (x *SyscallContext) GetSyscallInvocation() *SyscallInvocation { + if x != nil { + return x.SyscallInvocation + } + return nil +} + +// The effects of executing a SyscallContext. +type SyscallEffects struct { + state protoimpl.MessageState `protogen:"open.v1"` + // EBPF error code, if the invocation was unsuccessful + Error int64 `protobuf:"varint,1,opt,name=error,proto3" json:"error,omitempty"` + // Error Kind (should be used along with error code) + ErrorKind ErrKind `protobuf:"varint,12,opt,name=error_kind,json=errorKind,proto3,enum=org.solana.sealevel.v1.ErrKind" json:"error_kind,omitempty"` + // Registers + R0 uint64 `protobuf:"varint,2,opt,name=r0,proto3" json:"r0,omitempty"` // Result of a successful execution + // CU's remaining + CuAvail uint64 `protobuf:"varint,3,opt,name=cu_avail,json=cuAvail,proto3" json:"cu_avail,omitempty"` + // Memory regions + Heap []byte `protobuf:"bytes,4,opt,name=heap,proto3" json:"heap,omitempty"` + Stack []byte `protobuf:"bytes,5,opt,name=stack,proto3" json:"stack,omitempty"` + Inputdata []byte `protobuf:"bytes,6,opt,name=inputdata,proto3" json:"inputdata,omitempty"` // deprecated, use input_data_regions + InputDataRegions []*InputDataRegion `protobuf:"bytes,11,rep,name=input_data_regions,json=inputDataRegions,proto3" json:"input_data_regions,omitempty"` + // Current number of stack frames pushed + FrameCount uint64 `protobuf:"varint,7,opt,name=frame_count,json=frameCount,proto3" json:"frame_count,omitempty"` + // Syscall log + Log []byte `protobuf:"bytes,8,opt,name=log,proto3" json:"log,omitempty"` + Rodata []byte `protobuf:"bytes,9,opt,name=rodata,proto3" json:"rodata,omitempty"` + // VM state + Pc uint64 `protobuf:"varint,10,opt,name=pc,proto3" json:"pc,omitempty"` + // Output registers (to test interpreter) + R1 uint64 `protobuf:"varint,107,opt,name=r1,proto3" json:"r1,omitempty"` + R2 uint64 `protobuf:"varint,108,opt,name=r2,proto3" json:"r2,omitempty"` + R3 uint64 `protobuf:"varint,109,opt,name=r3,proto3" json:"r3,omitempty"` + R4 uint64 `protobuf:"varint,110,opt,name=r4,proto3" json:"r4,omitempty"` + R5 uint64 `protobuf:"varint,111,opt,name=r5,proto3" json:"r5,omitempty"` + R6 uint64 `protobuf:"varint,112,opt,name=r6,proto3" json:"r6,omitempty"` + R7 uint64 `protobuf:"varint,113,opt,name=r7,proto3" json:"r7,omitempty"` + R8 uint64 `protobuf:"varint,114,opt,name=r8,proto3" json:"r8,omitempty"` + R9 uint64 `protobuf:"varint,115,opt,name=r9,proto3" json:"r9,omitempty"` + R10 uint64 `protobuf:"varint,116,opt,name=r10,proto3" json:"r10,omitempty"` + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache +} + +func (x *SyscallEffects) Reset() { + *x = SyscallEffects{} + mi := &file_vm_proto_msgTypes[4] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) +} + +func (x *SyscallEffects) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*SyscallEffects) ProtoMessage() {} + +func (x *SyscallEffects) ProtoReflect() protoreflect.Message { + mi := &file_vm_proto_msgTypes[4] + if x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use SyscallEffects.ProtoReflect.Descriptor instead. +func (*SyscallEffects) Descriptor() ([]byte, []int) { + return file_vm_proto_rawDescGZIP(), []int{4} +} + +func (x *SyscallEffects) GetError() int64 { + if x != nil { + return x.Error + } + return 0 +} + +func (x *SyscallEffects) GetErrorKind() ErrKind { + if x != nil { + return x.ErrorKind + } + return ErrKind_UNSPECIFIED +} + +func (x *SyscallEffects) GetR0() uint64 { + if x != nil { + return x.R0 + } + return 0 +} + +func (x *SyscallEffects) GetCuAvail() uint64 { + if x != nil { + return x.CuAvail + } + return 0 +} + +func (x *SyscallEffects) GetHeap() []byte { + if x != nil { + return x.Heap + } + return nil +} + +func (x *SyscallEffects) GetStack() []byte { + if x != nil { + return x.Stack + } + return nil +} + +func (x *SyscallEffects) GetInputdata() []byte { + if x != nil { + return x.Inputdata + } + return nil +} + +func (x *SyscallEffects) GetInputDataRegions() []*InputDataRegion { + if x != nil { + return x.InputDataRegions + } + return nil +} + +func (x *SyscallEffects) GetFrameCount() uint64 { + if x != nil { + return x.FrameCount + } + return 0 +} + +func (x *SyscallEffects) GetLog() []byte { + if x != nil { + return x.Log + } + return nil +} + +func (x *SyscallEffects) GetRodata() []byte { + if x != nil { + return x.Rodata + } + return nil +} + +func (x *SyscallEffects) GetPc() uint64 { + if x != nil { + return x.Pc + } + return 0 +} + +func (x *SyscallEffects) GetR1() uint64 { + if x != nil { + return x.R1 + } + return 0 +} + +func (x *SyscallEffects) GetR2() uint64 { + if x != nil { + return x.R2 + } + return 0 +} + +func (x *SyscallEffects) GetR3() uint64 { + if x != nil { + return x.R3 + } + return 0 +} + +func (x *SyscallEffects) GetR4() uint64 { + if x != nil { + return x.R4 + } + return 0 +} + +func (x *SyscallEffects) GetR5() uint64 { + if x != nil { + return x.R5 + } + return 0 +} + +func (x *SyscallEffects) GetR6() uint64 { + if x != nil { + return x.R6 + } + return 0 +} + +func (x *SyscallEffects) GetR7() uint64 { + if x != nil { + return x.R7 + } + return 0 +} + +func (x *SyscallEffects) GetR8() uint64 { + if x != nil { + return x.R8 + } + return 0 +} + +func (x *SyscallEffects) GetR9() uint64 { + if x != nil { + return x.R9 + } + return 0 +} + +func (x *SyscallEffects) GetR10() uint64 { + if x != nil { + return x.R10 + } + return 0 +} + +// A syscall processing test fixture. +type SyscallFixture struct { + state protoimpl.MessageState `protogen:"open.v1"` + Metadata *metadata.FixtureMetadata `protobuf:"bytes,1,opt,name=metadata,proto3" json:"metadata,omitempty"` + Input *SyscallContext `protobuf:"bytes,2,opt,name=input,proto3" json:"input,omitempty"` + Output *SyscallEffects `protobuf:"bytes,3,opt,name=output,proto3" json:"output,omitempty"` + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache +} + +func (x *SyscallFixture) Reset() { + *x = SyscallFixture{} + mi := &file_vm_proto_msgTypes[5] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) +} + +func (x *SyscallFixture) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*SyscallFixture) ProtoMessage() {} + +func (x *SyscallFixture) ProtoReflect() protoreflect.Message { + mi := &file_vm_proto_msgTypes[5] + if x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use SyscallFixture.ProtoReflect.Descriptor instead. +func (*SyscallFixture) Descriptor() ([]byte, []int) { + return file_vm_proto_rawDescGZIP(), []int{5} +} + +func (x *SyscallFixture) GetMetadata() *metadata.FixtureMetadata { + if x != nil { + return x.Metadata + } + return nil +} + +func (x *SyscallFixture) GetInput() *SyscallContext { + if x != nil { + return x.Input + } + return nil +} + +func (x *SyscallFixture) GetOutput() *SyscallEffects { + if x != nil { + return x.Output + } + return nil +} + +// Everything needed to setup a fd_vm_t +type FullVmContext struct { + state protoimpl.MessageState `protogen:"open.v1"` + VmCtx *VmContext `protobuf:"bytes,1,opt,name=vm_ctx,json=vmCtx,proto3" json:"vm_ctx,omitempty"` + // InstrContext instr_ctx = 2; + Features *context.FeatureSet `protobuf:"bytes,3,opt,name=features,proto3" json:"features,omitempty"` + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache +} + +func (x *FullVmContext) Reset() { + *x = FullVmContext{} + mi := &file_vm_proto_msgTypes[6] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) +} + +func (x *FullVmContext) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*FullVmContext) ProtoMessage() {} + +func (x *FullVmContext) ProtoReflect() protoreflect.Message { + mi := &file_vm_proto_msgTypes[6] + if x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use FullVmContext.ProtoReflect.Descriptor instead. +func (*FullVmContext) Descriptor() ([]byte, []int) { + return file_vm_proto_rawDescGZIP(), []int{6} +} + +func (x *FullVmContext) GetVmCtx() *VmContext { + if x != nil { + return x.VmCtx + } + return nil +} + +func (x *FullVmContext) GetFeatures() *context.FeatureSet { + if x != nil { + return x.Features + } + return nil +} + +// Effects of fd_vm_validate +type ValidateVmEffects struct { + state protoimpl.MessageState `protogen:"open.v1"` + Result int32 `protobuf:"varint,1,opt,name=result,proto3" json:"result,omitempty"` + // if result is 0 (success), protobuf will be empty!! + Success bool `protobuf:"varint,2,opt,name=success,proto3" json:"success,omitempty"` + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache +} + +func (x *ValidateVmEffects) Reset() { + *x = ValidateVmEffects{} + mi := &file_vm_proto_msgTypes[7] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) +} + +func (x *ValidateVmEffects) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*ValidateVmEffects) ProtoMessage() {} + +func (x *ValidateVmEffects) ProtoReflect() protoreflect.Message { + mi := &file_vm_proto_msgTypes[7] + if x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use ValidateVmEffects.ProtoReflect.Descriptor instead. +func (*ValidateVmEffects) Descriptor() ([]byte, []int) { + return file_vm_proto_rawDescGZIP(), []int{7} +} + +func (x *ValidateVmEffects) GetResult() int32 { + if x != nil { + return x.Result + } + return 0 +} + +func (x *ValidateVmEffects) GetSuccess() bool { + if x != nil { + return x.Success + } + return false +} + +// Fixture for fd_vm_validate fuzz harness +type ValidateVmFixture struct { + state protoimpl.MessageState `protogen:"open.v1"` + Metadata *metadata.FixtureMetadata `protobuf:"bytes,1,opt,name=metadata,proto3" json:"metadata,omitempty"` + Input *FullVmContext `protobuf:"bytes,2,opt,name=input,proto3" json:"input,omitempty"` + Output *ValidateVmEffects `protobuf:"bytes,3,opt,name=output,proto3" json:"output,omitempty"` + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache +} + +func (x *ValidateVmFixture) Reset() { + *x = ValidateVmFixture{} + mi := &file_vm_proto_msgTypes[8] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) +} + +func (x *ValidateVmFixture) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*ValidateVmFixture) ProtoMessage() {} + +func (x *ValidateVmFixture) ProtoReflect() protoreflect.Message { + mi := &file_vm_proto_msgTypes[8] + if x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use ValidateVmFixture.ProtoReflect.Descriptor instead. +func (*ValidateVmFixture) Descriptor() ([]byte, []int) { + return file_vm_proto_rawDescGZIP(), []int{8} +} + +func (x *ValidateVmFixture) GetMetadata() *metadata.FixtureMetadata { + if x != nil { + return x.Metadata + } + return nil +} + +func (x *ValidateVmFixture) GetInput() *FullVmContext { + if x != nil { + return x.Input + } + return nil +} + +func (x *ValidateVmFixture) GetOutput() *ValidateVmEffects { + if x != nil { + return x.Output + } + return nil +} + +type ReturnData struct { + state protoimpl.MessageState `protogen:"open.v1"` + ProgramId []byte `protobuf:"bytes,1,opt,name=program_id,json=programId,proto3" json:"program_id,omitempty"` + Data []byte `protobuf:"bytes,2,opt,name=data,proto3" json:"data,omitempty"` + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache +} + +func (x *ReturnData) Reset() { + *x = ReturnData{} + mi := &file_vm_proto_msgTypes[9] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) +} + +func (x *ReturnData) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*ReturnData) ProtoMessage() {} + +func (x *ReturnData) ProtoReflect() protoreflect.Message { + mi := &file_vm_proto_msgTypes[9] + if x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use ReturnData.ProtoReflect.Descriptor instead. +func (*ReturnData) Descriptor() ([]byte, []int) { + return file_vm_proto_rawDescGZIP(), []int{9} +} + +func (x *ReturnData) GetProgramId() []byte { + if x != nil { + return x.ProgramId + } + return nil +} + +func (x *ReturnData) GetData() []byte { + if x != nil { + return x.Data + } + return nil +} + +var File_vm_proto protoreflect.FileDescriptor + +const file_vm_proto_rawDesc = "" + + "\n" + + "\bvm.proto\x12\x16org.solana.sealevel.v1\x1a\finvoke.proto\x1a\rcontext.proto\x1a\x0emetadata.proto\"d\n" + + "\x0fInputDataRegion\x12\x16\n" + + "\x06offset\x18\x01 \x01(\x04R\x06offset\x12\x18\n" + + "\acontent\x18\x02 \x01(\fR\acontent\x12\x1f\n" + + "\vis_writable\x18\x03 \x01(\bR\n" + + "isWritable\"\xcf\x04\n" + + "\tVmContext\x12\x19\n" + + "\bheap_max\x18\x01 \x01(\x04R\aheapMax\x12\x16\n" + + "\x06rodata\x18\x02 \x01(\fR\x06rodata\x12;\n" + + "\x1arodata_text_section_offset\x18\x03 \x01(\x04R\x17rodataTextSectionOffset\x12;\n" + + "\x1arodata_text_section_length\x18\x04 \x01(\x04R\x17rodataTextSectionLength\x12\x0e\n" + + "\x02r0\x18\x06 \x01(\x04R\x02r0\x12\x0e\n" + + "\x02r1\x18\a \x01(\x04R\x02r1\x12\x0e\n" + + "\x02r2\x18\b \x01(\x04R\x02r2\x12\x0e\n" + + "\x02r3\x18\t \x01(\x04R\x02r3\x12\x0e\n" + + "\x02r4\x18\n" + + " \x01(\x04R\x02r4\x12\x0e\n" + + "\x02r5\x18\v \x01(\x04R\x02r5\x12\x0e\n" + + "\x02r6\x18\f \x01(\x04R\x02r6\x12\x0e\n" + + "\x02r7\x18\r \x01(\x04R\x02r7\x12\x0e\n" + + "\x02r8\x18\x0e \x01(\x04R\x02r8\x12\x0e\n" + + "\x02r9\x18\x0f \x01(\x04R\x02r9\x12\x10\n" + + "\x03r10\x18\x10 \x01(\x04R\x03r10\x12\x10\n" + + "\x03r11\x18\x11 \x01(\x04R\x03r11\x12\x19\n" + + "\bentry_pc\x18\x14 \x01(\x04R\aentryPc\x12%\n" + + "\x0ecall_whitelist\x18\x15 \x01(\fR\rcallWhitelist\x12'\n" + + "\x0ftracing_enabled\x18\x16 \x01(\bR\x0etracingEnabled\x12C\n" + + "\vreturn_data\x18\x17 \x01(\v2\".org.solana.sealevel.v1.ReturnDataR\n" + + "returnData\x12!\n" + + "\fsbpf_version\x18\x18 \x01(\rR\vsbpfVersion\"|\n" + + "\x11SyscallInvocation\x12#\n" + + "\rfunction_name\x18\x01 \x01(\fR\ffunctionName\x12\x1f\n" + + "\vheap_prefix\x18\x02 \x01(\fR\n" + + "heapPrefix\x12!\n" + + "\fstack_prefix\x18\x03 \x01(\fR\vstackPrefix\"\xe7\x01\n" + + "\x0eSyscallContext\x128\n" + + "\x06vm_ctx\x18\x01 \x01(\v2!.org.solana.sealevel.v1.VmContextR\x05vmCtx\x12A\n" + + "\tinstr_ctx\x18\x02 \x01(\v2$.org.solana.sealevel.v1.InstrContextR\binstrCtx\x12X\n" + + "\x12syscall_invocation\x18\x03 \x01(\v2).org.solana.sealevel.v1.SyscallInvocationR\x11syscallInvocation\"\xad\x04\n" + + "\x0eSyscallEffects\x12\x14\n" + + "\x05error\x18\x01 \x01(\x03R\x05error\x12>\n" + + "\n" + + "error_kind\x18\f \x01(\x0e2\x1f.org.solana.sealevel.v1.ErrKindR\terrorKind\x12\x0e\n" + + "\x02r0\x18\x02 \x01(\x04R\x02r0\x12\x19\n" + + "\bcu_avail\x18\x03 \x01(\x04R\acuAvail\x12\x12\n" + + "\x04heap\x18\x04 \x01(\fR\x04heap\x12\x14\n" + + "\x05stack\x18\x05 \x01(\fR\x05stack\x12\x1c\n" + + "\tinputdata\x18\x06 \x01(\fR\tinputdata\x12U\n" + + "\x12input_data_regions\x18\v \x03(\v2'.org.solana.sealevel.v1.InputDataRegionR\x10inputDataRegions\x12\x1f\n" + + "\vframe_count\x18\a \x01(\x04R\n" + + "frameCount\x12\x10\n" + + "\x03log\x18\b \x01(\fR\x03log\x12\x16\n" + + "\x06rodata\x18\t \x01(\fR\x06rodata\x12\x0e\n" + + "\x02pc\x18\n" + + " \x01(\x04R\x02pc\x12\x0e\n" + + "\x02r1\x18k \x01(\x04R\x02r1\x12\x0e\n" + + "\x02r2\x18l \x01(\x04R\x02r2\x12\x0e\n" + + "\x02r3\x18m \x01(\x04R\x02r3\x12\x0e\n" + + "\x02r4\x18n \x01(\x04R\x02r4\x12\x0e\n" + + "\x02r5\x18o \x01(\x04R\x02r5\x12\x0e\n" + + "\x02r6\x18p \x01(\x04R\x02r6\x12\x0e\n" + + "\x02r7\x18q \x01(\x04R\x02r7\x12\x0e\n" + + "\x02r8\x18r \x01(\x04R\x02r8\x12\x0e\n" + + "\x02r9\x18s \x01(\x04R\x02r9\x12\x10\n" + + "\x03r10\x18t \x01(\x04R\x03r10\"\xd3\x01\n" + + "\x0eSyscallFixture\x12C\n" + + "\bmetadata\x18\x01 \x01(\v2'.org.solana.sealevel.v1.FixtureMetadataR\bmetadata\x12<\n" + + "\x05input\x18\x02 \x01(\v2&.org.solana.sealevel.v1.SyscallContextR\x05input\x12>\n" + + "\x06output\x18\x03 \x01(\v2&.org.solana.sealevel.v1.SyscallEffectsR\x06output\"\x89\x01\n" + + "\rFullVmContext\x128\n" + + "\x06vm_ctx\x18\x01 \x01(\v2!.org.solana.sealevel.v1.VmContextR\x05vmCtx\x12>\n" + + "\bfeatures\x18\x03 \x01(\v2\".org.solana.sealevel.v1.FeatureSetR\bfeatures\"E\n" + + "\x11ValidateVmEffects\x12\x16\n" + + "\x06result\x18\x01 \x01(\x05R\x06result\x12\x18\n" + + "\asuccess\x18\x02 \x01(\bR\asuccess\"\xd8\x01\n" + + "\x11ValidateVmFixture\x12C\n" + + "\bmetadata\x18\x01 \x01(\v2'.org.solana.sealevel.v1.FixtureMetadataR\bmetadata\x12;\n" + + "\x05input\x18\x02 \x01(\v2%.org.solana.sealevel.v1.FullVmContextR\x05input\x12A\n" + + "\x06output\x18\x03 \x01(\v2).org.solana.sealevel.v1.ValidateVmEffectsR\x06output\"?\n" + + "\n" + + "ReturnData\x12\x1d\n" + + "\n" + + "program_id\x18\x01 \x01(\fR\tprogramId\x12\x12\n" + + "\x04data\x18\x02 \x01(\fR\x04data*B\n" + + "\aErrKind\x12\x0f\n" + + "\vUNSPECIFIED\x10\x00\x12\b\n" + + "\x04EBPF\x10\x01\x12\v\n" + + "\aSYSCALL\x10\x02\x12\x0f\n" + + "\vINSTRUCTION\x10\x03b\x06proto3" + +var ( + file_vm_proto_rawDescOnce sync.Once + file_vm_proto_rawDescData []byte +) + +func file_vm_proto_rawDescGZIP() []byte { + file_vm_proto_rawDescOnce.Do(func() { + file_vm_proto_rawDescData = protoimpl.X.CompressGZIP(unsafe.Slice(unsafe.StringData(file_vm_proto_rawDesc), len(file_vm_proto_rawDesc))) + }) + return file_vm_proto_rawDescData +} + +var file_vm_proto_enumTypes = make([]protoimpl.EnumInfo, 1) +var file_vm_proto_msgTypes = make([]protoimpl.MessageInfo, 10) +var file_vm_proto_goTypes = []any{ + (ErrKind)(0), // 0: org.solana.sealevel.v1.ErrKind + (*InputDataRegion)(nil), // 1: org.solana.sealevel.v1.InputDataRegion + (*VmContext)(nil), // 2: org.solana.sealevel.v1.VmContext + (*SyscallInvocation)(nil), // 3: org.solana.sealevel.v1.SyscallInvocation + (*SyscallContext)(nil), // 4: org.solana.sealevel.v1.SyscallContext + (*SyscallEffects)(nil), // 5: org.solana.sealevel.v1.SyscallEffects + (*SyscallFixture)(nil), // 6: org.solana.sealevel.v1.SyscallFixture + (*FullVmContext)(nil), // 7: org.solana.sealevel.v1.FullVmContext + (*ValidateVmEffects)(nil), // 8: org.solana.sealevel.v1.ValidateVmEffects + (*ValidateVmFixture)(nil), // 9: org.solana.sealevel.v1.ValidateVmFixture + (*ReturnData)(nil), // 10: org.solana.sealevel.v1.ReturnData + (*invoke.InstrContext)(nil), // 11: org.solana.sealevel.v1.InstrContext + (*metadata.FixtureMetadata)(nil), // 12: org.solana.sealevel.v1.FixtureMetadata + (*context.FeatureSet)(nil), // 13: org.solana.sealevel.v1.FeatureSet +} +var file_vm_proto_depIdxs = []int32{ + 10, // 0: org.solana.sealevel.v1.VmContext.return_data:type_name -> org.solana.sealevel.v1.ReturnData + 2, // 1: org.solana.sealevel.v1.SyscallContext.vm_ctx:type_name -> org.solana.sealevel.v1.VmContext + 11, // 2: org.solana.sealevel.v1.SyscallContext.instr_ctx:type_name -> org.solana.sealevel.v1.InstrContext + 3, // 3: org.solana.sealevel.v1.SyscallContext.syscall_invocation:type_name -> org.solana.sealevel.v1.SyscallInvocation + 0, // 4: org.solana.sealevel.v1.SyscallEffects.error_kind:type_name -> org.solana.sealevel.v1.ErrKind + 1, // 5: org.solana.sealevel.v1.SyscallEffects.input_data_regions:type_name -> org.solana.sealevel.v1.InputDataRegion + 12, // 6: org.solana.sealevel.v1.SyscallFixture.metadata:type_name -> org.solana.sealevel.v1.FixtureMetadata + 4, // 7: org.solana.sealevel.v1.SyscallFixture.input:type_name -> org.solana.sealevel.v1.SyscallContext + 5, // 8: org.solana.sealevel.v1.SyscallFixture.output:type_name -> org.solana.sealevel.v1.SyscallEffects + 2, // 9: org.solana.sealevel.v1.FullVmContext.vm_ctx:type_name -> org.solana.sealevel.v1.VmContext + 13, // 10: org.solana.sealevel.v1.FullVmContext.features:type_name -> org.solana.sealevel.v1.FeatureSet + 12, // 11: org.solana.sealevel.v1.ValidateVmFixture.metadata:type_name -> org.solana.sealevel.v1.FixtureMetadata + 7, // 12: org.solana.sealevel.v1.ValidateVmFixture.input:type_name -> org.solana.sealevel.v1.FullVmContext + 8, // 13: org.solana.sealevel.v1.ValidateVmFixture.output:type_name -> org.solana.sealevel.v1.ValidateVmEffects + 14, // [14:14] is the sub-list for method output_type + 14, // [14:14] is the sub-list for method input_type + 14, // [14:14] is the sub-list for extension type_name + 14, // [14:14] is the sub-list for extension extendee + 0, // [0:14] is the sub-list for field type_name +} + +func init() { file_vm_proto_init() } +func file_vm_proto_init() { + if File_vm_proto != nil { + return + } + type x struct{} + out := protoimpl.TypeBuilder{ + File: protoimpl.DescBuilder{ + GoPackagePath: reflect.TypeOf(x{}).PkgPath(), + RawDescriptor: unsafe.Slice(unsafe.StringData(file_vm_proto_rawDesc), len(file_vm_proto_rawDesc)), + NumEnums: 1, + NumMessages: 10, + NumExtensions: 0, + NumServices: 0, + }, + GoTypes: file_vm_proto_goTypes, + DependencyIndexes: file_vm_proto_depIdxs, + EnumInfos: file_vm_proto_enumTypes, + MessageInfos: file_vm_proto_msgTypes, + }.Build() + File_vm_proto = out.File + file_vm_proto_goTypes = nil + file_vm_proto_depIdxs = nil +}