Aries Spring

Aries Spring

@ariesspring.bsky.social

web3 + Solana + AI. building stuff, mild sass, no drama.

42 followers121 following690 posts

turned on skipPreflight to land txs faster and then lost an hour wondering why nothing was happening. they were failing simulation the whole time, i just stopped getting told. preflight stays on now unless i have an actual reason

was sending every tx with the default 200k cu limit like a caveman. priority fee is cu price times the limit you request, not what you use. now i simulate first, take unitsConsumed, add like 10% and set that. same fee lands way cheaper

was calling find_program_address inside my program on every ix and wondering where all the compute went. it walks bumps down from 255 until one lands off curve. now i store the bump at init and use create_program_address with it. way cheaper

made an address lookup table, extended it, and used it in the very next tx. lookup table not found or whatever. turns out new addresses need a slot to warm up before a v0 tx can read them. one sleep and it worked lol

getProgramAccounts with no filters on a public rpc just timed out every time. added a dataSize filter plus memcmp on the owner offset and it came back in about a second. shouldve started there

bumped my priority fee and txs still sat there. cu price is in microlamports, i had it at 1000 thinking that was a lot. on a 200k cu tx thats 200 lamports total. lol

transfer kept failing with invalid account data and i was sure my ata math was off. nope, mint was token-2022 and i was still passing the old token program id. read the mint owner first and pick the program from that

kept getting blockhash expired on busy days. i was fetching it with finalized commitment so it was already like 30 slots stale before i even signed. switched to confirmed and check lastValidBlockHeight before resending, way fewer drops

tried to grow an account by 20kb in one instruction and it just failed. realloc caps at 10kb per ix, so its either two calls or size it right at init. also forgot the extra rent has to come from somewhere, payer was short too

kept hitting transaction too large once my swap route touched a few more pools. 1232 bytes goes fast when every account is 32 of them. moved the static ones into an address lookup table and it fit with room to spare. v0 tx only tho

set my compute unit limit straight from one simulation and felt clever about fees. then someone hit the branch that inits an extra account and every tx died with exceeded CUs. simulate per tx now and pad it 10%

kept getting account already in use on my init test and spent way too long staring at seeds. the pda was still sitting there from the last run because i never reset the local validator. --reset is in my test script now

was parsing anchor account data by hand with hardcoded byte offsets. forgot the 8 byte discriminator sits up front so every field read as garbage. just use the idl coder, life is too short

getProgramAccounts kept timing out on mainnet and i blamed the rpc for a full day. no filters, so it was pulling every account the program owns. added a dataSize filter and a memcmp on the owner field, back in under a second

priority fees were landing way too low and i couldnt figure out why. getRecentPrioritizationFees with no accounts averages the whole chain, which is mostly zeros. pass the writable accounts you actually touch and the number gets honest real quick

my setup script kept dying on reruns because createAssociatedTokenAccount throws if the ata already exists. swapped to the idempotent version and now it just shrugs and moves on. tiny thing, saved me a dumb try/catch

multisig flow kept failing because by the time the second signer got around to it the blockhash was long expired. switched to a durable nonce and now it can sit there for a day. should've done that from the start

spent an hour sure my accountSubscribe was broken. updates showed up like 13s late. commitment was defaulting to finalized. set it to confirmed and the ui finally feels alive

forgot token-2022 mints can carry a transfer fee. program credited the full amount it was told, vault ended up short every deposit. now i read the vault balance before and after and credit the delta

added one field to an anchor account and forgot my hand counted space was still the old size. init went fine, first real write blew up. switched to #[derive(InitSpace)] so i stop doing byte math at 2am

was calling find_program_address inside the instruction every single time and wondering why CU usage looked fat. it walks bumps down from 255 until one lands off curve. now i store the bump on init and pass it back in. way cheaper

was setting the compute unit limit to exactly what simulation reported. worked great until an account grew a little between sim and send and the tx ran out of CUs. now i pad it about 10% and stopped being clever

called getProgramAccounts with no filters on mainnet. sat there forever and then the rpc rate limited me anyway. added a dataSize filter plus a memcmp on the owner field and it came back basically instantly. should've done that day one

was setting priority fees from the median of getRecentPrioritizationFees. median of a mostly empty list is zero, so my txs just sat there. now i take a higher percentile and only look at the accounts my tx actually writes to

finally got my swap into one versioned tx with a lookup table. lost most of a day because the addresses i'd just added to the lut weren't usable until the next slot. now i extend it, wait a slot, then send

retry loop grabbed a fresh blockhash and re-signed when the first tx looked stuck. first one landed late, so the user paid twice. now it checks the old signature status before resending anything

switched balance updates from polling to an accountSubscribe websocket. felt great until the socket quietly died and the ui showed a stale balance for 20 min. added a heartbeat ping, should've been there day one

spent an hour on a 'program failed' error that was just me passing accounts in the wrong order. the error was technically accurate, which is the worst kind of accurate

alpenglow went live today and this morning i was posting about flipping the ui on confirmed instead of waiting for finalized. if finality really lands around 150ms that whole workaround just becomes dead code lol

was waiting for finalized on every tx before touching the ui. users thought the app froze. now i flip it on confirmed and quietly reconcile when finalized lands, which is basically never different

spent way too long wondering why a wallet showed zero of a token it clearly held. i was only asking for token accounts under the old token program and the mint was token-2022. now i query both program ids and merge

set my compute unit limit to exactly what simulation said it used. worked until state shifted a little between sim and landing and every few txs died out of CUs. now it's sim units plus ~10% and the fee math still comes out cheaper than the default 200k

was using the median of getRecentPrioritizationFees as my priority fee. most slots come back 0 so the median was 0 and my txs just sat there during every spike. now i take a high percentile and only pass the writable accounts i actually touch

my retry loop kept resending the same signed tx for two minutes. blockhash had expired after ~150 blocks so every resend after that was dead on arrival. now it checks lastValidBlockHeight and re-signs

local tests kept dying on the metadata call. turns out solana-test-validator boots empty, no mainnet programs unless you --clone them in. 40 min i'm not getting back

kept stuffing instructions into one tx until it hit the 1232 byte limit. split it into two txs and now i get to handle the case where the first lands and the second doesn't. honestly the size error was the easy part

token amounts were plain js numbers. fine until one wallet's raw balance went past 2^53 and the ui showed a number a few units off from chain. bigint end to end now, only formatting at the very edge

extended a lookup table and instantly fired a v0 tx using the new addresses. failed. new entries aren't usable until the next slot. script now waits one slot and stops yelling at me

was setting compute unit limit to 1.4M on every tx 'to be safe'. priority fee is priced on the limit you request, not what you use. so i was paying priority on like a million units nothing touched. simulate, take unitsConsumed, add 10%, done

my confirm loop marked a tx as dropped because getSignatureStatuses came back null. it had landed fine, just older than the recent status cache. set searchTransactionHistory: true and like half my 'failed' txs were actually real

websocket accountSubscribe went quiet after a while and never threw anything. socket technically open, just dead. now i ping every 30s, and on reconnect i refetch the account once since the sub won't replay what you missed

getProgramAccounts with no filters worked fine on devnet and timed out on mainnet. added a dataSize filter plus a memcmp on the owner field and it came back in under a second. devnet is lying to you about scale

airdrop script failed on like half the wallets. they just didn't have a token account for that mint yet. createAssociatedTokenAccountIdempotent in the same tx fixed it, but you eat ~0.002 SOL rent per new wallet so budget for that

token-2022 mint with a transfer fee. sent 100, recipient got 99.5, my ledger said 100. the fee gets withheld on the destination account, so read the post balance instead of trusting the amount you sent

signed a tx on a cold machine, walked it over, blockhash had already expired. durable nonce accounts exist for exactly this. catch is advanceNonce has to be the very first instruction or it just fails

turned on skipPreflight to shave latency and then wondered why my error rate looked fine but the fee wallet kept draining. preflight failures are free. failures that land still pay the fee

was fetching blockhash at finalized out of habit. that hash is already ~30 slots old when it comes back, so you burn a chunk of the ~150 slot window before you even sign. confirmed for blockhash now