Skip to content

Commit

Permalink
Merge branch 'benchmarks' into next
Browse files Browse the repository at this point in the history
  • Loading branch information
bitjson committed Jul 26, 2024
2 parents ade0151 + 1a03d3f commit a867ff9
Show file tree
Hide file tree
Showing 227 changed files with 53,168 additions and 28,001 deletions.
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/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
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/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/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
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/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
4 changes: 3 additions & 1 deletion .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 @@ -149,6 +149,7 @@
"regtest",
"reversebytes",
"ripemd",
"rkalis",
"RSHIFT",
"rustup",
"satoshi",
Expand All @@ -173,6 +174,7 @@
"substack",
"templating",
"testnet",
"tinybench",
"TOALTSTACK",
"tprv",
"tpub",
Expand Down
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
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ coverage
report.*.json
scratch
gitignore.*
*.cpuprofile

src/lib/bin/**/*.html
src/lib/bin/**/*.js
Expand Down
11 changes: 11 additions & 0 deletions .pnp.cjs

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

75 changes: 74 additions & 1 deletion .vscode/launch.json
Original file line number Diff line number Diff line change
Expand Up @@ -23,8 +23,81 @@
"runtimeExecutable": "yarn",
"runtimeArgs": ["run", "ava"],
"args": ["${file}"],
// "args": ["--serial", "${file}"],
"outputCapture": "std",
"console": "integratedTerminal",
"skipFiles": ["<node_internals>/**"]
},
{
"type": "node",
"request": "launch",
"name": "Debug VMB Test",
"runtimeExecutable": "yarn",
"runtimeArgs": ["run", "test:unit:vmb_test"],
"args": ["${input:vmVersion}", "${input:vmbTestShortId}"],
// "args": ["${input:vmVersion}", "${input:vmbTestShortId}", "-v"],
"outputCapture": "std",
"console": "integratedTerminal",
"skipFiles": ["<node_internals>/**"],
"preLaunchTask": "npm: build"
},
{
"type": "node",
"request": "launch",
"name": "Debug VMB Benchmark",
"runtimeExecutable": "yarn",
"runtimeArgs": ["run", "bench:vmb_tests"],
"env": {
"BENCH_DEBUG_VM": "${input:vmVersion}",
"BENCH_DEBUG_TEST": "${input:vmbTestShortId}",
"BENCH_DEBUG_PROFILE": "${input:collectProfile}"
},
"outputCapture": "std",
"skipFiles": ["<node_internals>/**", "**/node_modules/**"]
"console": "integratedTerminal",
"skipFiles": ["<node_internals>/**"],
"preLaunchTask": "npm: build"
},
{
"type": "node",
"request": "launch",
"name": "Debug VMB Test Generation",
"runtimeExecutable": "yarn",
"runtimeArgs": ["run", "gen:vmb_tests"],
"outputCapture": "std",
"console": "integratedTerminal",
"skipFiles": ["<node_internals>/**"],
"preLaunchTask": "npm: build"
}
],
"inputs": [
{
"id": "vmbTestShortId",
"description": "Please enter a VMB test ID",
"default": "vdqk6",
"type": "promptString"
},
{
"id": "vmVersion",
"description": "Please choose a VM version",
"type": "pickString",
"options": [
"bch_2023_standard",
"bch_2023_nonstandard",
"bch_2025_standard",
"bch_2025_nonstandard",
"bch_2026_standard",
"bch_2026_nonstandard",
"bch_spec_standard",
"bch_spec_nonstandard"
],
"default": "bch_spec_standard"
},
{
"id": "collectProfile",
"description": "Collect a CPU profile?",
"type": "pickString",
"options": ["Yes", "No"],
"default": "Yes"
}
]
}
2 changes: 1 addition & 1 deletion .yarn
34 changes: 17 additions & 17 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -319,7 +319,7 @@ High-level utilities are composed from lower-level utilities which are also expo
- [`isArbitraryDataOutput`](https://libauth.org/functions/isArbitraryDataOutput.html)
- [`isSimpleMultisig`](https://libauth.org/functions/isSimpleMultisig.html)
- [`isStandardOutputBytecode`](https://libauth.org/functions/isStandardOutputBytecode.html)
- [`isStandardOutputBytecode2023`](https://libauth.org/functions/isStandardOutputBytecode2023.html)
- [`isStandardOutputBytecodePre2023`](https://libauth.org/functions/isStandardOutputBytecodePre2023.html)
- [`isStandardMultisig`](https://libauth.org/functions/isStandardMultisig.html)
- [`isWitnessProgram`](https://libauth.org/functions/isWitnessProgram.html)

Expand All @@ -333,26 +333,26 @@ High-level utilities are composed from lower-level utilities which are also expo

#### Built-In VMs

- [`createInstructionSetBCH`](https://libauth.org/functions/createInstructionSetBCH.html)
- [`createInstructionSetBCH2022`](https://libauth.org/functions/createInstructionSetBCH2022.html)
- [`createInstructionSetBCH2023`](https://libauth.org/functions/createInstructionSetBCH2023.html)
- [`createInstructionSetBCHCHIPs`](https://libauth.org/functions/createInstructionSetBCHCHIPs.html)
- [`createInstructionSetXEC`](https://libauth.org/functions/createInstructionSetXEC.html)
- [`createInstructionSetBch`](https://libauth.org/functions/createInstructionSetBch.html)
- [`createInstructionSetBch2023`](https://libauth.org/functions/createInstructionSetBch2023.html)
- [`createInstructionSetBch2025`](https://libauth.org/functions/createInstructionSetBch2025.html)
- [`createInstructionSetBchSpec`](https://libauth.org/functions/createInstructionSetBchSpec.html)
- [`createInstructionSetXec`](https://libauth.org/functions/createInstructionSetXec.html)
- [`createVirtualMachine`](https://libauth.org/functions/createVirtualMachine.html)
- [`createVirtualMachineBCH`](https://libauth.org/functions/createVirtualMachineBCH.html)
- [`createVirtualMachineBCH2022`](https://libauth.org/functions/createVirtualMachineBCH2022.html)
- [`createVirtualMachineBCH2023`](https://libauth.org/functions/createVirtualMachineBCH2023.html)
- [`createVirtualMachineBCHCHIPs`](https://libauth.org/functions/createVirtualMachineBCHCHIPs.html)
- [`createVirtualMachineXEC`](https://libauth.org/functions/createVirtualMachineXEC.html)
- [`createVirtualMachineBch`](https://libauth.org/functions/createVirtualMachineBch.html)
- [`createVirtualMachineBch2023`](https://libauth.org/functions/createVirtualMachineBch2023.html)
- [`createVirtualMachineBch2025`](https://libauth.org/functions/createVirtualMachineBch2025.html)
- [`createVirtualMachineBchSpec`](https://libauth.org/functions/createVirtualMachineBchSpec.html)
- [`createVirtualMachineXec`](https://libauth.org/functions/createVirtualMachineXec.html)

#### Debugging

- [`assembleBytecode`](https://libauth.org/functions/assembleBytecode.html)
- [`assembleBytecodeBCH`](https://libauth.org/functions/assembleBytecodeBCH.html)
- [`assembleBytecodeBTC`](https://libauth.org/functions/assembleBytecodeBTC.html)
- [`disassembleBytecode`](https://libauth.org/functions/disassembleBytecodeBCH.html)
- [`disassembleBytecodeBCH`](https://libauth.org/functions/disassembleBytecodeBCH.html)
- [`disassembleBytecodeBTC`](https://libauth.org/functions/disassembleBytecodeBTC.html)
- [`assembleBytecodeBch`](https://libauth.org/functions/assembleBytecodeBch.html)
- [`assembleBytecodeBtc`](https://libauth.org/functions/assembleBytecodeBtc.html)
- [`disassembleBytecode`](https://libauth.org/functions/disassembleBytecode.html)
- [`disassembleBytecodeBch`](https://libauth.org/functions/disassembleBytecodeBch.html)
- [`disassembleBytecodeBtc`](https://libauth.org/functions/disassembleBytecodeBtc.html)
- [`generateBytecodeMap`](https://libauth.org/functions/generateBytecodeMap.html)
- [`summarizeDebugTrace`](https://libauth.org/functions/summarizeDebugTrace.html)
- [`stringifyDebugTraceSummary`](https://libauth.org/functions/stringifyDebugTraceSummary.html)
Expand Down Expand Up @@ -399,7 +399,7 @@ High-level utilities are composed from lower-level utilities which are also expo
- [`stringifyErrors`](https://libauth.org/functions/stringifyErrors.html)
- [`verifyCashAssemblyEvaluationState`](https://libauth.org/functions/verifyCashAssemblyEvaluationState.html)
- [`walletTemplateToCompilerConfiguration`](https://libauth.org/functions/walletTemplateToCompilerConfiguration.html)
- [`walletTemplateToCompilerBCH`](https://libauth.org/functions/walletTemplateToCompilerBCH.html)
- [`walletTemplateToCompilerBch`](https://libauth.org/functions/walletTemplateToCompilerBch.html)

#### Multi-Party Compilation

Expand Down
1 change: 0 additions & 1 deletion .ava.bench.config.js → config/.ava.bench.config.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
export default {
files: ['build/**/*.bench.js'],
workerThreads: false,
verbose: true,
};
9 changes: 9 additions & 0 deletions config/.ava.vmb_bench.config.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
export default {
files: ['src/lib/vmb-tests/benchmark-bch-vmb-tests.spec.ts'],
typescript: {
compile: false,
rewritePaths: {
'src/': 'build/',
},
},
};
Loading

0 comments on commit a867ff9

Please sign in to comment.