Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add support for 2025 Cash Improvement Proposals and VM benchmarking #139

Open
wants to merge 26 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
26 commits
Select commit Hold shift + click to select a range
b4fbd00
clarify generateDeterministicEntropy usage examples
bitjson Apr 10, 2024
4043ae7
Deprecate BCH_2022_05, add BCH_2023_05, BCH_2025_05, and BCH_SPEC, up…
bitjson May 8, 2024
49bcce4
Begin implementation of BCH_2025_05 and BCH_SPEC
bitjson May 10, 2024
1f34ca4
Update `isStandardOutputBytecode` to allow P2SH32
bitjson May 28, 2024
18e1614
Add BCH_2026_05, add VM benchmarking
bitjson May 30, 2024
c0eadac
Run VMB benchmarks in CI
bitjson May 30, 2024
d0d54b9
Fix OP_TXVERSION VMB tests, reduce 2025 nonstandard hashing density l…
bitjson May 31, 2024
1a03d3f
Improve VM perf, support schnorr multisig, expand support for limit, …
bitjson Jul 26, 2024
a867ff9
Merge branch 'benchmarks' into next
bitjson Jul 26, 2024
ffad3f6
Enter prerelease mode
bitjson Jul 26, 2024
b1851d4
Release v3.1.0-next.0 (#138)
github-actions[bot] Jul 26, 2024
cad78dd
Revise BCH VMs and VMB tests, rewrite VMB test tooling for performance
bitjson Sep 17, 2024
9c35e3e
Upgrade deps, add export:vmb_tests tooling, more tests
bitjson Sep 25, 2024
546ae14
Merge pull request #144 from bitauth/2025
bitjson Sep 27, 2024
33bbdaa
Release v (next)
github-actions[bot] Sep 27, 2024
94306e4
Merge pull request #146 from bitauth/changeset-release/next
bitjson Sep 27, 2024
76879be
Submodule and test against BCHN, expand VMB test coverage
bitjson Nov 15, 2024
1ae893c
Merge pull request #148 from bitauth/2025
bitjson Nov 15, 2024
10b1eeb
Release v (next)
github-actions[bot] Nov 15, 2024
681f962
Merge pull request #149 from bitauth/changeset-release/next
bitjson Nov 15, 2024
836d917
Speculatively implement P2S, OP_EVAL, and OP_POW (#150)
bitjson Dec 12, 2024
febc970
Release v3.1.0-next.3 (#151)
github-actions[bot] Dec 12, 2024
3075c46
Fix build issues
bitjson Dec 13, 2024
4efa3fb
Commit BCH_2026 tests
bitjson Dec 13, 2024
477334a
Improve BCH_2026 support and test coverage
bitjson Dec 19, 2024
489cac0
Release v3.1.0-next.4 (#152)
github-actions[bot] Dec 19, 2024
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
5 changes: 5 additions & 0 deletions .changeset/breezy-tables-enjoy.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
'@bitauth/libauth': patch
---

Fix operation cost in OP_SIZE
5 changes: 5 additions & 0 deletions .changeset/clean-adults-explain.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
'@bitauth/libauth': minor
---

Extend AuthenticationErrorCommon with all transaction verification errors
5 changes: 5 additions & 0 deletions .changeset/cold-cups-eat.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
'@bitauth/libauth': minor
---

Add support for debugging evaluations with loops
7 changes: 7 additions & 0 deletions .changeset/curvy-pandas-agree.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
---
'@bitauth/libauth': patch
---

Update `isStandardOutputBytecode` to allow P2SH32

Fixes #133. Thanks for the report @rkalis!
5 changes: 5 additions & 0 deletions .changeset/eight-mirrors-arrive.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
'@bitauth/libauth': minor
---

Add support for warnings in VMB test generation
5 changes: 5 additions & 0 deletions .changeset/fair-zoos-tap.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
'@bitauth/libauth': minor
---

Add support for verifying VMB tests against BCHN metrics and fail reasons
5 changes: 5 additions & 0 deletions .changeset/famous-spies-drive.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
'@bitauth/libauth': patch
---

Fix OP_TXVERSION VMB tests, reduce 2025 nonstandard hashing density limit
5 changes: 5 additions & 0 deletions .changeset/fast-ghosts-fix.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
'@bitauth/libauth': patch
---

Move VMB test duplication checking to start of generation
7 changes: 7 additions & 0 deletions .changeset/great-ducks-roll.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
---
'@bitauth/libauth': minor
---

Deprecate `BCH_2022_05` VM, add `BCH_2023_05`, `BCH_2025_05`, and `BCH_SPEC` VMs, update vmb_tests

Additionally, all exports have been renamed to more consistently adhere to the `camelCase` capitalization style, without exceptions for abbreviations. For example `assembleBytecodeBCH` is now `assembleBytecodeBch`. To ensure backwards-compatibility, aliases (marked with `@deprecated` TSdoc tags) are also exported using the old capitalization. These aliases will be removed in a future major version.
5 changes: 5 additions & 0 deletions .changeset/happy-insects-wait.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
'@bitauth/libauth': patch
---

Add BCH_2026_05, add VM benchmarking
5 changes: 5 additions & 0 deletions .changeset/itchy-dancers-confess.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
'@bitauth/libauth': patch
---

Add support for BigInt CHIP
5 changes: 5 additions & 0 deletions .changeset/long-hairs-jam.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
'@bitauth/libauth': patch
---

Improve performance of all virtual machines
5 changes: 5 additions & 0 deletions .changeset/modern-cobras-drop.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
'@bitauth/libauth': minor
---

Prevent excessive hashing in null-signature CHECKMULTISIG
5 changes: 5 additions & 0 deletions .changeset/nervous-carrots-punch.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
'@bitauth/libauth': patch
---

Run VMB benchmarks in CI
5 changes: 5 additions & 0 deletions .changeset/nice-flies-listen.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
'@bitauth/libauth': patch
---

Fix operation cost in OP_NIP
5 changes: 5 additions & 0 deletions .changeset/polite-eggs-pretend.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
'@bitauth/libauth': patch
---

Add -i flag to ignore warnings in gen:vmb_tests
39 changes: 39 additions & 0 deletions .changeset/pre.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
{
"mode": "pre",
"tag": "next",
"initialVersions": {
"@bitauth/libauth": "3.0.0"
},
"changesets": [
"breezy-tables-enjoy",
"clean-adults-explain",
"cold-cups-eat",
"curvy-pandas-agree",
"eight-mirrors-arrive",
"fair-zoos-tap",
"famous-spies-drive",
"fast-ghosts-fix",
"great-ducks-roll",
"happy-insects-wait",
"itchy-dancers-confess",
"long-hairs-jam",
"modern-cobras-drop",
"nervous-carrots-punch",
"nice-flies-listen",
"orange-suits-impress",
"polite-eggs-pretend",
"quiet-ducks-sneeze",
"seven-ligers-drum",
"shaggy-monkeys-tell",
"short-cars-cheat",
"shy-kings-grow",
"sixty-brooms-shout",
"sour-ties-allow",
"tall-actors-sell",
"ten-crabs-smell",
"twelve-suns-protect",
"two-peas-give",
"unlucky-windows-remember",
"wet-pans-confess"
]
}
5 changes: 5 additions & 0 deletions .changeset/quiet-ducks-sneeze.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
'@bitauth/libauth': patch
---

Fix operation cost in OP_ROLL
5 changes: 5 additions & 0 deletions .changeset/seven-ligers-drum.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
'@bitauth/libauth': patch
---

Add support for Schnorr multisig in BCH VMs
5 changes: 5 additions & 0 deletions .changeset/shaggy-monkeys-tell.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
'@bitauth/libauth': minor
---

Submodule BCHN and extend package scripts to verify VMB tests
5 changes: 5 additions & 0 deletions .changeset/short-cars-cheat.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
'@bitauth/libauth': minor
---

Expand VMB test coverage
5 changes: 5 additions & 0 deletions .changeset/shy-kings-grow.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
'@bitauth/libauth': patch
---

Eliminate Repeated Bytes counter from BCH_2026_05
5 changes: 5 additions & 0 deletions .changeset/sixty-brooms-shout.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
'@bitauth/libauth': minor
---

Add combinatorial VMB test sets for arithmetic, hashing, and signature checking
9 changes: 9 additions & 0 deletions .changeset/sour-ties-allow.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
---
'@bitauth/libauth': patch
---

Begin implementation of BCH_2025_05 and BCH_SPEC

- Revised `AuthenticationVirtualMachine` to remove `clone` (obviated by wide availability of `structuredClone`) and add `initialize`, allowing VM proposals to add to the program state of an existing VM (in a type-safe way) without duplicating its unchanged logic.
- Clarified documentation around contributing upgrade proposals to Libauth VMs
- Allow usage of any `BCH_SPEC` opcodes in `assembleBytecodeBch`/`disassembleBytecodeBch`
5 changes: 5 additions & 0 deletions .changeset/tall-actors-sell.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
'@bitauth/libauth': minor
---

Speculatively implement P2S, OP_EVAL, and OP_POW
5 changes: 5 additions & 0 deletions .changeset/ten-crabs-smell.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
'@bitauth/libauth': patch
---

Expand VMB tests for OP_EVAL and loops
5 changes: 5 additions & 0 deletions .changeset/twelve-suns-protect.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
'@bitauth/libauth': patch
---

Refactor BCH VMs for correctness and clarity
5 changes: 5 additions & 0 deletions .changeset/two-peas-give.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
'@bitauth/libauth': minor
---

Rewrite VMB test tooling for parallel and incremental generation, benchmarking
5 changes: 5 additions & 0 deletions .changeset/unlucky-windows-remember.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
'@bitauth/libauth': patch
---

Expand VMB benchmark tests and tooling
5 changes: 5 additions & 0 deletions .changeset/wet-pans-confess.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
'@bitauth/libauth': patch
---

Fix bug in isMinimalDataPush for OP_PUSHBYTES_1
13 changes: 11 additions & 2 deletions .cspell.json
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,6 @@
"authchain",
"authchains",
"authhead",
"BCHCHIPs",
"bchn",
"bchreg",
"bchtest",
Expand All @@ -40,6 +39,7 @@
"cashaddr",
"CASHTOKENS",
"Chaingraph",
"checkbits",
"CHECKDATASIG",
"CHECKDATASIGVERIFY",
"CHECKLOCKTIMEVERIFY",
Expand Down Expand Up @@ -143,18 +143,22 @@
"PUBKEYS",
"PUSHBYTES",
"PUSHDATA",
"pushonly",
"rebranded",
"rebranding",
"redenominated",
"regtest",
"reversebytes",
"ripemd",
"rkalis",
"RSHIFT",
"rustup",
"satoshi",
"satoshis",
"Sats",
"schnorr",
"scriptonly",
"scriptsig",
"seckey",
"secp",
"secp256k1",
Expand All @@ -173,13 +177,16 @@
"substack",
"templating",
"testnet",
"tinybench",
"TOALTSTACK",
"tprv",
"tpub",
"trxhzt",
"tsdoc",
"txid",
"TXINPUTCOUNT",
"TXLOCKTIME",
"txns",
"TXOUTPUTCOUNT",
"TXVERSION",
"typeof",
Expand Down Expand Up @@ -219,7 +226,9 @@
"tsconfig.json",
"node_modules/**",
"src/**/*.base64.ts",
"src/**/script_tests.json"
"src/**/script_tests.json",
"src/lib/vmb-tests/generated",
"src/lib/vmb-tests/bchn/*.json"
],
"patterns": [
{
Expand Down
17 changes: 17 additions & 0 deletions .eslintrc
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
"node_modules",
"build",
"coverage",
"wasm",
"src/lib/schema/ajv/*.js"
],
"extends": ["bitauth"],
Expand Down Expand Up @@ -42,6 +43,22 @@
"functional/immutable-data": "off",
"functional/no-return-void": "off"
}
},
{
"files": ["src/lib/vmb-tests/sources/**.ts"],
"rules": {
"import/no-default-export": "off",
"@typescript-eslint/naming-convention": "off",
"@typescript-eslint/no-magic-numbers": "off",
"@typescript-eslint/no-restricted-imports": [
"error",
{
"patterns": [
{ "allowTypeImports": true, "group": ["../../lib.js"] }
]
}
]
}
}
]
}
21 changes: 19 additions & 2 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -26,15 +26,32 @@ jobs:
CI_NODE_INDEX: ${{ matrix.runner_index }}
CI_NODE_TOTAL: ${{ matrix.runners_per_version }}
- run: yarn cov:lcov
if: ${{ matrix.node-version }} == 20
if: ${{ matrix.node-version == 20 }}
- name: Upload test coverage
if: ${{ matrix.node-version }} == 20
if: ${{ matrix.node-version == 20 }}
uses: codecov/codecov-action@v4
with:
fail_ci_if_error: true
token: ${{ secrets.CODECOV_TOKEN }}
verbose: true

vmb-benchmarks:
runs-on: ubuntu-latest
strategy:
fail-fast: false
name: Run VMB Benchmarks
steps:
- uses: actions/checkout@v4
with:
submodules: 'recursive'
- name: Install Node.js
uses: actions/setup-node@v4
with:
node-version: '20'
- run: yarn install --immutable --immutable-cache
- run: yarn build
- run: yarn bench:vmb_tests

check-policies:
runs-on: ubuntu-latest
name: Check Policies
Expand Down
7 changes: 7 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,13 @@ coverage
report.*.json
scratch
gitignore.*
*.cpuprofile
.aidigestignore
codebase.md
src/lib/vmb-tests/export
src/lib/vmb-tests/generated/.vmb-*
src/lib/vmb-tests/generated/**/*bench.csv
src/lib/vmb-tests/generated/bch_chip_*

src/lib/bin/**/*.html
src/lib/bin/**/*.js
Expand Down
4 changes: 4 additions & 0 deletions .gitmodules
Original file line number Diff line number Diff line change
Expand Up @@ -11,3 +11,7 @@
path = config/eslint-config-bitauth
url = https://github.com/bitauth/eslint-config-bitauth/
shallow = true
[submodule "wasm/bitcoin-cash-node"]
path = wasm/bitcoin-cash-node
url = https://gitlab.com/bitcoin-cash-node/bitcoin-cash-node.git
shallow = true
Loading
Loading