feat(bitcoin): Recommend Graviton4 (r8g) instance types - #341
Merged
Merged
Conversation
The README and the blueprint's defaultDataVolumes said 1 TB / 1000 GiB while every mainnet sample provisions 1500 GiB. Update the diagram, instance and storage tables, cost notes, and package.json to 1.5 TB so the AI deploy workflow and manual readers see what actually deploys.
Step 2.5 of the AI deploy workflow omitted bitcoin from the built-in list, so assistants would require an external-blueprint security review for it. Match docs/ageai-blueprint-security-review.md.
Switch the mainnet (single-node, HA) and testnet samples from r7i to r8g (CPU_TYPE=ARM_64). In a side-by-side mainnet test with Bitcoin Core v31.1, r8g.2xlarge beat r7i.2xlarge on sync time (-14%), full-block RPC (+4%), and transaction lookups (2.8x) at 11% lower hourly cost. node.sh already installs the aarch64 build, so no code changes are needed. Add a "Choosing an instance type" guide (r8g primary, r7g low-cost secondary, r7i for x86 hosts, including why r7i trails on light RPC: default C6 idle wakeups), document the expected GuardDuty BitcoinTool.B finding with a scoped suppression example, and update the measured chain size and IBD time.
Keep the blueprint docs focused on instance guidance for now; the GuardDuty finding note will be handled separately.
Reframe r7g as the regional fallback that handles all tested workloads and state plainly where r7i beats it. Add tested post-sync guidance (r8g.xlarge matched r8g.2xlarge on single-client RPC at half the price), note that changing CPU_TYPE on an existing single-node stack rolls back, correct mainnet size and growth (~970 GB, ~100 GB/year measured from the last year of blocks), fix the HA destroy stack name, and warn that cdk destroy deletes the chain data volume.
A redeploy with changed user data (as a new CLIENT_CONFIG produces) stops and starts the same single-node instance without re-running node setup, so the node keeps its previous Bitcoin Core version; the README said the instance is replaced and upgraded. Verified on a mainnet test stack. Add a troubleshooting entry for a node that crash-loops after an interrupted first boot: re-run node.sh from SSM.
Changing INSTANCE_TYPE and running cdk deploy on a single-node stack stops and starts the same instance with the new type and keeps the data volume attached; the node resumed at the tip with no re-sync (verified r7g.2xlarge -> r7g.xlarge on mainnet). Replace the manual EC2 console resize guidance, which left the stack drifted.
node.sh stores the RPC credentials as <stack-name>/bitcoin_rpc_credentials, but the README retrieval, troubleshooting, and RPC Authentication text used bitcoin_rpc_credentials, which does not exist. Because the secret is created at first boot rather than by CloudFormation, cdk destroy leaves it behind; document deleting it in Cleaning Up. Both verified while tearing down the mainnet test stacks.
Reflect the r7g secondary positioning and link the single-node upgrade issue (#340).
Dependency Review✅ No vulnerabilities or license issues or OpenSSF Scorecard issues found.Scanned FilesNone |
|
Scan for commit: 🔒 Security Scan ResultsScanned files: 7 ✅ No security issues found. |
Add an "Under concurrent load" section from a 1-64 client test run from a separate load generator: r8g.2xlarge served 1.5-1.7x the peak throughput of r7i.2xlarge on full-block, transaction-lookup, and mixed workloads, and each xlarge reached about half its 2xlarge. Note the network-baseline limit on sustained full-block serving. Replace single-run sync figures with the range from a second sync (r8g 4-14% faster than r7i), and replace the untested "high-volume" claim with measured numbers.
Signed-off-by: Nikolay Vlasov <frbrkoala@users.noreply.github.com>
frbrkoala
approved these changes
Oct 2, 2026
frbrkoala
left a comment
Contributor
There was a problem hiding this comment.
Thanks a lot for the contribution!
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Switches the Bitcoin blueprint's recommended and sample instance types from x86
r7ito Graviton4 (r8g), based on side-by-side mainnet tests. It also adds "choose this when" and load-sizing guidance, and corrects several README statements that turned out to be wrong during testing.Recommendation
r8g.xlargereaches about half of r8g.2xlarge's peak throughput at half the price. It's the most cost-efficient choice for lookup-heavy nodes, and resizing via.env+cdk deployis in place with no re-sync.Changes
Samples: mainnet single-node and HA use
r8g.2xlarge, and testnet usesr8g.xlarge, all withCPU_TYPE="ARM_64". Nonode.shchange is needed; it already installs the aarch64 Bitcoin Core build.README:
.env+cdk deploy.CLIENT_CONFIGstops and starts the same instance without re-running setup, so the node keeps the old version. Refs Single-node redeploy with new CLIENT_CONFIG doesn't upgrade the client #340.CPU_TYPEon an existing stack fails on the volume attachment and rolls back.<stack-name>/bitcoin_rpc_credentials, notbitcoin_rpc_credentials.cdk destroystack name was wrong (no-hasuffix).cdk destroydeletes the chain data volume, and documents deleting the RPC secret, whichcdk destroyleaves behind.node.sh).Blueprint:
defaultDataVolumesis now 1500 GiB, matching the samples.Deploy prompt:
docs/ageai-deploy-prompt.mdStep 2.5 now listsbitcoinas a built-in blueprint, so assistants don't demand an external-blueprint security review for it. This is a bug fix.CHANGELOG: entries under
[Unreleased].Testing
Build:
npm run buildandnpm testpass (22 suites, 473 tests).pre-commitpasses on the changed files.npx cdk synthon all three samples produces the Ubuntu 24.04 arm64 AMI with the expected r8g instance type.Mainnet nodes: every node used:
What was measured:
c1_block_heightmetric.assumevalid, r8g was about 30% faster in both.getblockverbosity 2 andgetrawtransactionverbose), both cold and warm.getblockv2,getrawtransactionverbose, and a 90/10 mix.cdk deployresize.Other checks:
cdk deployworked on Graviton and x86: r7g.2xlarge → xlarge, r8g.2xlarge → xlarge and r7i.2xlarge → xlarge, each with the same instance and volume and no re-sync.CPU_TYPEredeploy rolled back.cdk destroydeleted the data volumes and left the RPC secrets behind.dbcache 24 GiB vs 4096: not adopted. It was 4.2% faster through block 600k, but the gain was shrinking and the difference was the same size as run-to-run variance. Its hourly UTXO flushes also grew with the cache. The blueprint keeps
dbcache=4096.Caveats:
cs_mainor the 16-thread RPC pool) and wasn't isolatedThe benchmark scripts aren't included in the repo; they're specific to this test and would need generalizing before publishing.