From 88a885f156b9d55bc18ccfe63e42cbea6d69da38 Mon Sep 17 00:00:00 2001 From: Steven Luscher Date: Wed, 27 Nov 2024 19:33:55 +0000 Subject: [PATCH] Test validator installer now sources from version 2.0.x line --- .changeset/wicked-bikes-pay.md | 11 ++++ .../__tests__/get-program-accounts-test.ts | 4 +- .../__tests__/simulate-transaction-test.ts | 15 +++++ .../rpc-graphql/src/__tests__/account-test.ts | 41 ------------- .../src/schema/type-defs/account.ts | 14 ----- .../src/schema/type-resolvers/account.ts | 7 --- packages/sysvars/src/__tests__/fees-test.ts | 29 ---------- packages/sysvars/src/__tests__/sysvar-test.ts | 17 ------ .../src/__typetests__/sysvar-typetest.ts | 9 --- packages/sysvars/src/fees.ts | 57 ------------------- packages/sysvars/src/index.ts | 1 - packages/sysvars/src/sysvar.ts | 3 - .../get-latest-validator-release-version.sh | 2 +- 13 files changed, 29 insertions(+), 181 deletions(-) create mode 100644 .changeset/wicked-bikes-pay.md delete mode 100644 packages/sysvars/src/__tests__/fees-test.ts delete mode 100644 packages/sysvars/src/fees.ts diff --git a/.changeset/wicked-bikes-pay.md b/.changeset/wicked-bikes-pay.md new file mode 100644 index 000000000000..984e82d541a6 --- /dev/null +++ b/.changeset/wicked-bikes-pay.md @@ -0,0 +1,11 @@ +--- +'@solana/sysvars': minor +--- + +Removed the fees sysvar which has been disabled on the network for a year, and has now been removed from the test validator in Agave 2.0 + +``` +% solana feature status JAN1trEUEtZjgXYzNBYHU9DYd7GnThhXfFP7SzPXkPsG +Feature | Status | Activation Slot | Description +JAN1trEUEtZjgXYzNBYHU9DYd7GnThhXfFP7SzPXkPsG | active since epoch 483 | 208656004 | disable fees sysvar +``` diff --git a/packages/rpc-api/src/__tests__/get-program-accounts-test.ts b/packages/rpc-api/src/__tests__/get-program-accounts-test.ts index 097f1508b657..86228ff1fcf1 100644 --- a/packages/rpc-api/src/__tests__/get-program-accounts-test.ts +++ b/packages/rpc-api/src/__tests__/get-program-accounts-test.ts @@ -2063,7 +2063,7 @@ describe('getProgramAccounts', () => { data: { parsed: { info: expect.any(Object), - type: 'fees', + type: 'lastRestartSlot', }, program: 'sysvar', space: 8n, @@ -2074,7 +2074,7 @@ describe('getProgramAccounts', () => { rentEpoch: expect.any(BigInt), space: 8n, }, - pubkey: 'SysvarFees111111111111111111111111111111111', + pubkey: 'SysvarLastRestartS1ot1111111111111111111111', }, { account: { diff --git a/packages/rpc-api/src/__tests__/simulate-transaction-test.ts b/packages/rpc-api/src/__tests__/simulate-transaction-test.ts index 68b27a479f20..5e4323f04311 100644 --- a/packages/rpc-api/src/__tests__/simulate-transaction-test.ts +++ b/packages/rpc-api/src/__tests__/simulate-transaction-test.ts @@ -174,6 +174,7 @@ describe('simulateTransaction', () => { err: null, innerInstructions: null, logs: expect.any(Array), + replacementBlockhash: null, returnData: null, unitsConsumed: expect.any(BigInt), }, @@ -284,6 +285,7 @@ describe('simulateTransaction', () => { err: null, innerInstructions: null, logs: expect.any(Array), + replacementBlockhash: null, returnData: null, unitsConsumed: expect.any(BigInt), }, @@ -323,6 +325,7 @@ describe('simulateTransaction', () => { err: 'BlockhashNotFound', innerInstructions: null, logs: expect.any(Array), + replacementBlockhash: null, returnData: null, unitsConsumed: expect.any(BigInt), }, @@ -362,6 +365,10 @@ describe('simulateTransaction', () => { err: null, innerInstructions: null, logs: expect.any(Array), + replacementBlockhash: { + blockhash: expect.any(String), + lastValidBlockHeight: expect.any(BigInt), + }, returnData: null, unitsConsumed: expect.any(BigInt), }, @@ -464,6 +471,7 @@ describe('simulateTransaction', () => { err: 'AccountNotFound', innerInstructions: null, logs: expect.any(Array), + replacementBlockhash: null, returnData: null, unitsConsumed: expect.any(BigInt), }, @@ -513,6 +521,7 @@ describe('simulateTransaction', () => { err: null, innerInstructions: null, logs: expect.any(Array), + replacementBlockhash: null, returnData: null, unitsConsumed: expect.any(BigInt), }, @@ -562,6 +571,7 @@ describe('simulateTransaction', () => { err: null, innerInstructions: null, logs: expect.any(Array), + replacementBlockhash: null, returnData: null, unitsConsumed: expect.any(BigInt), }, @@ -628,6 +638,7 @@ describe('simulateTransaction', () => { err: null, innerInstructions: null, logs: expect.any(Array), + replacementBlockhash: null, returnData: null, unitsConsumed: expect.any(BigInt), }, @@ -678,6 +689,7 @@ describe('simulateTransaction', () => { err: null, innerInstructions: null, logs: expect.any(Array), + replacementBlockhash: null, returnData: null, unitsConsumed: expect.any(BigInt), }, @@ -727,6 +739,7 @@ describe('simulateTransaction', () => { innerInstructions: null, logs: expect.any(Array), + replacementBlockhash: null, returnData: null, unitsConsumed: expect.any(BigInt), }, @@ -781,6 +794,7 @@ describe('simulateTransaction', () => { err: null, innerInstructions: null, logs: expect.any(Array), + replacementBlockhash: null, returnData: null, unitsConsumed: expect.any(BigInt), }, @@ -821,6 +835,7 @@ describe('simulateTransaction', () => { err: null, innerInstructions: null, logs: expect.any(Array), + replacementBlockhash: null, returnData: null, unitsConsumed: expect.any(BigInt), }, diff --git a/packages/rpc-graphql/src/__tests__/account-test.ts b/packages/rpc-graphql/src/__tests__/account-test.ts index dd04305f6ce5..fcb27a29572a 100644 --- a/packages/rpc-graphql/src/__tests__/account-test.ts +++ b/packages/rpc-graphql/src/__tests__/account-test.ts @@ -994,47 +994,6 @@ describe('account', () => { }, }); }); - it('can get the fees sysvar', async () => { - expect.assertions(1); - const variableValues = { - address: 'SysvarFees111111111111111111111111111111111', - }; - const source = /* GraphQL */ ` - query testQuery($address: Address!) { - account(address: $address) { - address - lamports - ownerProgram { - address - } - rentEpoch - space - ... on SysvarFeesAccount { - feeCalculator { - lamportsPerSignature - } - } - } - } - `; - const result = await rpcGraphQL.query(source, variableValues); - expect(result).toMatchObject({ - data: { - account: { - address: 'SysvarFees111111111111111111111111111111111', - feeCalculator: { - lamportsPerSignature: expect.any(BigInt), - }, - lamports: expect.any(BigInt), - ownerProgram: { - address: 'Sysvar1111111111111111111111111111111111111', - }, - rentEpoch: expect.any(BigInt), - space: expect.any(BigInt), - }, - }, - }); - }); it('can get the last restart slot sysvar', async () => { expect.assertions(1); const variableValues = { diff --git a/packages/rpc-graphql/src/schema/type-defs/account.ts b/packages/rpc-graphql/src/schema/type-defs/account.ts index 61eb00ab4740..5aca53205ba9 100644 --- a/packages/rpc-graphql/src/schema/type-defs/account.ts +++ b/packages/rpc-graphql/src/schema/type-defs/account.ts @@ -470,20 +470,6 @@ export const accountTypeDefs = /* GraphQL */ ` lamportsPerSignature: Lamports } - """ - Sysvar Fees - """ - type SysvarFeesAccount implements Account { - address: Address - data(encoding: AccountEncoding!, dataSlice: DataSlice): String - executable: Boolean - lamports: Lamports - ownerProgram: Account - space: BigInt - rentEpoch: Epoch - feeCalculator: FeeCalculator - } - """ Sysvar Last Restart Slot """ diff --git a/packages/rpc-graphql/src/schema/type-resolvers/account.ts b/packages/rpc-graphql/src/schema/type-resolvers/account.ts index 3cc90b057072..8ccb2c277d96 100644 --- a/packages/rpc-graphql/src/schema/type-resolvers/account.ts +++ b/packages/rpc-graphql/src/schema/type-resolvers/account.ts @@ -147,9 +147,6 @@ export const accountTypeResolvers = { if (jsonParsedConfigs.accountType === 'epochSchedule') { return 'SysvarEpochScheduleAccount'; } - if (jsonParsedConfigs.accountType === 'fees') { - return 'SysvarFeesAccount'; - } if (jsonParsedConfigs.accountType === 'lastRestartSlot') { return 'SysvarLastRestartSlotAccount'; } @@ -271,10 +268,6 @@ export const accountTypeResolvers = { data: resolveAccountData(), ownerProgram: resolveAccount('ownerProgram'), }, - SysvarFeesAccount: { - data: resolveAccountData(), - ownerProgram: resolveAccount('ownerProgram'), - }, SysvarLastRestartSlotAccount: { data: resolveAccountData(), ownerProgram: resolveAccount('ownerProgram'), diff --git a/packages/sysvars/src/__tests__/fees-test.ts b/packages/sysvars/src/__tests__/fees-test.ts deleted file mode 100644 index 6995945f1153..000000000000 --- a/packages/sysvars/src/__tests__/fees-test.ts +++ /dev/null @@ -1,29 +0,0 @@ -import type { GetAccountInfoApi } from '@solana/rpc-api'; -import type { Rpc } from '@solana/rpc-spec'; - -import { fetchSysvarFees, getSysvarFeesCodec } from '../fees'; -import { createLocalhostSolanaRpc } from './__setup__'; - -describe('fees', () => { - let rpc: Rpc; - beforeEach(() => { - rpc = createLocalhostSolanaRpc(); - }); - it('decode', () => { - const feesState = new Uint8Array([0, 225, 245, 5, 0, 0, 0, 0]); - expect(getSysvarFeesCodec().decode(feesState)).toMatchObject({ - feeCalculator: { - lamportsPerSignature: 100_000_000n, - }, - }); - }); - it('fetch', async () => { - expect.assertions(1); - const fees = await fetchSysvarFees(rpc); - expect(fees).toMatchObject({ - feeCalculator: { - lamportsPerSignature: expect.any(BigInt), - }, - }); - }); -}); diff --git a/packages/sysvars/src/__tests__/sysvar-test.ts b/packages/sysvars/src/__tests__/sysvar-test.ts index 1f459bf1f40c..ce832b0cb4c1 100644 --- a/packages/sysvars/src/__tests__/sysvar-test.ts +++ b/packages/sysvars/src/__tests__/sysvar-test.ts @@ -6,7 +6,6 @@ import { fetchJsonParsedSysvarAccount, SYSVAR_CLOCK_ADDRESS, SYSVAR_EPOCH_SCHEDULE_ADDRESS, - SYSVAR_FEES_ADDRESS, SYSVAR_LAST_RESTART_SLOT_ADDRESS, SYSVAR_RECENT_BLOCKHASHES_ADDRESS, SYSVAR_RENT_ADDRESS, @@ -77,22 +76,6 @@ describe('sysvar account', () => { }); }); }); - describe('fees', () => { - it('fetch encoded', async () => { - expect.assertions(3); - await assertValidEncodedSysvarAccount(SYSVAR_FEES_ADDRESS); - }); - it('fetch JSON-parsed', async () => { - expect.assertions(3); - await assertValidJsonParsedSysvarAccount(SYSVAR_FEES_ADDRESS, { - data: { - feeCalculator: { - lamportsPerSignature: expect.any(String), // JsonParsed converts to string - }, - }, - }); - }); - }); // `Instructions` does not exist on-chain. describe('last restart slot', () => { it('fetch encoded', async () => { diff --git a/packages/sysvars/src/__typetests__/sysvar-typetest.ts b/packages/sysvars/src/__typetests__/sysvar-typetest.ts index 7762c1acbc59..18c7e64150d4 100644 --- a/packages/sysvars/src/__typetests__/sysvar-typetest.ts +++ b/packages/sysvars/src/__typetests__/sysvar-typetest.ts @@ -6,7 +6,6 @@ import type { JsonParsedSysvarAccount } from '@solana/rpc-parsed-types'; import { fetchSysvarClock, type SysvarClock } from '../clock'; import { fetchSysvarEpochRewards, type SysvarEpochRewards } from '../epoch-rewards'; import { fetchSysvarEpochSchedule, type SysvarEpochSchedule } from '../epoch-schedule'; -import { fetchSysvarFees, type SysvarFees } from '../fees'; import { fetchSysvarLastRestartSlot, type SysvarLastRestartSlot } from '../last-restart-slot'; import { fetchSysvarRecentBlockhashes, type SysvarRecentBlockhashes } from '../recent-blockhashes'; import { fetchSysvarRent, type SysvarRent } from '../rent'; @@ -79,14 +78,6 @@ const rpc = null as unknown as Parameters[0]; fetchSysvarEpochSchedule(rpc) satisfies Promise<{ foo: string }>; } -// `fetchSysvarFees` -{ - // Returns a `SysvarFees`. - fetchSysvarFees(rpc) satisfies Promise; - // @ts-expect-error Returns a `SysvarFees`. - fetchSysvarFees(rpc) satisfies Promise<{ foo: string }>; -} - // `fetchSysvarLastRestartSlot` { // Returns a `SysvarLastRestartSlot`. diff --git a/packages/sysvars/src/fees.ts b/packages/sysvars/src/fees.ts deleted file mode 100644 index 275a9ac2d7d8..000000000000 --- a/packages/sysvars/src/fees.ts +++ /dev/null @@ -1,57 +0,0 @@ -import { assertAccountExists, decodeAccount, type FetchAccountConfig } from '@solana/accounts'; -import { - combineCodec, - type FixedSizeCodec, - type FixedSizeDecoder, - type FixedSizeEncoder, - getStructDecoder, - getStructEncoder, -} from '@solana/codecs'; -import type { GetAccountInfoApi } from '@solana/rpc-api'; -import type { Rpc } from '@solana/rpc-spec'; -import { getDefaultLamportsDecoder, getDefaultLamportsEncoder, Lamports } from '@solana/rpc-types'; - -import { fetchEncodedSysvarAccount, SYSVAR_FEES_ADDRESS } from './sysvar'; - -type FeeCalculator = Readonly<{ - lamportsPerSignature: Lamports; -}>; - -type SysvarFeesSize = 8; - -/** - * The `Fees` sysvar. - * - * Current cluster fees. - */ -export type SysvarFees = Readonly<{ - feeCalculator: FeeCalculator; -}>; - -export function getSysvarFeesEncoder(): FixedSizeEncoder { - return getStructEncoder([ - ['feeCalculator', getStructEncoder([['lamportsPerSignature', getDefaultLamportsEncoder()]])], - ]) as FixedSizeEncoder; -} - -export function getSysvarFeesDecoder(): FixedSizeDecoder { - return getStructDecoder([ - ['feeCalculator', getStructDecoder([['lamportsPerSignature', getDefaultLamportsDecoder()]])], - ]) as FixedSizeDecoder; -} - -export function getSysvarFeesCodec(): FixedSizeCodec { - return combineCodec(getSysvarFeesEncoder(), getSysvarFeesDecoder()); -} - -/** - * Fetch the `Fees` sysvar. - * - * Current cluster fees. - */ -export async function fetchSysvarFees(rpc: Rpc, config?: FetchAccountConfig): Promise { - const account = await fetchEncodedSysvarAccount(rpc, SYSVAR_FEES_ADDRESS, config); - assertAccountExists(account); - const decoded = decodeAccount(account, getSysvarFeesDecoder()); - return decoded.data; -} diff --git a/packages/sysvars/src/index.ts b/packages/sysvars/src/index.ts index 773ad2c37e31..02b22110d41a 100644 --- a/packages/sysvars/src/index.ts +++ b/packages/sysvars/src/index.ts @@ -1,7 +1,6 @@ export * from './clock'; export * from './epoch-rewards'; export * from './epoch-schedule'; -export * from './fees'; export * from './last-restart-slot'; export * from './recent-blockhashes'; export * from './rent'; diff --git a/packages/sysvars/src/sysvar.ts b/packages/sysvars/src/sysvar.ts index 3353c5f1b60e..2fce9118cfdd 100644 --- a/packages/sysvars/src/sysvar.ts +++ b/packages/sysvars/src/sysvar.ts @@ -16,8 +16,6 @@ export const SYSVAR_EPOCH_REWARDS_ADDRESS = 'SysvarEpochRewards1111111111111111111111111' as Address<'SysvarEpochRewards1111111111111111111111111'>; export const SYSVAR_EPOCH_SCHEDULE_ADDRESS = 'SysvarEpochSchedu1e111111111111111111111111' as Address<'SysvarEpochSchedu1e111111111111111111111111'>; -export const SYSVAR_FEES_ADDRESS = - 'SysvarFees111111111111111111111111111111111' as Address<'SysvarFees111111111111111111111111111111111'>; export const SYSVAR_INSTRUCTIONS_ADDRESS = 'Sysvar1nstructions1111111111111111111111111' as Address<'Sysvar1nstructions1111111111111111111111111'>; export const SYSVAR_LAST_RESTART_SLOT_ADDRESS = @@ -37,7 +35,6 @@ type SysvarAddress = | typeof SYSVAR_CLOCK_ADDRESS | typeof SYSVAR_EPOCH_REWARDS_ADDRESS | typeof SYSVAR_EPOCH_SCHEDULE_ADDRESS - | typeof SYSVAR_FEES_ADDRESS | typeof SYSVAR_INSTRUCTIONS_ADDRESS | typeof SYSVAR_LAST_RESTART_SLOT_ADDRESS | typeof SYSVAR_RECENT_BLOCKHASHES_ADDRESS diff --git a/scripts/get-latest-validator-release-version.sh b/scripts/get-latest-validator-release-version.sh index 9b45a20433e6..b200dda5a693 100755 --- a/scripts/get-latest-validator-release-version.sh +++ b/scripts/get-latest-validator-release-version.sh @@ -2,7 +2,7 @@ ( set -e version=$(node -e \ - 'fetch("https://api.github.com/repos/anza-xyz/agave/releases").then(res => res.json().then(rs => rs.filter(r => !r.prerelease && r.tag_name.startsWith("v1.18."))).then(x => console.log(x[0].tag_name)));' + 'fetch("https://api.github.com/repos/anza-xyz/agave/releases").then(res => res.json().then(rs => rs.filter(r => !r.prerelease && r.tag_name.startsWith("v2.0."))).then(x => console.log(x[0].tag_name)));' ) if [ -z $version ]; then exit 3