From 09cee6d79868ac7ea384793eec6e4342ebf38c5c 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 | 6 ++-- .../__tests__/simulate-transaction-test.ts | 15 ++++++++++ packages/sysvars/src/__tests__/fees-test.ts | 29 ------------------- packages/sysvars/src/__tests__/sysvar-test.ts | 17 ----------- packages/sysvars/src/sysvar.ts | 3 -- .../get-latest-validator-release-version.sh | 2 +- 7 files changed, 30 insertions(+), 53 deletions(-) create mode 100644 .changeset/wicked-bikes-pay.md delete mode 100644 packages/sysvars/src/__tests__/fees-test.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..d686ae2bfee4 100644 --- a/packages/rpc-api/src/__tests__/get-program-accounts-test.ts +++ b/packages/rpc-api/src/__tests__/get-program-accounts-test.ts @@ -2004,7 +2004,7 @@ describe('getProgramAccounts', () => { }); }); - it('returns RPC response with parsed JSON data for Sysvar rent account', async () => { + it.only('returns RPC response with parsed JSON data for Sysvar rent account', async () => { expect.assertions(1); // Sysvar accounts don't need a fixture // They're owned by Sysvar1111111111111111111111111111111111111 @@ -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/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/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