sealevel

package
v0.0.0-...-49ff46f Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Dec 4, 2024 License: Apache-2.0 Imports: 41 Imported by: 0

Documentation

Index

Constants

View Source
const (
	AddrLookupTableInstrTypeCreateLookupTable = iota
	AddrLookupTableInstrTypeFreezeLookupTable
	AddrLookupTableInstrTypeExtendLookupTable
	AddrLookupTableInstrTypeDeactivateLookupTable
	AddrLookupTableInstrTypeCloseLookupTable
)
View Source
const (
	AddressLookupTableProgramStateUninitialized = iota
	AddressLookupTableProgramStateLookupTable
)

account states

View Source
const (
	AddressLookupTableStatusTypeActivated = iota
	AddressLookupTableStatusTypeDeactivating
	AddressLookupTableStatusTypeDeactivated
)

address lookup table statuses

View Source
const (
	UpgradeableLoaderInstrTypeInitializeBuffer = iota
	UpgradeableLoaderInstrTypeWrite
	UpgradeableLoaderInstrTypeDeployWithMaxDataLen
	UpgradeableLoaderInstrTypeUpgrade
	UpgradeableLoaderInstrTypeSetAuthority
	UpgradeableLoaderInstrTypeClose
	UpgradeableLoaderInstrTypeExtendProgram
	UpgradeableLoaderInstrTypeSetAuthorityChecked
)
View Source
const (
	UpgradeableLoaderStateTypeUninitialized = iota
	UpgradeableLoaderStateTypeBuffer
	UpgradeableLoaderStateTypeProgram
	UpgradeableLoaderStateTypeProgramData
)
View Source
const (
	MinHeapFrameBytes                  = (32 * 1024)
	MaxHeapFrameBytes                  = (256 * 1024)
	HeapFrameBytesMultiple             = 1024
	DefaultInstructionComputeUnitLimit = 200000
	MaxComputeUnitLimit                = 1400000
	MaxLoadedAccountsDataSizeBytes     = (64 * 1024 * 1024)
)
View Source
const (
	ComputeBudgetInstrTypeRequestHeapFrame               = 1
	ComputeBudgetInstrTypeSetComputeUnitLimit            = 2
	ComputeBudgetInstrTypeSetComputeUnitPrice            = 3
	ComputeBudgetInstrTypeSetLoadedAccountsDataSizeLimit = 4
)
View Source
const (
	CUSyscallBaseCost                         = 100
	CULog64Units                              = 100
	CULogPubkeyUnits                          = 100
	CUMemOpBaseCost                           = 10
	CUCpiBytesPerUnit                         = 250
	CUSha256BaseCost                          = 85
	CUSha256ByteCost                          = 1
	CUCreateProgramAddressUnits               = 1500
	CUSecP256k1RecoverCost                    = 25000
	CUInvokeUnits                             = 1000
	CUConfigProcessorDefaultComputeUnits      = 450
	CUSystemProgramDefaultComputeUnits        = 150
	CUVoteProgramDefaultComputeUnits          = 2100
	CUStakeProgramDefaultComputeUnits         = 750
	CUSha256MaxSlices                         = 20000
	CUMaxCpiInstructionSize                   = 1280
	CUUpgradeableLoaderComputeUnits           = 2370
	CUDeprecatedLoaderComputeUnits            = 1140
	CUDefaultLoaderComputeUnits               = 570
	CUHeapCostDefault                         = 8
	CUAddressLookupTableDefaultComputeUnits   = 750
	CUComputeBudgetProgramDefaultComputeUnits = 150
	CUCurve25519EdwardsValidatePointCost      = 159
	CUCurve25519RistrettoValidatePointCost    = 169
	CUCurve25519EdwardsMsmBaseCost            = 2273
	CUCurve25519EdwardsMsmIncrementalCost     = 758
	CUCurve25519RistrettoMsmBaseCost          = 2303
	CUCurve25519RistrettoMsmIncrementalCost   = 788
	CUCurve25519EdwardsAddCost                = 473
	CUCurve25519EdwardsSubCost                = 475
	CUCurve25519EdwardsMulCost                = 2177
	CUCurve25519RistrettoAddCost              = 521
	CUCurve25519RistrettoSubCost              = 519
	CUCurve25519RistrettoMulCost              = 2208
	CUBn128G1Compress                         = 30
	CUBn128G1Decompress                       = 398
	CUBn128G2Compress                         = 86
	CUBn128G2Decompress                       = 13610
	CUBn128AdditionCost                       = 334
	CUBn128MultiplicationCost                 = 3840
	CUBn128PairingOnePairCostFirst            = 36364
	CUBn128PairingOnePairCostOther            = 12121
)
View Source
const (
	InstrErrCodeSuccess                                = 0
	InstrErrCodeGenericError                           = 0
	InstrErrCodeInvalidArgument                        = 1
	InstrErrCodeInvalidInstructionData                 = 2
	InstrErrCodeInvalidAccountData                     = 3
	InstrErrCodeAccountDataTooSmall                    = 4
	InstrErrCodeInsufficientFunds                      = 5
	InstrErrCodeIncorrectProgramId                     = 6
	InstrErrCodeMissingRequiredSignature               = 7
	InstrErrCodeAccountAlreadyInitialized              = 8
	InstrErrCodeUninitializedAccount                   = 9
	InstrErrCodeUnbalancedInstruction                  = 10
	InstrErrCodeModifiedProgramId                      = 11
	InstrErrCodeExternalAccountLamportSpend            = 12
	InstrErrCodeExternalAccountDataModified            = 13
	InstrErrCodeReadonlyLamportChange                  = 14
	InstrErrCodeReadonlyDataModified                   = 15
	InstrErrCodeDuplicateAccountIndex                  = 16
	InstrErrCodeExecutableModified                     = 17
	InstrErrCodeRentEpochModified                      = 18
	InstrErrCodeNotEnoughAccountKeys                   = 19
	InstrErrCodeAccountDataSizeChanged                 = 20
	InstrErrCodeAccountNotExecutable                   = 21
	InstrErrCodeAccountBorrowFailed                    = 22
	InstrErrCodeAccountBorrowOutstanding               = 23
	InstrErrCodeDuplicateAccountOutOfSync              = 24
	InstrErrCodeCustom                                 = 25
	InstrErrCodeInvalidError                           = 26
	InstrErrCodeExecutableDataModified                 = 27
	InstrErrCodeExecutableLamportChange                = 28
	InstrErrCodeExecutableAccountNotRentExempt         = 29
	InstrErrCodeUnsupportedProgramId                   = 30
	InstrErrCodeCallDepth                              = 31
	InstrErrCodeMissingAccount                         = 32
	InstrErrCodeReentrancyNotAllowed                   = 33
	InstrErrCodeMaxSeedLengthExceeded                  = 34
	InstrErrCodeInvalidSeeds                           = 35
	InstrErrCodeInvalidRealloc                         = 36
	InstrErrCodeComputationalBudgetExceeded            = 37
	InstrErrCodePrivilegeEscalation                    = 38
	InstrErrCodeProgramEnvironmentSetupFailure         = 39
	InstrErrCodeProgramFailedToComplete                = 40
	InstrErrCodeProgramFailedToCompile                 = 41
	InstrErrCodeImmutable                              = 42
	InstrErrCodeIncorrectAuthority                     = 43
	InstrErrCodeBorshIoError                           = 44
	InstrErrCodeAccountNotRentExempt                   = 45
	InstrErrCodeInvalidAccountOwner                    = 46
	InstrErrCodeArithmeticOverflow                     = 47
	InstrErrCodeUnsupportedSysvar                      = 48
	InstrErrCodeIllegalOwner                           = 49
	InstrErrCodeMaxAccountsDataAllocationsExceeded     = 50
	InstrErrCodeMaxAccountsExceeded                    = 51
	InstrErrCodeMaxInstructionTraceLengthExceeded      = 52
	InstrErrCodeBuiltinProgramsMustConsumeComputeUnits = 53
)

instruction errors - Solana numerical error codes

View Source
const (
	PrecompileErrCodeInvalidDataOffsets         = 100
	PrecompileErrCodeInvalidInstructionDataSize = 101
	PrecompileErrCodeInvalidSignature           = 102
	PrecompileErrCodeInvalidRecoveryId          = 103 // TODO: not sure this is correct
)

precompile program errors - Solana numerical error codes

View Source
const (
	StakeProgramInstrTypeInitialize = iota
	StakeProgramInstrTypeAuthorize
	StakeProgramInstrTypeDelegateStake
	StakeProgramInstrTypeSplit
	StakeProgramInstrTypeWithdraw
	StakeProgramInstrTypeDeactivate
	StakeProgramInstrTypeSetLockup
	StakeProgramInstrTypeMerge
	StakeProgramInstrTypeAuthorizeWithSeed
	StakeProgramInstrTypeInitializeChecked
	StakeProgramInstrTypeAuthorizeChecked
	StakeProgramInstrTypeAuthorizeCheckedWithSeed
	StakeProgramInstrTypeSetLockupChecked
	StakeProgramInstrTypeGetMinimumDelegation
	StakeProgramInstrTypeDeactivateDelinquent
	StakeProgramInstrTypeRedelegate
)
View Source
const (
	StakeStateV2StatusUninitialized = iota
	StakeStateV2StatusInitialized
	StakeStateV2StatusStake
	StakeStateV2StatusRewardsPool
)
View Source
const (
	StakeAuthorizeStaker = iota
	StakeAuthorizeWithdrawer
)
View Source
const (
	MergeKindStatusInactive = iota
	MergeKindStatusActivationEpoch
	MergeKindStatusFullyActive
)
View Source
const (
	MaxSigners                = 16
	MaxCpiInstructionDataLen  = 10 * 1024
	MaxCpiInstructionAccounts = 255
	MaxCpiAccountInfos        = 128
)
View Source
const (
	Curve25519Edwards   = 0
	Curve25519Ristretto = 1
)

curve types

View Source
const (
	CurvePointBytesLen  = 32
	CurveScalarBytesLen = 32
)
View Source
const (
	CurveOpAdd = 0
	CurveOpSub = 1
	CurveOpMul = 2
)

curve operations

View Source
const (
	AltBn128G1Compress   = 0
	AltBn128G1Decompress = 1
	AltBn128G2Compress   = 2
	AltBn128G2Decompress = 3
)

alt bn128 compression operations

View Source
const (
	Bn128G1Len           = 64
	Bn128G2Len           = 128
	Bn128G1CompressedLen = 32
	Bn128G2CompressedLen = 64
)
View Source
const (
	AltBn128Add     = 0
	AltBn128Sub     = 1
	AltBn128Mul     = 2
	AltBn128Pairing = 3
)

alt bn128 operations

View Source
const (
	AltBn128AdditionInputLen        = 128
	AltBn128MultiplicationInputLen  = 128
	AltBn128PairingElementLen       = 192
	AltBn128AdditionOutputLen       = 64
	AltBn128MultiplicationOutputLen = 64
	AltBn128PairingOutputLen        = 32
	AltBn128FieldSize               = 32
	AltBn128PointSize               = 64
)

alt bn128 input/output lengths

View Source
const (
	SystemProgramInstrTypeCreateAccount = iota
	SystemProgramInstrTypeAssign
	SystemProgramInstrTypeTransfer
	SystemProgramInstrTypeCreateAccountWithSeed
	SystemProgramInstrTypeAdvanceNonceAccount
	SystemProgramInstrTypeWithdrawNonceAccount
	SystemProgramInstrTypeInitializeNonceAccount
	SystemProgramInstrTypeAuthorizeNonceAccount
	SystemProgramInstrTypeAllocate
	SystemProgramInstrTypeAllocateWithSeed
	SystemProgramInstrTypeAssignWithSeed
	SystemProgramInstrTypeTransferWithSeed
	SystemProgramInstrTypeUpgradeNonceAccount
)
View Source
const (
	NonceVersionLegacy  = 0
	NonceVersionCurrent = 1
)
View Source
const (
	VoteProgramInstrTypeInitializeAccount = iota
	VoteProgramInstrTypeAuthorize
	VoteProgramInstrTypeVote
	VoteProgramInstrTypeWithdraw
	VoteProgramInstrTypeUpdateValidatorIdentity
	VoteProgramInstrTypeUpdateCommission
	VoteProgramInstrTypeVoteSwitch
	VoteProgramInstrTypeAuthorizeChecked
	VoteProgramInstrTypeUpdateVoteState
	VoteProgramInstrTypeUpdateVoteStateSwitch
	VoteProgramInstrTypeAuthorizeWithSeed
	VoteProgramInstrTypeAuthorizeCheckedWithSeed
	VoteProgramInstrTypeCompactUpdateVoteState
	VoteProgramInstrTypeCompactUpdateVoteStateSwitch
)
View Source
const (
	VoteAuthorizeTypeVoter = iota
	VoteAuthorizeTypeWithdrawer
)
View Source
const (
	VoteStateVersionV0_23_5 = iota
	VoteStateVersionV1_14_11
	VoteStateVersionCurrent
)
View Source
const (
	VoteStateV2Size = 3731
	VoteStateV3Size = 3762
)
View Source
const (
	MaxLockoutHistory            = 31
	VoteCreditsGraceSlots        = 2
	VoteCreditsMaximumPerSlot    = 16
	VoteCreditsMaximumPerSlotOld = 8
	MaxEpochCreditsHistory       = 64
)
View Source
const AccountMetaSize = 34
View Source
const AddressLookupTableMetaSize = 56
View Source
const BpfLoader2AddrStr = "BPFLoader2111111111111111111111111111111111"
View Source
const BpfLoaderDeprecatedAddrStr = "BPFLoader1111111111111111111111111111111111"
View Source
const BpfLoaderUpgradeableAddrStr = "BPFLoaderUpgradeab1e11111111111111111111111"
View Source
const ConfigProgramAddrStr = "Config1111111111111111111111111111111111111"
View Source
const Ed25519PrecompileAddrStr = "Ed25519SigVerify111111111111111111111111111"
View Source
const InitialLockout = 2
View Source
const LookupTableMaxAddresses = 256
View Source
const MaxInstructionAccounts = 255
View Source
const MaxPermittedDataIncrease = 1024 * 10
View Source
const MaxPermittedDataLength = 10 * 1024 * 1024
View Source
const MaxReturnData = 1024
View Source
const MaxSeedLen = 32
View Source
const MaxSeeds = 16
View Source
const MinimumDelinquentEpochsForDeactivation = 5
View Source
const MinimumSlotsPerEpoch = 32
View Source
const NativeLoaderAddrStr = "NativeLoader1111111111111111111111111111111"
View Source
const PoseidonCostCoefficientA = 61
View Source
const PoseidonCostCoefficientC = 542
View Source
const ProcessedSiblingInstructionSize = 16
View Source
const PubkeySerializedSize = 32
View Source
const ReallocAlign = 8

ReallocAlign is the byte amount by which the data following a realloc is aligned.

View Source
const ReallocSpace = 1024 * 10

ReallocSpace is the allowed length by which an account is allowed to grow.

View Source
const RefCellRustSize = 40
View Source
const Secp256k1HashedPubkeySerializedSize = 20
View Source
const Secp256k1SignatureOffsetsSerializedSize = 11
View Source
const Secp256k1SignatureOffsetsStart = 1
View Source
const Secp256k1SignatureSerializedSize = 64
View Source
const Secp256kPrecompileAddrStr = "KeccakSecp256k11111111111111111111111111111"
View Source
const SignatureOffsetStarts = 2
View Source
const SignatureOffsetsSerializedSize = 14
View Source
const SignatureSerializedSize = 64
View Source
const SlotHashesMaxEntries = 512
View Source
const SolAccountInfoCSize = 56
View Source
const SolAccountInfoRustSize = 48
View Source
const SolAccountMetaCSize = 16
View Source
const SolAccountMetaRustSize = 34
View Source
const SolInstructionCStructSize = 40
View Source
const SolInstructionRustStructSize = 80
View Source
const SolSignerSeedsCSize = 16
View Source
const (
	StakeStateV2Size = 200
)
View Source
const SystemProgMaxPermittedDataLen = 10 * 1024 * 1024
View Source
const SysvarClockAddrStr = "SysvarC1ock11111111111111111111111111111111"
View Source
const SysvarClockStructLen = 40
View Source
const SysvarEpochRewardsAddrStr = "SysvarEpochRewards1111111111111111111111111"
View Source
const SysvarEpochRewardsStructLen = 96
View Source
const SysvarEpochScheduleAddrStr = "SysvarEpochSchedu1e111111111111111111111111"
View Source
const SysvarEpochScheduleStructLen = 40
View Source
const SysvarFeesAddrStr = "SysvarFees111111111111111111111111111111111"
View Source
const SysvarFeesStructLen = 8
View Source
const SysvarInstructionsAddrStr = "Sysvar1nstructions1111111111111111111111111"
View Source
const SysvarLastRestartSlotAddrStr = "SysvarLastRestartS1ot1111111111111111111111"
View Source
const SysvarLastRestartSlotStructLen = 8
View Source
const SysvarOwnerStr = "Sysvar1111111111111111111111111111111111111"
View Source
const SysvarRecentBlockHashesAddrStr = "SysvarRecentB1ockHashes11111111111111111111"
View Source
const SysvarRentAddrStr = "SysvarRent111111111111111111111111111111111"
View Source
const SysvarRentStructLen = 24
View Source
const SysvarSlotHashesAddrStr = "SysvarS1otHashes111111111111111111111111111"
View Source
const SysvarSlotHistoryAddrStr = "SysvarS1otHistory11111111111111111111111111"
View Source
const SysvarStakeHistoryAddrStr = "SysvarStakeHistory1111111111111111111111111"

Variables

View Source
var (
	InstrErrInvalidInstructionData                 = errors.New("InstrErrInvalidInstructionData")
	InstrErrNotEnoughAccountKeys                   = errors.New("InstrErrNotEnoughAccountKeys")
	InstrErrComputationalBudgetExceeded            = errors.New("InstrErrComputationalBudgetExceeded")
	InstrErrMissingAccount                         = errors.New("InstrErrMissingAccount")
	InstrErrInvalidAccountOwner                    = errors.New("InstrErrInvalidAccountOwner")
	InstrErrInvalidAccountData                     = errors.New("InstrErrInvalidAccountData")
	InstrErrMissingRequiredSignature               = errors.New("InstrErrMissingRequiredSignature")
	InstrErrInvalidArgument                        = errors.New("InstrErrInvalidArgument")
	InstrErrExecutableDataModified                 = errors.New("InstrErrExecutableDataModified")
	InstrErrReadonlyDataModified                   = errors.New("InstrErrReadonlyDataModified")
	InstrErrExternalAccountDataModified            = errors.New("InstrErrExternalAccountDataModified")
	InstrErrPrivilegeEscalation                    = errors.New("InstrErrPrivilegeEscalation")
	InstrErrAccountNotExecutable                   = errors.New("InstrErrAccountNotExecutable")
	InstrErrAccountDataSizeChanged                 = errors.New("InstrErrAccountDataSizeChanged")
	InstrErrInvalidRealloc                         = errors.New("InstrErrInvalidRealloc")
	InstrErrModifiedProgramId                      = errors.New("InstrErrModifiedProgramId")
	InstrErrCallDepth                              = errors.New("InstrErrCallDepth")
	InstrErrUnsupportedProgramId                   = errors.New("InstrErrUnsupportedProgramId")
	InstrErrReentrancyNotAllowed                   = errors.New("InstrErrReentrancyNotAllowed")
	InstrErrArithmeticOverflow                     = errors.New("InstrErrArithmeticOverflow")
	InstrErrUnbalancedInstruction                  = errors.New("InstrErrUnbalancedInstruction")
	InstrErrAccountDataTooSmall                    = errors.New("InstrErrAccountDataTooSmall")
	InstrErrAccountBorrowOutstanding               = errors.New("InstrErrAccountBorrowOutstanding")
	InstrErrExternalAccountLamportSpend            = errors.New("InstrErrExternalAccountLamportSpend")
	InstrErrReadonlyLamportChange                  = errors.New("InstrErrReadonlyLamportChange")
	InstrErrExecutableLamportChange                = errors.New("InstrErrExecutableLamportChange")
	InstrErrInsufficientFunds                      = errors.New("InstrErrInsufficientFunds")
	InstrErrAccountAlreadyInitialized              = errors.New("InstrErrAccountAlreadyInitialized")
	InstrErrUninitializedAccount                   = errors.New("InstrErrUninitializedAccount")
	InstrErrIncorrectProgramId                     = errors.New("InstrErrIncorrectProgramId")
	InstrErrImmutable                              = errors.New("InstrErrImmutable")
	InstrErrIncorrectAuthority                     = errors.New("InstrErrIncorrectAuthority")
	InstrErrExecutableAccountNotRentExempt         = errors.New("InstrErrExecutableAccountNotRentExempt")
	InstrErrExecutableModified                     = errors.New("InstrErrExecutableModified")
	InstrErrMaxAccountsExceeded                    = errors.New("InstrErrMaxAccountsExceeded")
	InstrErrAccountBorrowFailed                    = errors.New("InstrErrAccountBorrowFailed")
	InstrErrDuplicateAccountIndex                  = errors.New("InstrErrDuplicateAccountIndex")
	InstrErrRentEpochModified                      = errors.New("InstrErrRentEpochModified")
	InstrErrDuplicateAccountOutOfSync              = errors.New("InstrErrDuplicateAccountOutOfSync")
	InstrErrCustom                                 = errors.New("InstrErrCustom")
	InstrErrInvalidError                           = errors.New("InstrErrInvalidError")
	InstrErrGenericError                           = errors.New("InstrErrGenericError")
	InstrErrMaxSeedLengthExceeded                  = errors.New("InstrErrMaxSeedLengthExceeded")
	InstrErrInvalidSeeds                           = errors.New("InstrErrInvalidSeeds")
	InstrErrProgramEnvironmentSetupFailure         = errors.New("InstrErrProgramEnvironmentSetupFailure")
	InstrErrProgramFailedToComplete                = errors.New("InstrErrProgramFailedToComplete")
	InstrErrProgramFailedToCompile                 = errors.New("InstrErrProgramFailedToCompile")
	InstrErrBorshIoError                           = errors.New("InstrErrBorshIoError")
	InstrErrAccountNotRentExempt                   = errors.New("InstrErrAccountNotRentExempt")
	InstrErrUnsupportedSysvar                      = errors.New("InstrErrUnsupportedSysvar")
	InstrErrIllegalOwner                           = errors.New("InstrErrIllegalOwner")
	InstrErrMaxAccountsDataAllocationsExceeded     = errors.New("InstrErrMaxAccountsDataAllocationsExceeded")
	InstrErrMaxInstructionTraceLengthExceeded      = errors.New("InstrErrMaxInstructionTraceLengthExceeded")
	InstrErrBuiltinProgramsMustConsumeComputeUnits = errors.New("InstrErrBuiltinProgramsMustConsumeComputeUnits")
)

instruction errors

View Source
var (
	SyscallErrCopyOverlapping                    = errors.New("SyscallErrCopyOverlapping")
	SyscallErrTooManySlices                      = errors.New("SyscallErrTooManySlices")
	SyscallErrInvalidLength                      = errors.New("SyscallErrInvalidLength")
	SyscallErrInvalidString                      = errors.New("SyscallErrInvalidString")
	SyscallErrMaxSeedLengthExceeded              = errors.New("SyscallErrMaxSeedLengthExceeded")
	SyscallErrReturnDataTooLarge                 = errors.New("SyscallErrReturnDataTooLarge")
	SyscallErrInvalidArgument                    = errors.New("SyscallErrInvalidArgument")
	SyscallErrNotEnoughAccountKeys               = errors.New("SyscallErrNotEnoughAccountKeys")
	SyscallErrTooManySigners                     = errors.New("SyscallErrTooManySigners")
	SyscallErrTooManyBytesConsumed               = errors.New("SyscallErrTooManyBytesConsumed")
	SyscallErrMalformedBool                      = errors.New("SyscallErrMalformedBool")
	SyscallErrProgramNotSupported                = errors.New("SyscallErrProgramNotSupported")
	SyscallErrMaxInstructionDataLenExceeded      = errors.New("SyscallErrMaxInstructionDataLenExceeded")
	SyscallErrMaxInstructionAccountsExceeded     = errors.New("SyscallErrMaxInstructionAccountsExceeded")
	SyscallErrInstructionTooLarge                = errors.New("SyscallErrInstructionTooLarge")
	SyscallErrMaxInstructionAccountInfosExceeded = errors.New("SyscallErrMaxInstructionAccountInfosExceeded")
	SyscallErrTooManyAccounts                    = errors.New("SyscallErrTooManyAccounts")
)

syscall errors

View Source
var (
	PubkeyErrIllegalOwner          = errors.New("PubkeyErrIllegalOwner")
	PubkeyErrInvalidSeeds          = errors.New("PubkeyErrInvalidSeeds")
	PubkeyErrMaxSeedLengthExceeded = errors.New("PubkeyErrMaxSeedLengthExceeded")
)
View Source
var (
	PrecompileErrPublicKey     = errors.New("PrecompileErrPublicKey")
	PrecompileErrRecoveryId    = errors.New("PrecompileErrRecoveryId")
	PrecompileErrSignature     = errors.New("PrecompileErrSignature")
	PrecompileErrDataOffset    = errors.New("PrecompileErrDataOffset")
	PrecompileErrInstrDataSize = errors.New("PrecompileErrInstrDataSize")
)

precompile errors

View Source
var (
	StakeErrCustodianMissing                                               = errors.New("StakeErrCustodianMissing")
	StakeErrCustodianSignatureMissing                                      = errors.New("StakeErrCustodianSignatureMissing")
	StakeErrLockupInForce                                                  = errors.New("StakeErrLockupInForce")
	StakeErrInsufficientDelegation                                         = errors.New("StakeErrInsufficientDelegation")
	StakeErrTooSoonToRedelegate                                            = errors.New("StakeErrTooSoonToRedelegate")
	StakeErrInsufficientStake                                              = errors.New("StakeErrInsufficientStake")
	StakeErrMergeTransientStake                                            = errors.New("StakeErrMergeTransientStake")
	StakeErrMergeMismatch                                                  = errors.New("StakeErrMergeMismatch")
	StakeErrAlreadyDeactivated                                             = errors.New("StakeErrAlreadyDeactivated")
	StakeErrRedelegatedStakeMustFullyActivateBeforeDeactivationIsPermitted = errors.New("StakeErrRedelegatedStakeMustFullyActivateBeforeDeactivationIsPermitted")
	StakeErrInsufficientReferenceVotes                                     = errors.New("StakeErrInsufficientReferenceVotes")
	StakeErrVoteAddressMismatch                                            = errors.New("StakeErrVoteAddressMismatch")
	StakeErrMinimumDelinquentEpochsForDeactivationNotMet                   = errors.New("StakeErrMinimumDelinquentEpochsForDeactivationNotMet")
	StakeErrRedelegateTransientOrInactiveStake                             = errors.New("StakeErrRedelegateTransientOrInactiveStake")
	StakeErrRedelegateToSameVoteAccount                                    = errors.New("StakeErrRedelegateToSameVoteAccount")
	StakeErrEpochRewardsActive                                             = errors.New("StakeErrEpochRewardsActive")
)

stake errors

View Source
var (
	SystemProgErrAccountAlreadyInUse        = errors.New("SystemProgErrAccountAlreadyInUse")
	SystemProgErrInvalidAccountDataLength   = errors.New("SystemProgErrInvalidAccountDataLength")
	SystemProgErrResultWithNegativeLamports = errors.New("SystemProgErrResultWithNegativeLamports")
	SystemProgErrAddressWithSeedMismatch    = errors.New("SystemProgErrAddressWithSeedMismatch")
	SystemProgErrNonceNoRecentBlockhashes   = errors.New("SystemProgErrNonceNoRecentBlockhashes")
	SystemProgErrNonceBlockhashNotExpired   = errors.New("SystemProgErrNonceBlockhashNotExpired")
)
View Source
var (
	VoteErrTooSoonToReauthorize        = errors.New("VoteErrTooSoonToReauthorize")
	VoteErrCommissionUpdateTooLate     = errors.New("VoteErrCommissionUpdateTooLate")
	VoteErrEmptySlots                  = errors.New("VoteErrEmptySlots")
	VoteErrVotesTooOldAllFiltered      = errors.New("VoteErrVotesTooOldAllFiltered")
	VoteErrVoteTooOld                  = errors.New("VoteErrVoteTooOld")
	VoteErrSlotsMismatch               = errors.New("VoteErrSlotsMismatch")
	VoteErrSlotHashMismatch            = errors.New("VoteErrSlotHashMismatch")
	VoteErrTimestampTooOld             = errors.New("VoteErrTimestampTooOld")
	VoteErrSlotsNotOrdered             = errors.New("VoteErrSlotsNotOrdered")
	VoteErrRootOnDifferentFork         = errors.New("VoteErrRootOnDifferentFork")
	VoteErrTooManyVotes                = errors.New("VoteErrTooManyVotes")
	VoteErrRootRollback                = errors.New("VoteErrRootRollback")
	VoteErrZeroConfirmations           = errors.New("VoteErrZeroConfirmations")
	VoteErrConfirmationTooLarge        = errors.New("VoteErrConfirmationTooLarge")
	VoteErrSlotSmallerThanRoot         = errors.New("VoteErrSlotSmallerThanRoot")
	VoteErrConfirmationsNotOrdered     = errors.New("VoteErrConfirmationsNotOrdered")
	VoteErrNewVoteStateLockoutMismatch = errors.New("VoteErrNewVoteStateLockoutMismatch")
	VoteErrLockoutConflict             = errors.New("VoteErrLockoutConflict")
	VoteErrConfirmationRollback        = errors.New("VoteErrConfirmationRollback")
	VoteErrActiveVoteAccountClose      = errors.New("VoteErrActiveVoteAccountClose")
)
View Source
var AddressLookupTableProgramAddrStr = "AddressLookupTab1e1111111111111111111111111"
View Source
var ComputeBudgetProgramAddrStr = "ComputeBudget111111111111111111111111111111"
View Source
var DefaultWarmupCooldownRate float64 = 0.25
View Source
var IncineratorAddrStr = "1nc1nerator11111111111111111111111111111111"
View Source
var IsPrecompile = errors.New("IsPrecompile")
View Source
var NewWarmupCooldownRate float64 = 0.09
View Source
var SECP256K1_N = [8]uint32{0xD0364141, 0xBFD25E8C, 0xAF48A03B, 0xBAAEDCE6, 0xFFFFFFFE, 0xFFFFFFFF, 0xFFFFFFFF, 0xFFFFFFFF}
View Source
var (
	StakeFlagsMustFullyActivateBeforeDeactivationIsPermitted = StakeFlags{Bits: 1}
)
View Source
var StakeProgramAddrStr = "Stake11111111111111111111111111111111111111"
View Source
var StakeProgramConfigAddrStr = "StakeConfig11111111111111111111111111111111"
View Source
var SyscallAltBn128Compression = sbpf.SyscallFunc4(SyscallAltBn128CompressionImpl)
View Source
var SyscallCreateProgramAddress = sbpf.SyscallFunc4(SyscallCreateProgramAddressImpl)
View Source
var SyscallCurveMultiscalarMultiplication = sbpf.SyscallFunc5(SyscallCurveMultiscalarMultiplicationImpl)
View Source
var SyscallGetEpochRewardsSysvar = sbpf.SyscallFunc1(SyscallGetEpochRewardsSysvarImpl)
View Source
var SyscallGetEpochScheduleSysvar = sbpf.SyscallFunc1(SyscallGetEpochScheduleSysvarImpl)
View Source
var SyscallGetLastRestartSlotSysvar = sbpf.SyscallFunc1(SyscallGetLastRestartSlotSysvarImpl)
View Source
var SyscallGetProcessedSiblingInstruction = sbpf.SyscallFunc5(SyscallGetProcessedSiblingInstructionImpl)
View Source
var SyscallSecp256k1Recover = sbpf.SyscallFunc4(SyscallSecp256k1RecoverImpl)
View Source
var SyscallTryFindProgramAddress = sbpf.SyscallFunc5(SyscallTryFindProgramAddressImpl)
View Source
var SystemProgramAddrStr = "11111111111111111111111111111111"
View Source
var VoteProgramAddrStr = "Vote111111111111111111111111111111111111111"

Functions

func AddressLookupTableCloseLookupTable

func AddressLookupTableCloseLookupTable(execCtx *ExecutionCtx) error

func AddressLookupTableCreateLookupTable

func AddressLookupTableCreateLookupTable(execCtx *ExecutionCtx, untrustedRecentSlot uint64, bumpSeed byte) error

func AddressLookupTableDeactivateLookupTable

func AddressLookupTableDeactivateLookupTable(execCtx *ExecutionCtx) error

func AddressLookupTableExecute

func AddressLookupTableExecute(execCtx *ExecutionCtx) error

func AddressLookupTableExtendLookupTable

func AddressLookupTableExtendLookupTable(execCtx *ExecutionCtx, newAddresses []solana.PublicKey) error

func AddressLookupTableFreezeLookupTable

func AddressLookupTableFreezeLookupTable(execCtx *ExecutionCtx) error

func BpfLoaderProgramExecute

func BpfLoaderProgramExecute(execCtx *ExecutionCtx) error

func CheckAcctForRecentBlockHashesSysvar

func CheckAcctForRecentBlockHashesSysvar(txCtx *TransactionCtx, instrCtx *InstructionCtx, instrAcctIdx uint64) error

func ComputeBudgetExecute

func ComputeBudgetExecute(execCtx *ExecutionCtx) error

func ConfigProgramExecute

func ConfigProgramExecute(ctx *ExecutionCtx) error

func Ed25519ProgramExecute

func Ed25519ProgramExecute(execCtx *ExecutionCtx) error

func G2FromInts

func G2FromInts(x *gfP2, y *gfP2) (*bn256lib.G2, error)

func IsCustomErr

func IsCustomErr(err error) bool

func LeftPadTo32Bytes

func LeftPadTo32Bytes(bytes []byte) ([]byte, error)

func MemOpConsume

func MemOpConsume(execCtx *ExecutionCtx, n uint64) error

func PoseidonHash

func PoseidonHash(input [][]byte, isBigEndian bool) ([]byte, error)

func PrecompileGetDataSlice

func PrecompileGetDataSlice(txCtx *TransactionCtx, index uint16, offset uint16, size uint16) ([]byte, error)

func ProcessUpgradeableLoaderInstruction

func ProcessUpgradeableLoaderInstruction(execCtx *ExecutionCtx) error

func ReadBool

func ReadBool(decoder *bin.Decoder) (bool, error)

func Secp256k1ProgramExecute

func Secp256k1ProgramExecute(execCtx *ExecutionCtx) error

func StakeProgramAuthorize

func StakeProgramAuthorize(stakeAcct *BorrowedAccount, signers []solana.PublicKey, newAuthority solana.PublicKey, stakeAuthorize uint32, clock SysvarClock, custodianPubkey *solana.PublicKey, f features.Features) error

func StakeProgramAuthorizeWithSeed

func StakeProgramAuthorizeWithSeed(txCtx *TransactionCtx, instrCtx *InstructionCtx, stakeAcct *BorrowedAccount, authorityBaseIndex uint64, authoritySeed string, authorityOwner solana.PublicKey, newAuthority solana.PublicKey, stakeAuthorize uint32, clock SysvarClock, custodian *solana.PublicKey, f features.Features) error

func StakeProgramDeactivate

func StakeProgramDeactivate(execCtx *ExecutionCtx, stakeAcct *BorrowedAccount, clock SysvarClock, signers []solana.PublicKey) error

func StakeProgramDeactivateDelinquent

func StakeProgramDeactivateDelinquent(execCtx *ExecutionCtx, txCtx *TransactionCtx, instrCtx *InstructionCtx, stakeAcct *BorrowedAccount, delinquentVoteAcctIdx uint64, referenceVoteAcctIdx uint64, currentEpoch uint64) error

func StakeProgramDelegate

func StakeProgramDelegate(execCtx *ExecutionCtx, txCtx *TransactionCtx, instrCtx *InstructionCtx, stakeAcctIdx uint64, voteAcctIdx uint64, clock SysvarClock, stakeHistory SysvarStakeHistory, signers []solana.PublicKey, f features.Features) error

func StakeProgramExecute

func StakeProgramExecute(execCtx *ExecutionCtx) error

func StakeProgramInitialize

func StakeProgramInitialize(stakeAcct *BorrowedAccount, authorized Authorized, lockup StakeLockup, rent SysvarRent, f features.Features) error

func StakeProgramMerge

func StakeProgramMerge(execCtx *ExecutionCtx, txCtx *TransactionCtx, instrCtx *InstructionCtx, stakeAcctIdx uint64, srcAcctIdx uint64, clock SysvarClock, stakeHistory SysvarStakeHistory, signers []solana.PublicKey) error

func StakeProgramRedelegate

func StakeProgramRedelegate(execCtx *ExecutionCtx, txCtx *TransactionCtx, instrCtx *InstructionCtx, stakeAcct *BorrowedAccount, uninitializedStakeAcctIdx uint64, voteAcctIdx uint64, signers []solana.PublicKey) error

func StakeProgramSetLockup

func StakeProgramSetLockup(stakeAcct *BorrowedAccount, lockup StakeInstrSetLockup, signers []solana.PublicKey, clock SysvarClock, f features.Features) error

func StakeProgramSplit

func StakeProgramSplit(execCtx *ExecutionCtx, txCtx *TransactionCtx, instrCtx *InstructionCtx, stakeAcctIdx uint64, lamports uint64, splitIdx uint64, signers []solana.PublicKey) error

func StakeProgramWithdraw

func StakeProgramWithdraw(txCtx *TransactionCtx, instrCtx *InstructionCtx, stakeAcctIdx uint64, lamports uint64, toIndex uint64, clock SysvarClock, stakeHistory SysvarStakeHistory, withdrawAuthorityIdx uint64, custodianIdx *uint64, newRateActivationEpoch *uint64, f features.Features) error

func SwapEndianness

func SwapEndianness(xs []byte) []byte

func SyscallAbortImpl

func SyscallAbortImpl(_ sbpf.VM) (uint64, error)

func SyscallAllocFreeImpl

func SyscallAllocFreeImpl(vm sbpf.VM, size, freeAddr uint64) (uint64, error)

SyscallMemcmpImpl is the implementation for the memset (sol_memset_) syscall.

func SyscallAltBn128CompressionImpl

func SyscallAltBn128CompressionImpl(vm sbpf.VM, op, inputAddr, inputLen, resultAddr uint64) (uint64, error)

func SyscallAltBn128Impl

func SyscallAltBn128Impl(vm sbpf.VM, groupOp, inputAddr, inputLen, resultAddr uint64) (uint64, error)

func SyscallBlake3Impl

func SyscallBlake3Impl(vm sbpf.VM, valsAddr, valsLen, resultsAddr uint64) (uint64, error)

SyscallBlake3Impl is the implementation for the sol_blake3 syscall

func SyscallCreateProgramAddressImpl

func SyscallCreateProgramAddressImpl(vm sbpf.VM, seedsAddr, seedsLen, programIdAddr, addressAddr uint64) (uint64, error)

func SyscallCurveGroupOpsImpl

func SyscallCurveGroupOpsImpl(vm sbpf.VM, curveId, groupOp, leftInputAddr, rightInputAddr, resultPointAddr uint64) (uint64, error)

func SyscallCurveMultiscalarMultiplicationImpl

func SyscallCurveMultiscalarMultiplicationImpl(vm sbpf.VM, curveId, scalarsAddr, pointsAddr, pointsLen, resultPointAddr uint64) (uint64, error)

func SyscallCurveValidatePointImpl

func SyscallCurveValidatePointImpl(vm sbpf.VM, curveId, pointAddr uint64) (uint64, error)

func SyscallGetClockSysvarImpl

func SyscallGetClockSysvarImpl(vm sbpf.VM, addr uint64) (uint64, error)

SyscallGetClockSysvarImpl is an implementation of the sol_get_clock_sysvar syscall

func SyscallGetEpochRewardsSysvarImpl

func SyscallGetEpochRewardsSysvarImpl(vm sbpf.VM, addr uint64) (uint64, error)

SyscallGetEpochRewardsSysvarImpl is an implementation of the sol_get_epoch_rewards_sysvar syscall

func SyscallGetEpochScheduleSysvarImpl

func SyscallGetEpochScheduleSysvarImpl(vm sbpf.VM, addr uint64) (uint64, error)

SyscallGetEpochScheduleSysvarImpl is an implementation of the sol_get_epoch_schedule_sysvar syscall

func SyscallGetLastRestartSlotSysvarImpl

func SyscallGetLastRestartSlotSysvarImpl(vm sbpf.VM, addr uint64) (uint64, error)

SyscallGetLastRestartSlotSysvarImpl is an implementation of the sol_get_last_restart_slot_sysvar syscall

func SyscallGetProcessedSiblingInstructionImpl

func SyscallGetProcessedSiblingInstructionImpl(vm sbpf.VM, index, metaAddr, programIdAddr, dataAddr, accountsAddr uint64) (uint64, error)

SyscallGetProcessedSiblingInstructionImpl is an implementation of the sol_get_processed_sibling_instruction syscall

func SyscallGetRentSysvarImpl

func SyscallGetRentSysvarImpl(vm sbpf.VM, addr uint64) (uint64, error)

SyscallGetRentSysvarImpl is an implementation of the sol_get_rent_sysvar syscall

func SyscallGetReturnDataImpl

func SyscallGetReturnDataImpl(vm sbpf.VM, returnDataAddr, length, programIdAddr uint64) (uint64, error)

SyscallGetReturnDataImpl is an implementation of the sol_get_return_data syscall

func SyscallGetStackHeightImpl

func SyscallGetStackHeightImpl(vm sbpf.VM) (uint64, error)

SyscallGetStackHeightImpl is an implementation of the sol_get_stack_height syscall

func SyscallInvokeSignedCImpl

func SyscallInvokeSignedCImpl(vm sbpf.VM, instructionAddr, accountInfosAddr, accountInfosLen, signerSeedsAddr, signerSeedsLen uint64) (uint64, error)

SyscallInvokeSignedCImpl is an implementation of the sol_invoke_signed_c syscall

func SyscallInvokeSignedRustImpl

func SyscallInvokeSignedRustImpl(vm sbpf.VM, instructionAddr, accountInfosAddr, accountInfosLen, signerSeedsAddr, signerSeedsLen uint64) (uint64, error)

SyscallInvokeSignedRustImpl is an implementation of the sol_invoke_signed_rust syscall

func SyscallKeccak256Impl

func SyscallKeccak256Impl(vm sbpf.VM, valsAddr, valsLen, resultsAddr uint64) (uint64, error)

SyscallKeccak256Impl is the implementation for the sol_keccak256 syscall

func SyscallLog64Impl

func SyscallLog64Impl(vm sbpf.VM, r1, r2, r3, r4, r5 uint64) (uint64, error)

func SyscallLogCUsImpl

func SyscallLogCUsImpl(vm sbpf.VM) (uint64, error)

func SyscallLogDataImpl

func SyscallLogDataImpl(vm sbpf.VM, addr uint64, len uint64) (uint64, error)

func SyscallLogImpl

func SyscallLogImpl(vm sbpf.VM, ptr, strlen uint64) (uint64, error)

func SyscallLogPubkeyImpl

func SyscallLogPubkeyImpl(vm sbpf.VM, pubkeyAddr uint64) (uint64, error)

func SyscallMemcmpImpl

func SyscallMemcmpImpl(vm sbpf.VM, addr1, addr2, n, resultAddr uint64) (uint64, error)

SyscallMemcmpImpl is the implementation for the memcmp (sol_memcmp_) syscall.

func SyscallMemcpyImpl

func SyscallMemcpyImpl(vm sbpf.VM, dst, src, n uint64) (uint64, error)

SyscallMemcpyImpl is the implementation of the memcpy (sol_memcpy_) syscall. Overlapping src and dst for a given n bytes to be copied results in an error being returned.

func SyscallMemmoveImpl

func SyscallMemmoveImpl(vm sbpf.VM, dst, src, n uint64) (uint64, error)

SyscallMemmoveImpl is the implementation for the memmove (sol_memmove_) syscall.

func SyscallMemsetImpl

func SyscallMemsetImpl(vm sbpf.VM, dst, c, n uint64) (uint64, error)

SyscallMemcmpImpl is the implementation for the memset (sol_memset_) syscall.

func SyscallPanicImpl

func SyscallPanicImpl(vm sbpf.VM, fileNameAddr, len, line, column uint64) (uint64, error)

SyscallPanicImpl is the implementation for the panic (sol_panic_) syscall. The Labs client implementation does CU accounting, checks for NULL termination, validates the utf8 string, etc, but we don't actually need to do this because this syscall returns an error and aborts the transaction either way, and the exact error returned does not matter for consensus.

func SyscallPoseidonImpl

func SyscallPoseidonImpl(vm sbpf.VM, parameters, endianness, valsAddr, valsLen, resultAddr uint64) (uint64, error)

func SyscallSecp256k1RecoverImpl

func SyscallSecp256k1RecoverImpl(vm sbpf.VM, hashAddr, recoveryIdVal, signatureAddr, resultAddr uint64) (uint64, error)

SyscallSecp256k1Recover is an implementation of the sol_secp256k1_recover syscall

func SyscallSetReturnDataImpl

func SyscallSetReturnDataImpl(vm sbpf.VM, addr, length uint64) (uint64, error)

SyscallSetReturnDataImpl is an implementation of the sol_set_return_data syscall

func SyscallSha256Impl

func SyscallSha256Impl(vm sbpf.VM, valsAddr, valsLen, resultsAddr uint64) (uint64, error)

SyscallSha256Impl is the implementation for the sol_sha256 syscall

func SyscallTryFindProgramAddressImpl

func SyscallTryFindProgramAddressImpl(vm sbpf.VM, seedsAddr, seedsLen, programIdAddr, addressAddr, bumpSeedAddr uint64) (uint64, error)

func Syscalls

func Syscalls(f *features.Features, isDeploy bool) sbpf.SyscallRegistry

Syscalls creates a registry of all Sealevel syscalls.

func SystemProgramAdvanceNonceAccount

func SystemProgramAdvanceNonceAccount(execCtx *ExecutionCtx, acct *BorrowedAccount, signers []solana.PublicKey, recentBlockhashes *SysvarRecentBlockhashes) error

func SystemProgramAllocate

func SystemProgramAllocate(execCtx *ExecutionCtx, acct *BorrowedAccount, address solana.PublicKey, space uint64, signers []solana.PublicKey) error

func SystemProgramAllocateAndAssign

func SystemProgramAllocateAndAssign(execCtx *ExecutionCtx, toAcct *BorrowedAccount, toAddr solana.PublicKey, space uint64, owner solana.PublicKey, signers []solana.PublicKey) error

func SystemProgramAssign

func SystemProgramAssign(execCtx *ExecutionCtx, acct *BorrowedAccount, address solana.PublicKey, owner solana.PublicKey, signers []solana.PublicKey) error

func SystemProgramAuthorizeNonceAccount

func SystemProgramAuthorizeNonceAccount(execCtx *ExecutionCtx, acct *BorrowedAccount, nonceAuthority solana.PublicKey, signers []solana.PublicKey) error

func SystemProgramCreateAccount

func SystemProgramCreateAccount(execCtx *ExecutionCtx, toAddr solana.PublicKey, lamports uint64, space uint64, owner solana.PublicKey, signers []solana.PublicKey) error

func SystemProgramExecute

func SystemProgramExecute(execCtx *ExecutionCtx) error

func SystemProgramInitializeNonceAccount

func SystemProgramInitializeNonceAccount(execCtx *ExecutionCtx, acct *BorrowedAccount, nonceAuthority solana.PublicKey, rent *SysvarRent, recentBlockhashes *SysvarRecentBlockhashes) error

func SystemProgramTransfer

func SystemProgramTransfer(execCtx *ExecutionCtx, fromAcctIdx uint64, toAcctIdx uint64, lamports uint64) error

func SystemProgramTransferWithSeed

func SystemProgramTransferWithSeed(execCtx *ExecutionCtx, fromAcctIdx uint64, fromBaseAcctIdx uint64, fromSeed string, fromOwner solana.PublicKey, toAcctIdx uint64, lamports uint64) error

func SystemProgramUpgradeNonceAccount

func SystemProgramUpgradeNonceAccount(execCtx *ExecutionCtx, acct *BorrowedAccount) error

func SystemProgramWithdrawNonceAccount

func SystemProgramWithdrawNonceAccount(execCtx *ExecutionCtx, instrCtx *InstructionCtx, fromAcctIdx uint64, lamports uint64, toAcctIdx uint64, rent *SysvarRent, signers []solana.PublicKey, recentBlockhashes *SysvarRecentBlockhashes) error

func TranslateErrToErrCode

func TranslateErrToErrCode(err error) int

TODO: add additional error conversions

func UpgradeableLoaderClose

func UpgradeableLoaderClose(execCtx *ExecutionCtx, txCtx *TransactionCtx, instrCtx *InstructionCtx) error

func UpgradeableLoaderDeployWithMaxDataLen

func UpgradeableLoaderDeployWithMaxDataLen(execCtx *ExecutionCtx, txCtx *TransactionCtx, instrCtx *InstructionCtx, deploy UpgradeableLoaderInstrDeployWithMaxDataLen) error

func UpgradeableLoaderExtendProgram

func UpgradeableLoaderExtendProgram(execCtx *ExecutionCtx, txCtx *TransactionCtx, instrCtx *InstructionCtx, additionalBytes uint32) error

func UpgradeableLoaderInitializeBuffer

func UpgradeableLoaderInitializeBuffer(execCtx *ExecutionCtx, txCtx *TransactionCtx, instrCtx *InstructionCtx) error

func UpgradeableLoaderSetAuthority

func UpgradeableLoaderSetAuthority(execCtx *ExecutionCtx, txCtx *TransactionCtx, instrCtx *InstructionCtx) error

func UpgradeableLoaderSetAuthorityChecked

func UpgradeableLoaderSetAuthorityChecked(execCtx *ExecutionCtx, txCtx *TransactionCtx, instrCtx *InstructionCtx) error

func UpgradeableLoaderUpgrade

func UpgradeableLoaderUpgrade(execCtx *ExecutionCtx, txCtx *TransactionCtx, instrCtx *InstructionCtx) error

func UpgradeableLoaderWrite

func UpgradeableLoaderWrite(execCtx *ExecutionCtx, txCtx *TransactionCtx, instrCtx *InstructionCtx, write UpgradeableLoaderInstrWrite) error

func ValidateAndCreateWithSeed

func ValidateAndCreateWithSeed(base solana.PublicKey, seed string, owner solana.PublicKey) (solana.PublicKey, error)

func VoteProgramAuthorize

func VoteProgramAuthorize(voteAcct *BorrowedAccount, authorized solana.PublicKey, voteAuthorize uint32, signers []solana.PublicKey, clock SysvarClock, f features.Features) error

func VoteProgramAuthorizeWithSeed

func VoteProgramAuthorizeWithSeed(execCtx *ExecutionCtx, instrCtx *InstructionCtx, voteAcct *BorrowedAccount, newAuthority solana.PublicKey, authorizationType uint32, currentAuthorityDerivedKeyOwner solana.PublicKey, currentAuthorityDerivedKeySeed string) error

func VoteProgramExecute

func VoteProgramExecute(execCtx *ExecutionCtx) error

func VoteProgramInitializeAccount

func VoteProgramInitializeAccount(voteAccount *BorrowedAccount, voteInit VoteInstrVoteInit, signers []solana.PublicKey, clock SysvarClock, f features.Features) error

func VoteProgramProcessVote

func VoteProgramProcessVote(voteAcct *BorrowedAccount, slotHashes SysvarSlotHashes, clock SysvarClock, vote *VoteInstrVote, signers []solana.PublicKey, f features.Features) error

func VoteProgramProcessVoteStateUpdate

func VoteProgramProcessVoteStateUpdate(voteAcct *BorrowedAccount, slotHashes SysvarSlotHashes, clock SysvarClock, voteStateUpdate *VoteInstrUpdateVoteState, signers []solana.PublicKey, f features.Features) error

func VoteProgramUpdateCommission

func VoteProgramUpdateCommission(voteAcct *BorrowedAccount, commission byte, signers []solana.PublicKey, epochSchedule SysvarEpochSchedule, clock SysvarClock, f features.Features) error

func VoteProgramUpdateValidatorIdentity

func VoteProgramUpdateValidatorIdentity(voteAcct *BorrowedAccount, nodePubkey solana.PublicKey, signers []solana.PublicKey, f features.Features) error

func VoteProgramWithdraw

func VoteProgramWithdraw(txCtx *TransactionCtx, instrCtx *InstructionCtx, voteAcctIdx uint64, lamports uint64, toAcctIdx uint64, signers []solana.PublicKey, rent SysvarRent, clock SysvarClock, f features.Features) error

func WriteClockSysvar

func WriteClockSysvar(accts *accounts.Accounts, clock SysvarClock)

func WriteEpochRewardsSysvar

func WriteEpochRewardsSysvar(accts *accounts.Accounts, epochRewards SysvarEpochRewards)

func WriteEpochScheduleSysvar

func WriteEpochScheduleSysvar(accts *accounts.Accounts, epochSchedule SysvarEpochSchedule)

func WriteFeesSysvar

func WriteFeesSysvar(accts *accounts.Accounts, fees SysvarFees)

func WriteInstructionsSysvar

func WriteInstructionsSysvar(accts *accounts.Accounts, instructions []Instruction) error

func WriteLastRestartSlotSysvar

func WriteLastRestartSlotSysvar(accts *accounts.Accounts, lastRestartSlot SysvarLastRestartSlot)

func WriteRentSysvar

func WriteRentSysvar(accts *accounts.Accounts, rent SysvarRent)

func WriteSlotHashesSysvar

func WriteSlotHashesSysvar(accts *accounts.Accounts, slotHashes SysvarSlotHashes)

func WriteSlotHistorySysvar

func WriteSlotHistorySysvar(accts *accounts.Accounts, slotHistory SysvarSlotHistory)

func WriteStakeHistorySysvar

func WriteStakeHistorySysvar(accts *accounts.Accounts, stakeHistory SysvarStakeHistory)

Types

type AccountMeta

type AccountMeta struct {
	Pubkey     solana.PublicKey
	IsSigner   bool
	IsWritable bool
}

func (*AccountMeta) Marshal

func (accountMeta *AccountMeta) Marshal() []byte

func (*AccountMeta) Unmarshal

func (accountMeta *AccountMeta) Unmarshal(buf io.Reader) error

type AccountParam

type AccountParam struct {
	IsDuplicate    bool
	DuplicateIndex uint8 // must not be 0xFF
	IsSigner       bool
	IsWritable     bool
	IsExecutable   bool
	Key            solana.PublicKey
	Owner          solana.PublicKey
	Lamports       uint64
	Data           []byte
	Padding        int // ignored, written by serializer
	RentEpoch      uint64
}

AccountParam is an account input to a program execution.

type AddrLookupTableInstrCreateLookupTable

type AddrLookupTableInstrCreateLookupTable struct {
	RecentSlot uint64
	BumpSeed   byte
}

func (*AddrLookupTableInstrCreateLookupTable) MarshalWithEncoder

func (createLookupTable *AddrLookupTableInstrCreateLookupTable) MarshalWithEncoder(encoder *bin.Encoder) error

func (*AddrLookupTableInstrCreateLookupTable) UnmarshalWithDecoder

func (createLookupTable *AddrLookupTableInstrCreateLookupTable) UnmarshalWithDecoder(decoder *bin.Decoder) error

type AddrLookupTableInstrExtendLookupTable

type AddrLookupTableInstrExtendLookupTable struct {
	NewAddresses []solana.PublicKey
}

func (*AddrLookupTableInstrExtendLookupTable) MarshalWithEncoder

func (extendLookupTable *AddrLookupTableInstrExtendLookupTable) MarshalWithEncoder(encoder *bin.Encoder) error

func (*AddrLookupTableInstrExtendLookupTable) UnmarshalWithDecoder

func (extendLookupTable *AddrLookupTableInstrExtendLookupTable) UnmarshalWithDecoder(decoder *bin.Decoder) error

type AddressLookupTable

type AddressLookupTable struct {
	State     uint32
	Meta      LookupTableMeta
	Addresses []solana.PublicKey
}

func UnmarshalAddressLookupTable

func UnmarshalAddressLookupTable(data []byte) (*AddressLookupTable, error)

type AddressLookupTableStatus

type AddressLookupTableStatus struct {
	Status                      uint64
	DeactivatingRemainingBlocks uint64
}

type Authorized

type Authorized struct {
	Staker     solana.PublicKey
	Withdrawer solana.PublicKey
}

func (*Authorized) Authorize

func (authorized *Authorized) Authorize(signers []solana.PublicKey, newAuthorized solana.PublicKey, stakeAuthorize uint32, lockup StakeLockup, clock SysvarClock, custodian *solana.PublicKey) error

func (*Authorized) Check

func (authorized *Authorized) Check(signers []solana.PublicKey, stakeAuthorize uint32) error

func (*Authorized) MarshalWithEncoder

func (authorized *Authorized) MarshalWithEncoder(encoder *bin.Encoder) error

func (*Authorized) UnmarshalWithDecoder

func (authorized *Authorized) UnmarshalWithDecoder(decoder *bin.Decoder) error

type AuthorizedVoter

type AuthorizedVoter struct {
	Epoch  uint64
	Pubkey solana.PublicKey
}

func (*AuthorizedVoter) MarshalWithEncoder

func (authVoter *AuthorizedVoter) MarshalWithEncoder(encoder *bin.Encoder) error

func (*AuthorizedVoter) UnmarshalWithDecoder

func (authVoter *AuthorizedVoter) UnmarshalWithDecoder(decoder *bin.Decoder) error

type AuthorizedVoters

type AuthorizedVoters struct {
	AuthorizedVoters btree.Map[uint64, solana.PublicKey]
}

func (*AuthorizedVoters) GetAndCacheAuthorizedVoterForEpoch

func (authVoters *AuthorizedVoters) GetAndCacheAuthorizedVoterForEpoch(epoch uint64) (solana.PublicKey, error)

func (*AuthorizedVoters) GetOrCalculateAuthorizedVoterForEpoch

func (authVoters *AuthorizedVoters) GetOrCalculateAuthorizedVoterForEpoch(epoch uint64) (solana.PublicKey, bool, error)

func (*AuthorizedVoters) MarshalWithEncoder

func (authVoters *AuthorizedVoters) MarshalWithEncoder(encoder *bin.Encoder) error

func (*AuthorizedVoters) PurgeAuthorizedVoters

func (authVoters *AuthorizedVoters) PurgeAuthorizedVoters(currentEpoch uint64) bool

func (*AuthorizedVoters) UnmarshalWithDecoder

func (authVoters *AuthorizedVoters) UnmarshalWithDecoder(decoder *bin.Decoder) error

type BlockTimestamp

type BlockTimestamp struct {
	Slot      uint64
	Timestamp int64
}

func (*BlockTimestamp) MarshalWithEncoder

func (blockTimestamp *BlockTimestamp) MarshalWithEncoder(encoder *bin.Encoder) error

func (*BlockTimestamp) UnmarshalWithDecoder

func (blockTimestamp *BlockTimestamp) UnmarshalWithDecoder(decoder *bin.Decoder) error

type BorrowedAccount

type BorrowedAccount struct {
	TxCtx              *TransactionCtx
	InstrCtx           *InstructionCtx
	IndexInTransaction uint64
	IndexInInstruction uint64
	Account            *accounts.Account
}

func (*BorrowedAccount) AccountExists

func (acct *BorrowedAccount) AccountExists() bool

func (*BorrowedAccount) CanDataBeResized

func (acct *BorrowedAccount) CanDataBeResized(newLen uint64) error

func (*BorrowedAccount) CheckedAddLamports

func (acct *BorrowedAccount) CheckedAddLamports(lamports uint64, f features.Features) error

func (*BorrowedAccount) CheckedSubLamports

func (acct *BorrowedAccount) CheckedSubLamports(lamports uint64, f features.Features) error

func (*BorrowedAccount) Data

func (acct *BorrowedAccount) Data() []byte

func (*BorrowedAccount) DataCanBeChanged

func (acct *BorrowedAccount) DataCanBeChanged(features features.Features) error

func (*BorrowedAccount) DataMutable

func (acct *BorrowedAccount) DataMutable(f features.Features) ([]byte, error)

func (*BorrowedAccount) Drop

func (acct *BorrowedAccount) Drop()

func (*BorrowedAccount) ExtendFromSlice

func (acct *BorrowedAccount) ExtendFromSlice(f features.Features, data []byte) error

func (*BorrowedAccount) IsExecutable

func (acct *BorrowedAccount) IsExecutable() bool

func (*BorrowedAccount) IsOwnedByCurrentProgram

func (acct *BorrowedAccount) IsOwnedByCurrentProgram() bool

func (*BorrowedAccount) IsRentExemptAtDataLength

func (acct *BorrowedAccount) IsRentExemptAtDataLength(len uint64) bool

func (*BorrowedAccount) IsSigner

func (acct *BorrowedAccount) IsSigner() bool

func (*BorrowedAccount) IsWritable

func (acct *BorrowedAccount) IsWritable() bool

func (*BorrowedAccount) IsZeroed

func (acct *BorrowedAccount) IsZeroed() bool

func (*BorrowedAccount) Key

func (acct *BorrowedAccount) Key() solana.PublicKey

func (*BorrowedAccount) Lamports

func (acct *BorrowedAccount) Lamports() uint64

func (*BorrowedAccount) Owner

func (acct *BorrowedAccount) Owner() solana.PublicKey

func (*BorrowedAccount) RentEpoch

func (acct *BorrowedAccount) RentEpoch() uint64

func (*BorrowedAccount) SetData

func (acct *BorrowedAccount) SetData(features features.Features, data []byte) error

func (*BorrowedAccount) SetDataLength

func (acct *BorrowedAccount) SetDataLength(newLength uint64, f features.Features) error

func (*BorrowedAccount) SetExecutable

func (acct *BorrowedAccount) SetExecutable(isExecutable bool) error

func (*BorrowedAccount) SetLamports

func (acct *BorrowedAccount) SetLamports(lamports uint64, f features.Features) error

func (*BorrowedAccount) SetOwner

func (acct *BorrowedAccount) SetOwner(f features.Features, owner solana.PublicKey) error

func (*BorrowedAccount) SetState

func (acct *BorrowedAccount) SetState(f features.Features, data []byte) error

func (*BorrowedAccount) Touch

func (acct *BorrowedAccount) Touch() error

func (*BorrowedAccount) UpdateAccountsResizeDelta

func (acct *BorrowedAccount) UpdateAccountsResizeDelta(newLength uint64)

type CallerAccount

type CallerAccount struct {
	Lamports        []byte
	Owner           []byte
	OriginalDataLen uint64
	SerializedData  []byte
	VmDataAddr      uint64
	RefToLenInVm    []byte
}

type CompactUpdateVoteState

type CompactUpdateVoteState struct {
	Root           uint64
	LockoutOffsets []LockoutOffset
	Hash           [32]byte
	Timestamp      *int64
}

func (*CompactUpdateVoteState) UnmarshalWithDecoder

func (cuvs *CompactUpdateVoteState) UnmarshalWithDecoder(decoder *bin.Decoder) error

type ComputeBudgetInstrRequestHeapFrame

type ComputeBudgetInstrRequestHeapFrame struct {
	Bytes uint32
}

func (*ComputeBudgetInstrRequestHeapFrame) MarshalWithEncoder

func (requestHeapFrame *ComputeBudgetInstrRequestHeapFrame) MarshalWithEncoder(encoder *bin.Encoder) error

func (*ComputeBudgetInstrRequestHeapFrame) UnmarshalWithDecoder

func (requestHeapFrame *ComputeBudgetInstrRequestHeapFrame) UnmarshalWithDecoder(decoder *bin.Decoder) error

type ComputeBudgetInstrSetComputeUnitLimit

type ComputeBudgetInstrSetComputeUnitLimit struct {
	ComputeUnitLimit uint32
}

func (*ComputeBudgetInstrSetComputeUnitLimit) MarshalWithEncoder

func (setComputeUnitLimit *ComputeBudgetInstrSetComputeUnitLimit) MarshalWithEncoder(encoder *bin.Encoder) error

func (*ComputeBudgetInstrSetComputeUnitLimit) UnmarshalWithDecoder

func (setComputeUnitLimit *ComputeBudgetInstrSetComputeUnitLimit) UnmarshalWithDecoder(decoder *bin.Decoder) error

type ComputeBudgetInstrSetComputeUnitPrice

type ComputeBudgetInstrSetComputeUnitPrice struct {
	MicroLamports uint64
}

func (*ComputeBudgetInstrSetComputeUnitPrice) MarshalWithEncoder

func (setComputeUnitPrice *ComputeBudgetInstrSetComputeUnitPrice) MarshalWithEncoder(encoder *bin.Encoder) error

func (*ComputeBudgetInstrSetComputeUnitPrice) UnmarshalWithDecoder

func (setComputeUnitPrice *ComputeBudgetInstrSetComputeUnitPrice) UnmarshalWithDecoder(decoder *bin.Decoder) error

type ComputeBudgetInstrSetLoadedAccountsDataSizeLimit

type ComputeBudgetInstrSetLoadedAccountsDataSizeLimit struct {
	Bytes uint32
}

func (*ComputeBudgetInstrSetLoadedAccountsDataSizeLimit) MarshalWithEncoder

func (setLoadedAccountsDataSizeLimit *ComputeBudgetInstrSetLoadedAccountsDataSizeLimit) MarshalWithEncoder(encoder *bin.Encoder) error

func (*ComputeBudgetInstrSetLoadedAccountsDataSizeLimit) UnmarshalWithDecoder

func (setLoadedAccountsDataSizeLimit *ComputeBudgetInstrSetLoadedAccountsDataSizeLimit) UnmarshalWithDecoder(decoder *bin.Decoder) error

type ComputeBudgetLimits

type ComputeBudgetLimits struct {
	UpdatedHeapBytes   uint32
	ComputeUnitLimit   uint32
	ComputeUnitPrice   uint64
	LoadedAccountBytes uint32
}

func ComputeBudgetExecuteInstructions

func ComputeBudgetExecuteInstructions(instructions []Instruction) (*ComputeBudgetLimits, error)

type ConfigKey

type ConfigKey struct {
	Pubkey   solana.PublicKey
	IsSigner bool
}

func (*ConfigKey) MarshalWithEncoder

func (configKey *ConfigKey) MarshalWithEncoder(encoder *bin.Encoder) error

func (*ConfigKey) UnmarshalWithDecoder

func (configKey *ConfigKey) UnmarshalWithDecoder(decoder *bin.Decoder) error

type Delegation

type Delegation struct {
	VoterPubkey        solana.PublicKey
	StakeLamports      uint64
	ActivationEpoch    uint64
	DeactivationEpoch  uint64
	WarmupCooldownRate float64
}

func (*Delegation) IsBootstrap

func (delegation *Delegation) IsBootstrap() bool

func (*Delegation) MarshalWithEncoder

func (delegation *Delegation) MarshalWithEncoder(encoder *bin.Encoder) error

func (*Delegation) Stake

func (delegation *Delegation) Stake(epoch uint64, stakeHistory SysvarStakeHistory, newRateActivationEpoch *uint64) uint64

func (*Delegation) StakeActivatingAndDeactivating

func (delegation *Delegation) StakeActivatingAndDeactivating(targetEpoch uint64, stakeHistory SysvarStakeHistory, newRateActivationEpoch *uint64) StakeHistoryEntry

func (*Delegation) StakeAndActivating

func (delegation *Delegation) StakeAndActivating(targetEpoch uint64, stakeHistory SysvarStakeHistory, newRateActivationEpoch *uint64) (uint64, uint64)

func (*Delegation) UnmarshalWithDecoder

func (delegation *Delegation) UnmarshalWithDecoder(decoder *bin.Decoder) error

type Ed25519SignatureOffsets

type Ed25519SignatureOffsets struct {
	SignatureOffset           uint16
	SignatureInstructionIndex uint16
	PublicKeyOffset           uint16
	PublicKeyInstructionIndex uint16
	MessageDataOffset         uint16
	MessageDataSize           uint16
	MessageInstructionIndex   uint16
}

func (*Ed25519SignatureOffsets) UnmarshalWithDecoder

func (offsets *Ed25519SignatureOffsets) UnmarshalWithDecoder(buf io.Reader) error

type EpochCredits

type EpochCredits struct {
	Epoch       uint64
	Credits     uint64
	PrevCredits uint64
}

func (*EpochCredits) MarshalWithEncoder

func (epochCredits *EpochCredits) MarshalWithEncoder(encoder *bin.Encoder) error

func (*EpochCredits) UnmarshalWithDecoder

func (epochCredits *EpochCredits) UnmarshalWithDecoder(decoder *bin.Decoder) error

type ExecutionCtx

type ExecutionCtx struct {
	Log                  Logger
	Accounts             accounts.Accounts
	TransactionContext   *TransactionCtx
	GlobalCtx            global.GlobalCtx
	ComputeMeter         cu.ComputeMeter
	Blockhash            [32]byte
	LamportsPerSignature uint64
	SlotCtx              *SlotCtx
}

func (*ExecutionCtx) CheckAligned

func (execCtx *ExecutionCtx) CheckAligned() bool

func (*ExecutionCtx) ExecuteInstruction

func (execCtx *ExecutionCtx) ExecuteInstruction() error

func (*ExecutionCtx) NativeInvoke

func (execCtx *ExecutionCtx) NativeInvoke(instruction Instruction, signers []solana.PublicKey) error

func (*ExecutionCtx) Pop

func (execCtx *ExecutionCtx) Pop() error

func (*ExecutionCtx) PrepareInstruction

func (execCtx *ExecutionCtx) PrepareInstruction(ix Instruction, signers []solana.PublicKey) ([]InstructionAccount, []uint64, error)

func (*ExecutionCtx) ProcessInstruction

func (execCtx *ExecutionCtx) ProcessInstruction(instrData []byte, instructionAccts []InstructionAccount, programIndices []uint64) error

func (*ExecutionCtx) Push

func (execCtx *ExecutionCtx) Push() error

func (*ExecutionCtx) StackHeight

func (execCtx *ExecutionCtx) StackHeight() uint64

type FeeCalculator

type FeeCalculator struct {
	LamportsPerSignature uint64
}

type Instruction

type Instruction struct {
	Accounts  []AccountMeta
	Data      []byte
	ProgramId solana.PublicKey
}

type InstructionAccount

type InstructionAccount struct {
	IndexInTransaction uint64
	IndexInCaller      uint64
	IndexInCallee      uint64
	IsSigner           bool
	IsWritable         bool
}

func InstructionAcctsFromAccountMetas

func InstructionAcctsFromAccountMetas(instrAcctMetas []AccountMeta, txAccounts TransactionAccounts) []InstructionAccount

type InstructionCtx

type InstructionCtx struct {
	ProgramAccounts               []uint64
	InstructionAccounts           []InstructionAccount
	Data                          []byte
	InstructionAccountsLamportSum wide.Uint128
	NestingLevel                  uint64
	// contains filtered or unexported fields
}

func (*InstructionCtx) BorrowAccount

func (instrCtx *InstructionCtx) BorrowAccount(txCtx *TransactionCtx, idxInTx uint64, idxInInstr uint64) (*BorrowedAccount, error)

func (*InstructionCtx) BorrowExecutableAccount

func (instrCtx *InstructionCtx) BorrowExecutableAccount(txCtx *TransactionCtx, pubkey solana.PublicKey) (*BorrowedAccount, error)

func (*InstructionCtx) BorrowInstructionAccount

func (instrCtx *InstructionCtx) BorrowInstructionAccount(txCtx *TransactionCtx, instrAcctIdx uint64) (*BorrowedAccount, error)

func (*InstructionCtx) BorrowLastProgramAccount

func (instrCtx *InstructionCtx) BorrowLastProgramAccount(txCtx *TransactionCtx) (*BorrowedAccount, error)

func (*InstructionCtx) BorrowProgramAccount

func (instrCtx *InstructionCtx) BorrowProgramAccount(txCtx *TransactionCtx, programAcctIdx uint64) (*BorrowedAccount, error)

func (*InstructionCtx) CheckNumOfInstructionAccounts

func (instrCtx *InstructionCtx) CheckNumOfInstructionAccounts(num uint64) error

func (*InstructionCtx) Configure

func (instrCtx *InstructionCtx) Configure(programAccts []uint64, instrAccts []InstructionAccount, instrData []byte)

func (*InstructionCtx) IndexOfInstructionAccount

func (instrCtx *InstructionCtx) IndexOfInstructionAccount(txCtx *TransactionCtx, pubkey solana.PublicKey) (uint64, error)

func (*InstructionCtx) IndexOfInstructionAccountInTransaction

func (instrCtx *InstructionCtx) IndexOfInstructionAccountInTransaction(instrAcctIdx uint64) (uint64, error)

func (*InstructionCtx) IndexOfProgramAccountInTransaction

func (instrCtx *InstructionCtx) IndexOfProgramAccountInTransaction(programAccountIndex uint64) (uint64, error)

func (*InstructionCtx) IsInstructionAccountDuplicate

func (instrCtx *InstructionCtx) IsInstructionAccountDuplicate(instrAcctIdx uint64) (bool, uint64, error)

func (*InstructionCtx) IsInstructionAccountSigner

func (instrCtx *InstructionCtx) IsInstructionAccountSigner(instrAcctIdx uint64) (bool, error)

func (*InstructionCtx) IsInstructionAccountWritable

func (instrCtx *InstructionCtx) IsInstructionAccountWritable(instrAcctIdx uint64) (bool, error)

func (*InstructionCtx) LastProgramKey

func (instrCtx *InstructionCtx) LastProgramKey(txCtx *TransactionCtx) (solana.PublicKey, error)

func (*InstructionCtx) NumberOfInstructionAccounts

func (instrCtx *InstructionCtx) NumberOfInstructionAccounts() uint64

func (*InstructionCtx) NumberOfProgramAccounts

func (instrCtx *InstructionCtx) NumberOfProgramAccounts() uint64

func (*InstructionCtx) ProgramId

func (instrCtx *InstructionCtx) ProgramId() solana.PublicKey

func (*InstructionCtx) Signers

func (instrCtx *InstructionCtx) Signers(txCtx *TransactionCtx) ([]solana.PublicKey, error)

func (*InstructionCtx) StackHeight

func (instrCtx *InstructionCtx) StackHeight() uint64

type LandedVote

type LandedVote struct {
	Latency byte
	Lockout VoteLockout
}

func (*LandedVote) MarshalWithEncoder

func (landedVote *LandedVote) MarshalWithEncoder(encoder *bin.Encoder) error

func (*LandedVote) UnmarshalWithDecoder

func (landedVote *LandedVote) UnmarshalWithDecoder(decoder *bin.Decoder) error

type LockoutOffset

type LockoutOffset struct {
	Offset            uint64
	ConfirmationCount byte
}

func (*LockoutOffset) UnmarshalWithDecoder

func (lockoutOffset *LockoutOffset) UnmarshalWithDecoder(decoder *bin.Decoder) error

type LogRecorder

type LogRecorder struct {
	Logs []string
}

func (*LogRecorder) Log

func (r *LogRecorder) Log(s string)

type Logger

type Logger interface {
	Log(s string)
}

type LookupTableMeta

type LookupTableMeta struct {
	DeactivationSlot           uint64
	LastExtendedSlot           uint64
	LastExtendedSlotStartIndex byte
	Authority                  *solana.PublicKey
	Padding                    uint16
}

func (*LookupTableMeta) MarshalWithEncoder

func (lookupTableMeta *LookupTableMeta) MarshalWithEncoder(encoder *bin.Encoder) error

func (*LookupTableMeta) Status

func (lookupTableMeta *LookupTableMeta) Status(currentSlot uint64, slotHashes SysvarSlotHashes) AddressLookupTableStatus

func (*LookupTableMeta) UnmarshalWithDecoder

func (lookupTableMeta *LookupTableMeta) UnmarshalWithDecoder(decoder *bin.Decoder) error

type MergeKind

type MergeKind struct {
	Status          uint64
	Inactive        MergeKindInactive
	ActivationEpoch MergeKindActivationEpoch
	FullyActive     MergeKindFullyActive
}

func (*MergeKind) ActiveStake

func (mergeKind *MergeKind) ActiveStake() *Stake

func (*MergeKind) Merge

func (mergeKind *MergeKind) Merge(execCtx *ExecutionCtx, src *MergeKind, clock SysvarClock) (*StakeStateV2, error)

func (*MergeKind) Meta

func (mergeKind *MergeKind) Meta() *Meta

type MergeKindActivationEpoch

type MergeKindActivationEpoch struct {
	Meta       Meta
	Stake      Stake
	StakeFlags StakeFlags
}

type MergeKindFullyActive

type MergeKindFullyActive struct {
	Meta  Meta
	Stake Stake
}

type MergeKindInactive

type MergeKindInactive struct {
	Meta          Meta
	StakeLamports uint64
	StakeFlags    StakeFlags
}

type Meta

type Meta struct {
	RentExemptReserve uint64
	Authorized        Authorized
	Lockup            StakeLockup
}

func (*Meta) MarshalWithEncoder

func (meta *Meta) MarshalWithEncoder(encoder *bin.Encoder) error

func (*Meta) SetLockup

func (meta *Meta) SetLockup(lockup StakeInstrSetLockup, signers []solana.PublicKey, clock SysvarClock) error

func (*Meta) UnmarshalWithDecoder

func (meta *Meta) UnmarshalWithDecoder(decoder *bin.Decoder) error

type NonceData

type NonceData struct {
	IsInitialized bool
	Authority     solana.PublicKey
	DurableNonce  [32]byte
	FeeCalculator FeeCalculator
}

func (*NonceData) IsSignerAuthority

func (nonceData *NonceData) IsSignerAuthority(signers []solana.PublicKey) bool

func (*NonceData) Marshal

func (nonceData *NonceData) Marshal() ([]byte, error)

func (*NonceData) UnmarshalWithDecoder

func (nonceData *NonceData) UnmarshalWithDecoder(decoder *bin.Decoder) error

type NonceStateVersions

type NonceStateVersions struct {
	Type    uint32
	Legacy  NonceData
	Current NonceData
}

func UnmarshalNonceStateVersions

func UnmarshalNonceStateVersions(data []byte) (*NonceStateVersions, error)

func (*NonceStateVersions) Deinitialize

func (nonceStateVersions *NonceStateVersions) Deinitialize()

func (*NonceStateVersions) IsUpgradeable

func (nonceStateVersions *NonceStateVersions) IsUpgradeable() bool

func (*NonceStateVersions) Marshal

func (nonceStateVersions *NonceStateVersions) Marshal() ([]byte, error)

func (*NonceStateVersions) State

func (nonceStateVersions *NonceStateVersions) State() *NonceData

func (*NonceStateVersions) UnmarshalWithDecoder

func (nonceStateVersions *NonceStateVersions) UnmarshalWithDecoder(decoder *bin.Decoder) error

func (*NonceStateVersions) Upgrade

func (nonceStateVersions *NonceStateVersions) Upgrade() bool

type Params

type Params struct {
	Accounts  []AccountParam
	Data      []byte // per-instruction data
	ProgramID solana.PublicKey
	Features  features.Features
}

Params is the data passed to programs via the Sealevel VM input segment.

func (*Params) Serialize

func (p *Params) Serialize(buf *bytes.Buffer)

Serialize writes the params to the provided buffer.

func (*Params) Update

func (p *Params) Update(buf *bytes.Reader) error

Update writes data modified by a program back to the params struct.

type PriorVoter

type PriorVoter struct {
	Pubkey     solana.PublicKey
	EpochStart uint64
	EpochEnd   uint64
	Slot       uint64
}

func (*PriorVoter) MarshalWithEncoder

func (priorVoter *PriorVoter) MarshalWithEncoder(encoder *bin.Encoder, isVersion0_23_5 bool) error

func (*PriorVoter) UnmarshalWithDecoder

func (priorVoter *PriorVoter) UnmarshalWithDecoder(decoder *bin.Decoder, isVersion0_23_5 bool) error

type PriorVoters

type PriorVoters struct {
	Buf     [32]PriorVoter
	Index   uint64
	IsEmpty bool
}

func (*PriorVoters) Append

func (priorVoters *PriorVoters) Append(priorVoter PriorVoter)

func (*PriorVoters) Last

func (priorVoters *PriorVoters) Last() *PriorVoter

func (*PriorVoters) MarshalWithEncoder

func (priorVoters *PriorVoters) MarshalWithEncoder(encoder *bin.Encoder) error

func (*PriorVoters) UnmarshalWithDecoder

func (priorVoters *PriorVoters) UnmarshalWithDecoder(decoder *bin.Decoder) error

type PriorVoters0_23_5

type PriorVoters0_23_5 struct {
	Buf   [32]PriorVoter
	Index uint64
}

func (*PriorVoters0_23_5) Append

func (priorVoters *PriorVoters0_23_5) Append(priorVoter PriorVoter)

func (*PriorVoters0_23_5) MarshalWithEncoder

func (priorVoters *PriorVoters0_23_5) MarshalWithEncoder(encoder *bin.Encoder) error

func (*PriorVoters0_23_5) UnmarshalWithDecoder

func (priorVoters *PriorVoters0_23_5) UnmarshalWithDecoder(decoder *bin.Decoder) error

type ProcessedSiblingInstruction

type ProcessedSiblingInstruction struct {
	DataLen     uint64
	AccountsLen uint64
}

func (*ProcessedSiblingInstruction) Marshal

func (psi *ProcessedSiblingInstruction) Marshal() []byte

func (*ProcessedSiblingInstruction) Unmarshal

func (psi *ProcessedSiblingInstruction) Unmarshal(buf io.Reader) error

type RecentBlockHashesEntry

type RecentBlockHashesEntry struct {
	Blockhash     [32]byte
	FeeCalculator FeeCalculator
}

type RefCellRust

type RefCellRust struct {
	Strong uint64
	Weak   uint64
	Borrow uint64
	Addr   uint64
}

func (*RefCellRust) Unmarshal

func (refCell *RefCellRust) Unmarshal(buf io.Reader) error

type RefCellVecRust

type RefCellVecRust struct {
	Strong uint64
	Weak   uint64
	Borrow uint64
	Addr   uint64
	Len    uint64
}

func (*RefCellVecRust) Unmarshal

func (refCellVec *RefCellVecRust) Unmarshal(buf io.Reader) error

type SecppSignatureOffsets

type SecppSignatureOffsets struct {
	SignatureOffset            uint16
	SignatureInstructionIndex  byte
	EthAddressOffset           uint16
	EthAddressInstructionIndex byte
	MessageDataOffset          uint16
	MessageDataSize            uint16
	MessageInstructionIndex    byte
}

func (*SecppSignatureOffsets) UnmarshalWithDecoder

func (so *SecppSignatureOffsets) UnmarshalWithDecoder(decoder *bin.Decoder) (err error)

type SlotBank

type SlotBank struct {
	PreviousSlot uint64
	BanksHash    [32]byte
}

type SlotCtx

type SlotCtx struct {
	Accounts             accounts.Accounts
	AccountsDb           *accountsdb.AccountsDb
	Slot                 uint64
	ParentSlot           uint64
	Epoch                uint64
	LamportsPerSignature uint64
	ModifiedAccts        map[solana.PublicKey]bool
	Blockhash            [32]byte
	RecentBlockhash      [32]byte
	SlotBank             SlotBank
	Features             *features.Features
	Replay               bool
}

func (*SlotCtx) GetAccount

func (slotCtx *SlotCtx) GetAccount(pubkey solana.PublicKey) (*accounts.Account, error)

func (*SlotCtx) GetAccountFromAccountsDb

func (slotCtx *SlotCtx) GetAccountFromAccountsDb(pubkey solana.PublicKey) (*accounts.Account, error)

func (*SlotCtx) SetAccount

func (slotCtx *SlotCtx) SetAccount(pubkey solana.PublicKey, acct *accounts.Account) error

func (*SlotCtx) SetupSysvarCache

func (slotCtx *SlotCtx) SetupSysvarCache(slot uint64)

type SlotHash

type SlotHash struct {
	Slot uint64
	Hash [32]byte
}

type SlotHistoryBitvec

type SlotHistoryBitvec struct {
	Bits SlotHistoryInner
	Len  uint64
}

type SlotHistoryInner

type SlotHistoryInner struct {
	BlocksLen uint64
	Blocks    []uint64
}

type SolAccountInfoC

type SolAccountInfoC struct {
	KeyAddr      uint64
	LamportsAddr uint64
	DataLen      uint64
	DataAddr     uint64
	OwnerAddr    uint64
	RentEpoch    uint64
	IsSigner     bool
	IsWritable   bool
	Executable   bool
}

func (*SolAccountInfoC) Unmarshal

func (accountInfo *SolAccountInfoC) Unmarshal(buf io.Reader) error

type SolAccountInfoRust

type SolAccountInfoRust struct {
	PubkeyAddr      uint64 // points to uchar[32]
	LamportsBoxAddr uint64 // points to Rc with embedded RefCell which points to u64
	DataBoxAddr     uint64 // points to Rc with embedded RefCell which contains slice which points to bytes
	OwnerAddr       uint64 // points to uchar[32]
	RentEpoch       uint64
	IsSigner        byte
	IsWritable      byte
	Executable      byte
}

func (*SolAccountInfoRust) Unmarshal

func (accountInfo *SolAccountInfoRust) Unmarshal(buf io.Reader) error

type SolAccountMetaC

type SolAccountMetaC struct {
	PubkeyAddr uint64
	IsWritable byte
	IsSigner   byte
}

func (*SolAccountMetaC) Marshal

func (accountMeta *SolAccountMetaC) Marshal() ([]byte, error)

func (*SolAccountMetaC) Unmarshal

func (accountMeta *SolAccountMetaC) Unmarshal(buf io.Reader) error

type SolAccountMetaRust

type SolAccountMetaRust struct {
	Pubkey     solana.PublicKey
	IsSigner   byte
	IsWritable byte
}

func (*SolAccountMetaRust) Unmarshal

func (accountMeta *SolAccountMetaRust) Unmarshal(buf io.Reader) error

type SolInstructionC

type SolInstructionC struct {
	ProgramIdAddr uint64
	AccountsAddr  uint64
	AccountsLen   uint64
	DataAddr      uint64
	DataLen       uint64
}

func (*SolInstructionC) Marshal

func (solInstr *SolInstructionC) Marshal() ([]byte, error)

func (*SolInstructionC) Unmarshal

func (solInstr *SolInstructionC) Unmarshal(buf io.Reader) error

type SolInstructionRust

type SolInstructionRust struct {
	Accounts VectorDescrRust
	Data     VectorDescrRust
	Pubkey   solana.PublicKey
}

func (*SolInstructionRust) Marshal

func (solInstr *SolInstructionRust) Marshal() ([]byte, error)

func (*SolInstructionRust) Unmarshal

func (solInstr *SolInstructionRust) Unmarshal(buf io.Reader) error

type Stake

type Stake struct {
	Delegation      Delegation
	CreditsObserved uint64
}

func (*Stake) Deactivate

func (stake *Stake) Deactivate(epoch uint64) error

func (*Stake) MarshalWithEncoder

func (stake *Stake) MarshalWithEncoder(encoder *bin.Encoder) error

func (*Stake) MergeDelegationStakeAndCreditsObserved

func (stake *Stake) MergeDelegationStakeAndCreditsObserved(absorbedLamports uint64, absorbedCreditsObserved uint64) error

func (*Stake) Split

func (stake *Stake) Split(remainingStakeDelta uint64, splitStakeAmount uint64) (Stake, error)

func (*Stake) Stake

func (stake *Stake) Stake(epoch uint64, stakeHistory SysvarStakeHistory, newRateActivationEpoch *uint64) uint64

func (*Stake) StakeWeightCreditsObserved

func (stake *Stake) StakeWeightCreditsObserved(absorbedLamports uint64, absorbedCreditsObserved uint64) (uint64, error)

func (*Stake) UnmarshalWithDecoder

func (stake *Stake) UnmarshalWithDecoder(decoder *bin.Decoder) error

type StakeConfig

type StakeConfig struct {
	WarmupCooldownRate float64
	SlashPenalty       byte
}

func (*StakeConfig) UnmarshalWithDecoder

func (config *StakeConfig) UnmarshalWithDecoder(decoder *bin.Decoder) error

type StakeFlags

type StakeFlags struct {
	Bits byte
}

func (*StakeFlags) Contains

func (stakeFlags *StakeFlags) Contains(other StakeFlags) bool

func (*StakeFlags) MarshalWithEncoder

func (stakeFlags *StakeFlags) MarshalWithEncoder(encoder *bin.Encoder) error

func (*StakeFlags) Remove

func (stakeFlags *StakeFlags) Remove(other StakeFlags)

func (*StakeFlags) Union

func (stakeFlags *StakeFlags) Union(other StakeFlags) StakeFlags

func (*StakeFlags) UnmarshalWithDecoder

func (stakeFlags *StakeFlags) UnmarshalWithDecoder(decoder *bin.Decoder) error

type StakeHistoryEntry

type StakeHistoryEntry struct {
	Effective    uint64
	Activating   uint64
	Deactivating uint64
}

type StakeHistoryPair

type StakeHistoryPair struct {
	Epoch uint64
	Entry StakeHistoryEntry
}

type StakeInstrAuthorize

type StakeInstrAuthorize struct {
	Pubkey         solana.PublicKey
	StakeAuthorize uint32
}

func (*StakeInstrAuthorize) UnmarshalWithDecoder

func (auth *StakeInstrAuthorize) UnmarshalWithDecoder(decoder *bin.Decoder) error

type StakeInstrAuthorizeChecked

type StakeInstrAuthorizeChecked struct {
	StakeAuthorize uint32
}

func (*StakeInstrAuthorizeChecked) UnmarshalWithDecoder

func (authChecked *StakeInstrAuthorizeChecked) UnmarshalWithDecoder(decoder *bin.Decoder) error

type StakeInstrAuthorizeCheckedWithSeed

type StakeInstrAuthorizeCheckedWithSeed struct {
	StakeAuthorize uint32
	AuthoritySeed  string
	AuthorityOwner solana.PublicKey
}

func (*StakeInstrAuthorizeCheckedWithSeed) UnmarshalWithDecoder

func (authCheckedWithSeed *StakeInstrAuthorizeCheckedWithSeed) UnmarshalWithDecoder(decoder *bin.Decoder) error

type StakeInstrAuthorizeWithSeed

type StakeInstrAuthorizeWithSeed struct {
	NewAuthorizedPubkey solana.PublicKey
	StakeAuthorize      uint32
	AuthoritySeed       string
	AuthorityOwner      solana.PublicKey
}

func (*StakeInstrAuthorizeWithSeed) UnmarshalWithDecoder

func (authWithSeed *StakeInstrAuthorizeWithSeed) UnmarshalWithDecoder(decoder *bin.Decoder) error

type StakeInstrInitialize

type StakeInstrInitialize struct {
	Authorized Authorized
	Lockup     StakeLockup
}

func (*StakeInstrInitialize) UnmarshalWithDecoder

func (initialize *StakeInstrInitialize) UnmarshalWithDecoder(decoder *bin.Decoder) error

type StakeInstrSetLockup

type StakeInstrSetLockup struct {
	UnixTimestamp *uint64
	Epoch         *uint64
	Custodian     *solana.PublicKey
}

func (*StakeInstrSetLockup) UnmarshalWithDecoder

func (lockup *StakeInstrSetLockup) UnmarshalWithDecoder(decoder *bin.Decoder) error

type StakeInstrSetLockupChecked

type StakeInstrSetLockupChecked struct {
	UnixTimestamp *uint64
	Epoch         *uint64
}

func (*StakeInstrSetLockupChecked) UnmarshalWithDecoder

func (lockup *StakeInstrSetLockupChecked) UnmarshalWithDecoder(decoder *bin.Decoder) error

type StakeInstrSplit

type StakeInstrSplit struct {
	Lamports uint64
}

func (*StakeInstrSplit) UnmarshalWithDecoder

func (split *StakeInstrSplit) UnmarshalWithDecoder(decoder *bin.Decoder) error

type StakeInstrWithdraw

type StakeInstrWithdraw struct {
	Lamports uint64
}

func (*StakeInstrWithdraw) UnmarshalWithDecoder

func (withdraw *StakeInstrWithdraw) UnmarshalWithDecoder(decoder *bin.Decoder) error

type StakeLockup

type StakeLockup struct {
	UnixTimeStamp uint64
	Epoch         uint64
	Custodian     solana.PublicKey
}

func (*StakeLockup) IsInForce

func (lockup *StakeLockup) IsInForce(clock SysvarClock, custodian *solana.PublicKey) bool

func (*StakeLockup) MarshalWithEncoder

func (lockup *StakeLockup) MarshalWithEncoder(encoder *bin.Encoder) error

func (*StakeLockup) UnmarshalWithDecoder

func (lockup *StakeLockup) UnmarshalWithDecoder(decoder *bin.Decoder) error

type StakeStateV2

type StakeStateV2 struct {
	Status      uint32
	Initialized StakeStateV2Initialized
	Stake       StakeStateV2Stake
}

func UnmarshalStakeState

func UnmarshalStakeState(data []byte) (*StakeStateV2, error)

func (*StakeStateV2) MarshalWithEncoder

func (state *StakeStateV2) MarshalWithEncoder(encoder *bin.Encoder) error

func (*StakeStateV2) UnmarshalWithDecoder

func (state *StakeStateV2) UnmarshalWithDecoder(decoder *bin.Decoder) error

type StakeStateV2Initialized

type StakeStateV2Initialized struct {
	Meta Meta
}

func (*StakeStateV2Initialized) MarshalWithEncoder

func (initialized *StakeStateV2Initialized) MarshalWithEncoder(encoder *bin.Encoder) error

func (*StakeStateV2Initialized) UnmarshalWithDecoder

func (initialized *StakeStateV2Initialized) UnmarshalWithDecoder(decoder *bin.Decoder) error

type StakeStateV2Stake

type StakeStateV2Stake struct {
	Meta       Meta
	Stake      Stake
	StakeFlags StakeFlags
}

func (*StakeStateV2Stake) MarshalWithEncoder

func (stake *StakeStateV2Stake) MarshalWithEncoder(encoder *bin.Encoder) error

func (*StakeStateV2Stake) UnmarshalWithDecoder

func (stake *StakeStateV2Stake) UnmarshalWithDecoder(decoder *bin.Decoder) error

type SystemInstrAllocate

type SystemInstrAllocate struct {
	Space uint64
}

func (*SystemInstrAllocate) MarshalWithEncoder

func (instr *SystemInstrAllocate) MarshalWithEncoder(encoder *bin.Encoder) error

func (*SystemInstrAllocate) UnmarshalWithDecoder

func (instr *SystemInstrAllocate) UnmarshalWithDecoder(decoder *bin.Decoder) error

type SystemInstrAllocateWithSeed

type SystemInstrAllocateWithSeed struct {
	Base  solana.PublicKey
	Seed  string
	Space uint64
	Owner solana.PublicKey
}

func (*SystemInstrAllocateWithSeed) UnmarshalWithDecoder

func (instr *SystemInstrAllocateWithSeed) UnmarshalWithDecoder(decoder *bin.Decoder) error

type SystemInstrAssign

type SystemInstrAssign struct {
	Owner solana.PublicKey
}

func (*SystemInstrAssign) MarshalWithEncoder

func (instr *SystemInstrAssign) MarshalWithEncoder(encoder *bin.Encoder) error

func (*SystemInstrAssign) UnmarshalWithDecoder

func (instr *SystemInstrAssign) UnmarshalWithDecoder(decoder *bin.Decoder) error

type SystemInstrAssignWithSeed

type SystemInstrAssignWithSeed struct {
	Base  solana.PublicKey
	Seed  string
	Owner solana.PublicKey
}

func (*SystemInstrAssignWithSeed) MarshalWithEncoder

func (instr *SystemInstrAssignWithSeed) MarshalWithEncoder(encoder *bin.Encoder) error

func (*SystemInstrAssignWithSeed) UnmarshalWithDecoder

func (instr *SystemInstrAssignWithSeed) UnmarshalWithDecoder(decoder *bin.Decoder) error

type SystemInstrAuthorizeNonceAccount

type SystemInstrAuthorizeNonceAccount struct {
	Pubkey solana.PublicKey
}

func (*SystemInstrAuthorizeNonceAccount) UnmarshalWithDecoder

func (instr *SystemInstrAuthorizeNonceAccount) UnmarshalWithDecoder(decoder *bin.Decoder) error

type SystemInstrCreateAccount

type SystemInstrCreateAccount struct {
	Lamports uint64
	Space    uint64
	Owner    solana.PublicKey
}

func (*SystemInstrCreateAccount) MarshalWithEncoder

func (instr *SystemInstrCreateAccount) MarshalWithEncoder(encoder *bin.Encoder) error

func (*SystemInstrCreateAccount) UnmarshalWithDecoder

func (instr *SystemInstrCreateAccount) UnmarshalWithDecoder(decoder *bin.Decoder) error

type SystemInstrCreateAccountWithSeed

type SystemInstrCreateAccountWithSeed struct {
	Base     solana.PublicKey
	Seed     string
	Lamports uint64
	Space    uint64
	Owner    solana.PublicKey
}

func (*SystemInstrCreateAccountWithSeed) UnmarshalWithDecoder

func (instr *SystemInstrCreateAccountWithSeed) UnmarshalWithDecoder(decoder *bin.Decoder) error

type SystemInstrInitializeNonceAccount

type SystemInstrInitializeNonceAccount struct {
	Pubkey solana.PublicKey
}

func (*SystemInstrInitializeNonceAccount) UnmarshalWithDecoder

func (instr *SystemInstrInitializeNonceAccount) UnmarshalWithDecoder(decoder *bin.Decoder) error

type SystemInstrTransfer

type SystemInstrTransfer struct {
	Lamports uint64
}

func (*SystemInstrTransfer) MarshalWithEncoder

func (instr *SystemInstrTransfer) MarshalWithEncoder(encoder *bin.Encoder) error

func (*SystemInstrTransfer) UnmarshalWithDecoder

func (instr *SystemInstrTransfer) UnmarshalWithDecoder(decoder *bin.Decoder) error

type SystemInstrTransferWithSeed

type SystemInstrTransferWithSeed struct {
	Lamports  uint64
	FromSeed  string
	FromOwner solana.PublicKey
}

func (*SystemInstrTransferWithSeed) UnmarshalWithDecoder

func (instr *SystemInstrTransferWithSeed) UnmarshalWithDecoder(decoder *bin.Decoder) error

type SystemInstrWithdrawNonceAccount

type SystemInstrWithdrawNonceAccount struct {
	Lamports uint64
}

func (*SystemInstrWithdrawNonceAccount) UnmarshalWithDecoder

func (instr *SystemInstrWithdrawNonceAccount) UnmarshalWithDecoder(decoder *bin.Decoder) error

type SysvarCache

type SysvarCache struct {
	RecentBlockHashes *SysvarRecentBlockhashes
	Rent              SysvarRent
	Clock             SysvarClock
	Fees              SysvarFees
	SlotHashes        SysvarSlotHashes
}

func (*SysvarCache) AddRecentBlockHashEntry

func (sysvarCache *SysvarCache) AddRecentBlockHashEntry(entry RecentBlockHashesEntry)

func (*SysvarCache) GetRecentBlockHashes

func (sysvarCache *SysvarCache) GetRecentBlockHashes() *SysvarRecentBlockhashes

func (*SysvarCache) PopulateRecentBlockHashesForTesting

func (sysvarCache *SysvarCache) PopulateRecentBlockHashesForTesting()

func (*SysvarCache) UpdateForSlot

func (sysvarCache *SysvarCache) UpdateForSlot(slotCtx *SlotCtx)

type SysvarClock

type SysvarClock struct {
	Slot                uint64
	EpochStartTimestamp int64
	Epoch               uint64
	LeaderScheduleEpoch uint64
	UnixTimestamp       int64
}

func ReadClockSysvar

func ReadClockSysvar(execCtx *ExecutionCtx) (SysvarClock, error)

func (*SysvarClock) MustMarshal

func (sc *SysvarClock) MustMarshal() []byte

func (*SysvarClock) MustUnmarshalWithDecoder

func (sc *SysvarClock) MustUnmarshalWithDecoder(decoder *bin.Decoder)

func (*SysvarClock) UnmarshalWithDecoder

func (sc *SysvarClock) UnmarshalWithDecoder(decoder *bin.Decoder) (err error)

type SysvarEpochRewards

type SysvarEpochRewards struct {
	DistributionStartingBlockHeight uint64
	NumPartitions                   uint64
	ParentBlockhash                 [32]byte
	TotalPoints                     bin.Uint128
	TotalRewards                    uint64
	DistributedRewards              uint64
	Active                          bool
}

func ReadEpochRewardsSysvar

func ReadEpochRewardsSysvar(execCtx *ExecutionCtx) (SysvarEpochRewards, error)

func (*SysvarEpochRewards) MarshalWithEncoder

func (ser *SysvarEpochRewards) MarshalWithEncoder(encoder *bin.Encoder) error

func (*SysvarEpochRewards) MustUnmarshalWithDecoder

func (sr *SysvarEpochRewards) MustUnmarshalWithDecoder(decoder *bin.Decoder)

func (*SysvarEpochRewards) UnmarshalWithDecoder

func (ser *SysvarEpochRewards) UnmarshalWithDecoder(decoder *bin.Decoder) error

type SysvarEpochSchedule

type SysvarEpochSchedule struct {
	SlotsPerEpoch            uint64
	LeaderScheduleSlotOffset uint64
	Warmup                   bool
	FirstNormalEpoch         uint64
	FirstNormalSlot          uint64
}

func ReadEpochScheduleSysvar

func ReadEpochScheduleSysvar(execCtx *ExecutionCtx) (SysvarEpochSchedule, error)

func (*SysvarEpochSchedule) FirstSlotInEpoch

func (sr *SysvarEpochSchedule) FirstSlotInEpoch(epoch uint64) uint64

func (*SysvarEpochSchedule) GetEpoch

func (sr *SysvarEpochSchedule) GetEpoch(slot uint64) uint64

func (*SysvarEpochSchedule) GetEpochAndSlotIndex

func (sr *SysvarEpochSchedule) GetEpochAndSlotIndex(slot uint64) (uint64, uint64)

func (*SysvarEpochSchedule) LeaderScheduleEpoch

func (sr *SysvarEpochSchedule) LeaderScheduleEpoch(slot uint64) uint64

func (*SysvarEpochSchedule) MustUnmarshalWithDecoder

func (sr *SysvarEpochSchedule) MustUnmarshalWithDecoder(decoder *bin.Decoder)

func (*SysvarEpochSchedule) Slot0

func (sr *SysvarEpochSchedule) Slot0(epoch uint64) uint64

func (*SysvarEpochSchedule) SlotsInEpoch

func (sr *SysvarEpochSchedule) SlotsInEpoch(epoch uint64) uint64

func (*SysvarEpochSchedule) UnmarshalWithDecoder

func (ses *SysvarEpochSchedule) UnmarshalWithDecoder(decoder *bin.Decoder) (err error)

type SysvarFees

type SysvarFees struct {
	FeeCalculator FeeCalculator
}

func ReadFeesSysvar

func ReadFeesSysvar(accts *accounts.Accounts) SysvarFees

func (*SysvarFees) MustUnmarshalWithDecoder

func (sf *SysvarFees) MustUnmarshalWithDecoder(decoder *bin.Decoder)

func (*SysvarFees) UnmarshalWithDecoder

func (sf *SysvarFees) UnmarshalWithDecoder(decoder *bin.Decoder) (err error)

func (*SysvarFees) Update

func (sf *SysvarFees) Update(lamportsPerSignature uint64)

type SysvarLastRestartSlot

type SysvarLastRestartSlot struct {
	LastRestartSlot uint64
}

func ReadLastRestartSlotSysvar

func ReadLastRestartSlotSysvar(execCtx *ExecutionCtx) SysvarLastRestartSlot

func (*SysvarLastRestartSlot) MustUnmarshalWithDecoder

func (sr *SysvarLastRestartSlot) MustUnmarshalWithDecoder(decoder *bin.Decoder)

func (*SysvarLastRestartSlot) UnmarshalWithDecoder

func (lrs *SysvarLastRestartSlot) UnmarshalWithDecoder(decoder *bin.Decoder) (err error)

type SysvarRecentBlockhashes

type SysvarRecentBlockhashes []RecentBlockHashesEntry

func ReadRecentBlockHashesSysvar

func ReadRecentBlockHashesSysvar(execCtx *ExecutionCtx) (SysvarRecentBlockhashes, error)

func (*SysvarRecentBlockhashes) GetLatest

func (recentBlockhashes *SysvarRecentBlockhashes) GetLatest() RecentBlockHashesEntry

func (*SysvarRecentBlockhashes) MarshalWithEncoder

func (recentBlockhashes *SysvarRecentBlockhashes) MarshalWithEncoder(encoder *bin.Encoder) error

func (*SysvarRecentBlockhashes) MustMarshal

func (recentBlockhashes *SysvarRecentBlockhashes) MustMarshal() []byte

func (*SysvarRecentBlockhashes) MustUnmarshalWithDecoder

func (recentBlockhashes *SysvarRecentBlockhashes) MustUnmarshalWithDecoder(decoder *bin.Decoder)

func (*SysvarRecentBlockhashes) PushLatest

func (recentBlockhashes *SysvarRecentBlockhashes) PushLatest(latest [32]byte)

func (*SysvarRecentBlockhashes) UnmarshalWithDecoder

func (recentBlockhashes *SysvarRecentBlockhashes) UnmarshalWithDecoder(decoder *bin.Decoder) error

type SysvarRent

type SysvarRent struct {
	LamportsPerUint8Year uint64
	ExemptionThreshold   float64
	BurnPercent          byte
}

func NewDefaultRentSysvar

func NewDefaultRentSysvar() SysvarRent

func ReadRentSysvar

func ReadRentSysvar(execCtx *ExecutionCtx) (SysvarRent, error)

func (*SysvarRent) InitializeDefault

func (sr *SysvarRent) InitializeDefault()

func (*SysvarRent) IsExempt

func (sr *SysvarRent) IsExempt(balance uint64, dataLen uint64) bool

func (*SysvarRent) MinimumBalance

func (sr *SysvarRent) MinimumBalance(dataLen uint64) uint64

func (*SysvarRent) MustUnmarshalWithDecoder

func (sr *SysvarRent) MustUnmarshalWithDecoder(decoder *bin.Decoder)

func (*SysvarRent) UnmarshalWithDecoder

func (sr *SysvarRent) UnmarshalWithDecoder(decoder *bin.Decoder) (err error)

type SysvarSlotHashes

type SysvarSlotHashes []SlotHash

func ReadSlotHashesSysvar

func ReadSlotHashesSysvar(execCtx *ExecutionCtx) (SysvarSlotHashes, error)

func (*SysvarSlotHashes) FromInstrAcct

func (slotHashes *SysvarSlotHashes) FromInstrAcct(execCtx *ExecutionCtx, instrAcctIdx uint64) error

func (*SysvarSlotHashes) Get

func (sh *SysvarSlotHashes) Get(slot uint64) ([32]byte, error)

func (*SysvarSlotHashes) MustMarshal

func (sh *SysvarSlotHashes) MustMarshal() []byte

func (*SysvarSlotHashes) MustUnmarshalWithDecoder

func (sh *SysvarSlotHashes) MustUnmarshalWithDecoder(decoder *bin.Decoder)

func (*SysvarSlotHashes) Position

func (sh *SysvarSlotHashes) Position(slot uint64) (uint64, error)

func (*SysvarSlotHashes) UnmarshalWithDecoder

func (sh *SysvarSlotHashes) UnmarshalWithDecoder(decoder *bin.Decoder) (err error)

func (*SysvarSlotHashes) Update

func (sh *SysvarSlotHashes) Update(slot uint64, hash [32]byte)

func (*SysvarSlotHashes) UpdateWithSlotCtx

func (sh *SysvarSlotHashes) UpdateWithSlotCtx(slotCtx *SlotCtx)

type SysvarSlotHistory

type SysvarSlotHistory struct {
	Bits     SlotHistoryBitvec
	NextSlot uint64
}

func ReadSlotHistorySysvar

func ReadSlotHistorySysvar(execCtx *ExecutionCtx) SysvarSlotHistory

func (*SysvarSlotHistory) Add

func (sr *SysvarSlotHistory) Add(slot uint64)

func (*SysvarSlotHistory) MustMarshal

func (sr *SysvarSlotHistory) MustMarshal() []byte

func (*SysvarSlotHistory) MustUnmarshalWithDecoder

func (sr *SysvarSlotHistory) MustUnmarshalWithDecoder(decoder *bin.Decoder)

func (*SysvarSlotHistory) SetNextSlot

func (sr *SysvarSlotHistory) SetNextSlot(nextSlot uint64)

func (*SysvarSlotHistory) UnmarshalWithDecoder

func (sh *SysvarSlotHistory) UnmarshalWithDecoder(decoder *bin.Decoder) (err error)

type SysvarStakeHistory

type SysvarStakeHistory []StakeHistoryPair

func ReadStakeHistorySysvar

func ReadStakeHistorySysvar(execCtx *ExecutionCtx) (SysvarStakeHistory, error)

func (*SysvarStakeHistory) Get

func (*SysvarStakeHistory) MustUnmarshalWithDecoder

func (sh *SysvarStakeHistory) MustUnmarshalWithDecoder(decoder *bin.Decoder)

func (*SysvarStakeHistory) UnmarshalWithDecoder

func (sh *SysvarStakeHistory) UnmarshalWithDecoder(decoder *bin.Decoder) (err error)

type TransactionAccounts

type TransactionAccounts struct {
	Accounts []*accounts.Account
	Locked   []bool
	Touched  []bool
}

func NewTransactionAccounts

func NewTransactionAccounts(accts []accounts.Account) *TransactionAccounts

func (*TransactionAccounts) GetAccount

func (txAccounts *TransactionAccounts) GetAccount(idx uint64) (*accounts.Account, error)

func (*TransactionAccounts) IsLocked

func (txAccounts *TransactionAccounts) IsLocked(idx uint64) bool

func (*TransactionAccounts) Lock

func (txAccounts *TransactionAccounts) Lock(idx uint64)

func (*TransactionAccounts) Touch

func (txAccounts *TransactionAccounts) Touch(idx uint64) error

func (*TransactionAccounts) Unlock

func (txAccounts *TransactionAccounts) Unlock(idx uint64)

type TransactionCtx

type TransactionCtx struct {
	InstructionTrace         []InstructionCtx
	InstructionStack         []uint64
	RetData                  TxReturnData
	AccountKeys              []solana.PublicKey
	Accounts                 TransactionAccounts
	ExecutableAccounts       []BorrowedAccount
	InstructionTraceCapacity uint64
	AccountsResizeDelta      int64
	Rent                     SysvarRent
	HeapSize                 uint32
	AllInstructions          []Instruction
	ComputeBudgetLimits      *ComputeBudgetLimits
	Signature                solana.Signature
}

func NewTestTransactionCtx

func NewTestTransactionCtx(txAccts TransactionAccounts, instrStackCapacity uint64, instrTraceCapacity uint64) *TransactionCtx

func (*TransactionCtx) AccountAtIndex

func (txCtx *TransactionCtx) AccountAtIndex(idxInTx uint64) (*accounts.Account, error)

func (*TransactionCtx) CurrentInstructionCtx

func (txCtx *TransactionCtx) CurrentInstructionCtx() (*InstructionCtx, error)

func (*TransactionCtx) IndexOfAccount

func (txCtx *TransactionCtx) IndexOfAccount(pubkey solana.PublicKey) (uint64, error)

func (*TransactionCtx) InstructionAccountsLamportSum

func (txCtx *TransactionCtx) InstructionAccountsLamportSum(instrCtx *InstructionCtx) (wide.Uint128, error)

func (*TransactionCtx) InstructionCtxAtIndexInTrace

func (txCtx *TransactionCtx) InstructionCtxAtIndexInTrace(idxInTrace uint64) (*InstructionCtx, error)

func (*TransactionCtx) InstructionCtxAtNestingLevel

func (txCtx *TransactionCtx) InstructionCtxAtNestingLevel(nestingLevel uint64) (*InstructionCtx, error)

func (*TransactionCtx) InstructionCtxStackHeight

func (txCtx *TransactionCtx) InstructionCtxStackHeight() uint64

func (*TransactionCtx) InstructionTraceLength

func (txCtx *TransactionCtx) InstructionTraceLength() uint64

func (*TransactionCtx) KeyOfAccountAtIndex

func (txCtx *TransactionCtx) KeyOfAccountAtIndex(index uint64) (solana.PublicKey, error)

func (*TransactionCtx) NextInstructionCtx

func (txCtx *TransactionCtx) NextInstructionCtx() (*InstructionCtx, error)

func (*TransactionCtx) Pop

func (txCtx *TransactionCtx) Pop() error

func (*TransactionCtx) Push

func (txCtx *TransactionCtx) Push() error

func (*TransactionCtx) PushInstructionCtx

func (txCtx *TransactionCtx) PushInstructionCtx(ixCtx InstructionCtx)

func (*TransactionCtx) ReturnData

func (txCtx *TransactionCtx) ReturnData() (solana.PublicKey, []byte)

func (*TransactionCtx) SetReturnData

func (txCtx *TransactionCtx) SetReturnData(programId solana.PublicKey, data []byte)

type TranslatedAccount

type TranslatedAccount struct {
	IndexOfAccount uint64
	CallerAccount  *CallerAccount
}

type TranslatedAccounts

type TranslatedAccounts []TranslatedAccount

type TxReturnData

type TxReturnData struct {
	// contains filtered or unexported fields
}

type UpgradeableLoaderInstrDeployWithMaxDataLen

type UpgradeableLoaderInstrDeployWithMaxDataLen struct {
	MaxDataLen uint64
}

func (*UpgradeableLoaderInstrDeployWithMaxDataLen) MarshalWithEncoder

func (deploy *UpgradeableLoaderInstrDeployWithMaxDataLen) MarshalWithEncoder(encoder *bin.Encoder) error

func (*UpgradeableLoaderInstrDeployWithMaxDataLen) UnmarshalWithDecoder

func (deploy *UpgradeableLoaderInstrDeployWithMaxDataLen) UnmarshalWithDecoder(decoder *bin.Decoder) error

type UpgradeableLoaderInstrExtendProgram

type UpgradeableLoaderInstrExtendProgram struct {
	AdditionalBytes uint32
}

func (*UpgradeableLoaderInstrExtendProgram) MarshalWithEncoder

func (extendProgram *UpgradeableLoaderInstrExtendProgram) MarshalWithEncoder(encoder *bin.Encoder) error

func (*UpgradeableLoaderInstrExtendProgram) UnmarshalWithDecoder

func (extendProgram *UpgradeableLoaderInstrExtendProgram) UnmarshalWithDecoder(decoder *bin.Decoder) error

type UpgradeableLoaderInstrWrite

type UpgradeableLoaderInstrWrite struct {
	Offset uint32
	Bytes  []byte
}

instructions

func (*UpgradeableLoaderInstrWrite) MarshalWithEncoder

func (write *UpgradeableLoaderInstrWrite) MarshalWithEncoder(encoder *bin.Encoder) error

func (*UpgradeableLoaderInstrWrite) UnmarshalWithDecoder

func (write *UpgradeableLoaderInstrWrite) UnmarshalWithDecoder(decoder *bin.Decoder) error

type UpgradeableLoaderState

type UpgradeableLoaderState struct {
	Type        uint32
	Buffer      UpgradeableLoaderStateBuffer
	Program     UpgradeableLoaderStateProgram
	ProgramData UpgradeableLoaderStateProgramData
}

func (*UpgradeableLoaderState) MarshalWithEncoder

func (state *UpgradeableLoaderState) MarshalWithEncoder(encoder *bin.Encoder) error

func (*UpgradeableLoaderState) UnmarshalWithDecoder

func (state *UpgradeableLoaderState) UnmarshalWithDecoder(decoder *bin.Decoder) error

type UpgradeableLoaderStateBuffer

type UpgradeableLoaderStateBuffer struct {
	AuthorityAddress *solana.PublicKey
}

upgradeable loader account states

func (*UpgradeableLoaderStateBuffer) MarshalWithEncoder

func (buffer *UpgradeableLoaderStateBuffer) MarshalWithEncoder(encoder *bin.Encoder) error

func (*UpgradeableLoaderStateBuffer) UnmarshalWithDecoder

func (buffer *UpgradeableLoaderStateBuffer) UnmarshalWithDecoder(decoder *bin.Decoder) error

type UpgradeableLoaderStateProgram

type UpgradeableLoaderStateProgram struct {
	ProgramDataAddress solana.PublicKey
}

func (*UpgradeableLoaderStateProgram) MarshalWithEncoder

func (program *UpgradeableLoaderStateProgram) MarshalWithEncoder(encoder *bin.Encoder) error

func (*UpgradeableLoaderStateProgram) UnmarshalWithDecoder

func (program *UpgradeableLoaderStateProgram) UnmarshalWithDecoder(decoder *bin.Decoder) error

type UpgradeableLoaderStateProgramData

type UpgradeableLoaderStateProgramData struct {
	Slot                    uint64
	UpgradeAuthorityAddress *solana.PublicKey
}

func (*UpgradeableLoaderStateProgramData) MarshalWithEncoder

func (programData *UpgradeableLoaderStateProgramData) MarshalWithEncoder(encoder *bin.Encoder) error

func (*UpgradeableLoaderStateProgramData) UnmarshalWithDecoder

func (programData *UpgradeableLoaderStateProgramData) UnmarshalWithDecoder(decoder *bin.Decoder) error

type ValidatedProgram

type ValidatedProgram struct {
	LastUpdatedSlot uint64
	EntryPc         uint64
	TextCnt         uint64
	TextOffset      uint64
	RodataLen       uint64
}

type VectorDescrC

type VectorDescrC struct {
	Addr uint64
	Len  uint64
}

func (*VectorDescrC) Marshal

func (vectorDescr *VectorDescrC) Marshal() ([]byte, error)

func (*VectorDescrC) Unmarshal

func (vectorDescr *VectorDescrC) Unmarshal(buf io.Reader) error

type VectorDescrRust

type VectorDescrRust struct {
	Addr uint64
	Cap  uint64
	Len  uint64
}

func (*VectorDescrRust) Marshal

func (vectorDescr *VectorDescrRust) Marshal() ([]byte, error)

func (*VectorDescrRust) Unmarshal

func (vectorDescr *VectorDescrRust) Unmarshal(buf io.Reader) error

type VoteInstrAuthorizeCheckedWithSeed

type VoteInstrAuthorizeCheckedWithSeed struct {
	AuthorizationType               uint32
	CurrentAuthorityDerivedKeyOwner solana.PublicKey
	CurrentAuthorityDerivedKeySeed  string
}

func (*VoteInstrAuthorizeCheckedWithSeed) UnmarshalWithDecoder

func (acws *VoteInstrAuthorizeCheckedWithSeed) UnmarshalWithDecoder(decoder *bin.Decoder) error

type VoteInstrAuthorizeWithSeed

type VoteInstrAuthorizeWithSeed struct {
	AuthorizationType               uint32
	CurrentAuthorityDerivedKeyOwner solana.PublicKey
	CurrentAuthorityDerivedKeySeed  string
	NewAuthority                    solana.PublicKey
}

func (*VoteInstrAuthorizeWithSeed) UnmarshalWithDecoder

func (authWithSeed *VoteInstrAuthorizeWithSeed) UnmarshalWithDecoder(decoder *bin.Decoder) error

type VoteInstrCompactUpdateVoteState

type VoteInstrCompactUpdateVoteState struct {
	UpdateVoteState VoteInstrUpdateVoteState
}

func (*VoteInstrCompactUpdateVoteState) UnmarshalWithDecoder

func (compactUpdateVoteState *VoteInstrCompactUpdateVoteState) UnmarshalWithDecoder(decoder *bin.Decoder) error

type VoteInstrCompactUpdateVoteStateSwitch

type VoteInstrCompactUpdateVoteStateSwitch struct {
	UpdateVoteState VoteInstrUpdateVoteState
	Hash            [32]byte
}

func (*VoteInstrCompactUpdateVoteStateSwitch) UnmarshalWithDecoder

func (compactUpdateVoteState *VoteInstrCompactUpdateVoteStateSwitch) UnmarshalWithDecoder(decoder *bin.Decoder) error

type VoteInstrUpdateCommission

type VoteInstrUpdateCommission struct {
	Commission byte
}

func (*VoteInstrUpdateCommission) UnmarshalWithDecoder

func (updateCommission *VoteInstrUpdateCommission) UnmarshalWithDecoder(decoder *bin.Decoder) error

type VoteInstrUpdateVoteState

type VoteInstrUpdateVoteState struct {
	Lockouts  deque.Deque[VoteLockout]
	Root      *uint64
	Hash      [32]byte
	Timestamp *int64
}

func (*VoteInstrUpdateVoteState) BuildFromCompactUpdateVoteState

func (updateVoteState *VoteInstrUpdateVoteState) BuildFromCompactUpdateVoteState(compactUpdateVoteState *CompactUpdateVoteState) error

func (*VoteInstrUpdateVoteState) UnmarshalWithDecoder

func (updateVoteState *VoteInstrUpdateVoteState) UnmarshalWithDecoder(decoder *bin.Decoder) error

type VoteInstrUpdateVoteStateSwitch

type VoteInstrUpdateVoteStateSwitch struct {
	UpdateVoteState VoteInstrUpdateVoteState
	Hash            [32]byte
}

func (*VoteInstrUpdateVoteStateSwitch) UnmarshalWithDecoder

func (uvss *VoteInstrUpdateVoteStateSwitch) UnmarshalWithDecoder(decoder *bin.Decoder) error

type VoteInstrVote

type VoteInstrVote struct {
	Slots     []uint64
	Hash      [32]byte
	Timestamp *int64
}

func (*VoteInstrVote) UnmarshalWithDecoder

func (vote *VoteInstrVote) UnmarshalWithDecoder(decoder *bin.Decoder) error

type VoteInstrVoteAuthorize

type VoteInstrVoteAuthorize struct {
	Pubkey        solana.PublicKey
	VoteAuthorize uint32
}

func (*VoteInstrVoteAuthorize) UnmarshalWithDecoder

func (voteAuthorize *VoteInstrVoteAuthorize) UnmarshalWithDecoder(decoder *bin.Decoder) error

type VoteInstrVoteAuthorizeChecked

type VoteInstrVoteAuthorizeChecked struct {
	Pubkey        solana.PublicKey
	VoteAuthorize uint32
}

func (*VoteInstrVoteAuthorizeChecked) UnmarshalWithDecoder

func (voteAuthChecked *VoteInstrVoteAuthorizeChecked) UnmarshalWithDecoder(decoder *bin.Decoder) error

type VoteInstrVoteInit

type VoteInstrVoteInit struct {
	NodePubkey           solana.PublicKey
	AuthorizedVoter      solana.PublicKey
	AuthorizedWithdrawer solana.PublicKey
	Commission           byte
}

func (*VoteInstrVoteInit) UnmarshalWithDecoder

func (voteInit *VoteInstrVoteInit) UnmarshalWithDecoder(decoder *bin.Decoder) error

type VoteInstrVoteSwitch

type VoteInstrVoteSwitch struct {
	Vote VoteInstrVote
	Hash [32]byte
}

func (*VoteInstrVoteSwitch) UnmarshalWithDecoder

func (voteSwitch *VoteInstrVoteSwitch) UnmarshalWithDecoder(decoder *bin.Decoder) error

type VoteInstrWithdraw

type VoteInstrWithdraw struct {
	Lamports uint64
}

func (*VoteInstrWithdraw) UnmarshalWithDecoder

func (withdraw *VoteInstrWithdraw) UnmarshalWithDecoder(decoder *bin.Decoder) error

type VoteLockout

type VoteLockout struct {
	Slot              uint64
	ConfirmationCount uint32
}

func (*VoteLockout) IncreaseConfirmationCount

func (lockout *VoteLockout) IncreaseConfirmationCount(by uint32)

func (*VoteLockout) IsLockedOutAtSlot

func (lockout *VoteLockout) IsLockedOutAtSlot(slot uint64) bool

func (*VoteLockout) LastLockedOutSlot

func (lockout *VoteLockout) LastLockedOutSlot() uint64

func (*VoteLockout) Lockout

func (lockout *VoteLockout) Lockout() uint64

func (*VoteLockout) MarshalWithEncoder

func (lockout *VoteLockout) MarshalWithEncoder(encoder *bin.Encoder) error

func (*VoteLockout) UnmarshalWithDecoder

func (lockout *VoteLockout) UnmarshalWithDecoder(decoder *bin.Decoder) error

type VoteState

type VoteState struct {
	NodePubkey           solana.PublicKey
	AuthorizedWithdrawer solana.PublicKey
	Commission           byte
	Votes                deque.Deque[LandedVote]
	RootSlot             *uint64
	AuthorizedVoters     AuthorizedVoters
	PriorVoters          PriorVoters
	EpochCredits         []EpochCredits
	LastTimestamp        BlockTimestamp
}

func (*VoteState) ContainsSlot

func (voteState *VoteState) ContainsSlot(candidateSlot uint64) bool

func (*VoteState) Credits

func (voteState *VoteState) Credits() uint64

func (*VoteState) CreditsForVoteAtIndex

func (voteState *VoteState) CreditsForVoteAtIndex(index uint64, timelyVoteCredits, deprecateUnusedLegacyVotePlumbing bool) uint64

func (*VoteState) DoubleLockouts

func (voteState *VoteState) DoubleLockouts()

func (*VoteState) GetAndUpdateAuthorizedVoter

func (voteState *VoteState) GetAndUpdateAuthorizedVoter(currentEpoch uint64) (solana.PublicKey, error)

func (*VoteState) IncrementCredits

func (voteState *VoteState) IncrementCredits(epoch uint64, credits uint64)

func (*VoteState) LastLockout

func (voteState *VoteState) LastLockout() *VoteLockout

func (*VoteState) LastVotedSlot

func (voteState *VoteState) LastVotedSlot() (uint64, bool)

func (*VoteState) MarshalWithEncoder

func (voteState *VoteState) MarshalWithEncoder(encoder *bin.Encoder) error

func (*VoteState) PopExpiredVotes

func (voteState *VoteState) PopExpiredVotes(nextVoteSlot uint64)

func (*VoteState) ProcessNextVoteSlot

func (voteState *VoteState) ProcessNextVoteSlot(nextVoteSlot uint64, epoch uint64, currentSlot uint64, timelyVoteCredits, deprecateUnusedLegacyVotePlumbing bool)

func (*VoteState) ProcessTimestamp

func (voteState *VoteState) ProcessTimestamp(slot uint64, timestamp int64) error

func (*VoteState) SetNewAuthorizedVoter

func (voteState *VoteState) SetNewAuthorizedVoter(authorized solana.PublicKey, currentEpoch uint64, targetEpoch uint64, verify func(epochAuthorizedVoter solana.PublicKey) error) error

func (*VoteState) UnmarshalWithDecoder

func (voteState *VoteState) UnmarshalWithDecoder(decoder *bin.Decoder) error

type VoteState0_23_5

type VoteState0_23_5 struct {
	NodePubkey           solana.PublicKey
	AuthorizedVoter      solana.PublicKey
	AuthorizedVoterEpoch uint64
	PriorVoters          PriorVoters0_23_5
	AuthorizedWithdrawer solana.PublicKey
	Commission           byte
	Votes                *deque.Deque[VoteLockout]
	RootSlot             *uint64
	EpochCredits         []EpochCredits
	LastTimestamp        BlockTimestamp
}

func (*VoteState0_23_5) MarshalWithEncoder

func (voteState *VoteState0_23_5) MarshalWithEncoder(encoder *bin.Encoder) error

func (*VoteState0_23_5) UnmarshalWithDecoder

func (voteState *VoteState0_23_5) UnmarshalWithDecoder(decoder *bin.Decoder) error

type VoteState1_14_11

type VoteState1_14_11 struct {
	NodePubkey           solana.PublicKey
	AuthorizedWithdrawer solana.PublicKey
	Commission           byte
	Votes                deque.Deque[VoteLockout]
	RootSlot             *uint64
	AuthorizedVoters     AuthorizedVoters
	PriorVoters          PriorVoters
	EpochCredits         []EpochCredits
	LastTimestamp        BlockTimestamp
}

func (*VoteState1_14_11) MarshalWithEncoder

func (voteState *VoteState1_14_11) MarshalWithEncoder(encoder *bin.Encoder) error

func (*VoteState1_14_11) UnmarshalWithDecoder

func (voteState *VoteState1_14_11) UnmarshalWithDecoder(decoder *bin.Decoder) error

type VoteStateVersions

type VoteStateVersions struct {
	Type     uint32
	V0_23_5  VoteState0_23_5
	V1_14_11 VoteState1_14_11
	Current  VoteState
}

func UnmarshalVersionedVoteState

func UnmarshalVersionedVoteState(data []byte) (*VoteStateVersions, error)

func (*VoteStateVersions) ConvertToCurrent

func (voteStateVersions *VoteStateVersions) ConvertToCurrent() *VoteState

func (*VoteStateVersions) IsInitialized

func (voteStateVersions *VoteStateVersions) IsInitialized() bool

func (*VoteStateVersions) MarshalWithEncoder

func (voteStateVersions *VoteStateVersions) MarshalWithEncoder(encoder *bin.Encoder) error

func (*VoteStateVersions) UnmarshalWithDecoder

func (voteStateVersions *VoteStateVersions) UnmarshalWithDecoder(decoder *bin.Decoder) error

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL