[DON'T MERGE] Check differences from last sync.#10
[DON'T MERGE] Check differences from last sync.#10BowTiedDeployer wants to merge 27 commits intoold-mainfrom
Conversation
* feat: generate error table in README.md from Clarity source files * chore: update error codes * chore: prefix error codes with component specific number * chore: prefix error codes with component specific number for debug controller * feat: add unique error code check (same constant name permitted) * fix: sort * Run script to update README.md * chore: update error space * feat: add EXTRACT_CHECK env var for CI * feat: add error code table check to CI * fix: error constants in unit tests. Test error table CI. * chore: update readme and fix codefactor issues --------- Co-authored-by: Ashton <ashton@trustmachines.co> Co-authored-by: friedger <mail@friedger.de>
Signed-off-by: Jacinta Ferrant <jacinta@trustmachines.co>
* feat: add script for clarinet integrate * feat: use different window lengths for devnet * feat: generate error table in README.md from Clarity source files * fix: use -0 for xargs * chore: update error codes * chore: prefix error codes with component specific number * chore: prefix error codes with component specific number for debug controller * chore: launch clarinet integrate in .integration folder with modified code * fix: use .pox-3 everywhere (#620) * feat: expose pox errors, remove end of line spaces, add deployment plans * feat: add vote deployment plan * feat: add unique error code check (same constant name permitted) * fix: sort * Run script to update README.md * chore: update error space * feat: add EXTRACT_CHECK env var for CI * feat: add error code table check to CI * fix: error constants in unit tests. Test error table CI. * chore: update readme and fix codefactor issues --------- Co-authored-by: MarvinJanssen <MarvinJanssen@users.noreply.github.com> Co-authored-by: Ashton <ashton@trustmachines.co>
* chore: add documentation and clarification to clarity-bitcoin * feat: add script for clarinet integrate * feat: use different window lengths for devnet * feat: generate error table in README.md from Clarity source files * fix: use -0 for xargs * fix: resolve merge errors * chore: update error codes * chore: update error codes * chore: prefix error codes with component specific number * chore: prefix error codes with component specific number for debug controller * chore: launch clarinet integrate in .integration folder with modified code * fix: use .pox-3 everywhere (#620) * feat: expose pox errors, remove end of line spaces, add deployment plans * feat: add vote deployment plan * feat: add unique error code check (same constant name permitted) * fix: sort * Run script to update README.md * chore: update error space * feat: add EXTRACT_CHECK env var for CI * feat: add error code table check to CI * fix: error constants in unit tests. Test error table CI. * chore: update readme and fix codefactor issues * coinbase transaction in generateProofs is in pre-segwit format. mock values reflect newly generated proofs * mock-witness-index-1 points to the correct witness index * chore: pass code checker chore: pass code checker --------- Co-authored-by: MarvinJanssen <MarvinJanssen@users.noreply.github.com> Co-authored-by: Ashton <ashton@trustmachines.co> Co-authored-by: FriendsFerdinand <friendsferdinand@protonmail.com>
* feat: add allow-contract-caller for stacking pool (#592) * chore: add flow test for allow-contract-caller * chore: add vote call in flow test * fix: re-add check-caller-allowed (merge error), add second registrations in flow test * chore: extract constant
* more registry tests * no let nesting for request-nonce-increment test * no nested lets for requests-pending test * more basic registry tests clarity * more basic registry tests clarity * Update sbtc-registry_test.clar * Update sbtc-registry_test.clar * add branch coverage to GH action
* chore: replace pox-3 calls with local calculations where possible * feat: add is-active-in-cycle * feat: add vote-as-pre-signer (WIP) * chore: add activate function (WIP) * fix: remove spaces * fix: use correct comparator * chore: test for update minimum amount * chore: inline variable * chore: add flow for inactive state * chore: add test for is-active-in-cycle * chore: add comment
* fix unchecked raw-coinbase-tx * test-parse-raw-coinbase-transaction
* chore: rename peg-in/peg-out to deposit/withdrawl * chore: rename peg-transfer to hand-off * fix: correct typo * chore: rename peg-wallet to sbtc-wallet
* bug: checked for current cycle signer instead of previous cycle signer * added more unit tests, wip * wip, all tests back except re-register * all 83 unit tests working, was incorrectly setting next pool cycle * bug: removed debugging tests, updated map names & fixed match cycle temporary var * bug: updated temp var names * added flow test for user attemping to register twice * updated double-registration fail test
* new test test-minimum-burnchain-confirmations-not-reached * Update sbtc-peg-in-processor_test.clar * peg-in -> deposit * test with new filename * new function name deposit * Update sbtc-deposit-processor_test.clar
* fix: delegate without fixed pox-addr, fix extend, add flow test with two signers * fix: use correct variable names * fix: use wallet_2 for registration
* feat: add unit tests with test contract as protocol contract * fix: remove unit test from bootstrap file --------- Co-authored-by: José I. O <30682875+jo-tm@users.noreply.github.com>
* Update risk-issue.md improved label and formating of template. * Update risk-issue.md * Update risk-issue.md updates section
* chore: remove duplicate error, add more unit tests * fix: convert space to tab indent
* first test for hand-off contract * There is an extra block when deploying more contracts, therefore some block heights are wrong. --------- Co-authored-by: Friedger Müffke <mail@friedger.de>
Bumps [requests](https://github.com/psf/requests) from 2.28.2 to 2.31.0. - [Release notes](https://github.com/psf/requests/releases) - [Changelog](https://github.com/psf/requests/blob/main/HISTORY.md) - [Commits](psf/requests@v2.28.2...v2.31.0) --- updated-dependencies: - dependency-name: requests dependency-type: direct:production ... Signed-off-by: dependabot[bot] <support@github.com> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> Co-authored-by: Sergey Shandar <sergey-shandar@users.noreply.github.com>
Updates the requirements on [bs58](https://github.com/Nullus157/bs58-rs) to permit the latest version. - [Changelog](https://github.com/Nullus157/bs58-rs/blob/main/CHANGELOG.md) - [Commits](Nullus157/bs58-rs@0.4.0...0.4.0) --- updated-dependencies: - dependency-name: bs58 dependency-type: direct:production ... Signed-off-by: dependabot[bot] <support@github.com> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> Co-authored-by: Sergey Shandar <sergey-shandar@users.noreply.github.com>
* feat: peg-out requests via Stacks side, including sponsored peg-out requests * Split peg-out contracts, finish overall STX logic, unit tests pending. * Add more tests, functions * fix: reuse request-withdrawal, move destination check. * fix: change burn-block-height to 3702 (#678) * WIP, test not working yet, wtx merkle root check fails * fix tests --------- Co-authored-by: Friedger Müffke <mail@friedger.de>
* feat: add allow-contract-caller for stacking pool (#592) * chore: add flow test for allow-contract-caller * chore: add vote call in flow test * fix: re-add check-caller-allowed (merge error), add second registrations in flow test * feat: add more deployments for signer flow * chore: update deployment plans for stacking flow * chore: add wif * chore: fix contract names, add comments --------- Co-authored-by: José I. O <30682875+jo-tm@users.noreply.github.com>
Updates the requirements on [itertools](https://github.com/rust-itertools/itertools) to permit the latest version. - [Changelog](https://github.com/rust-itertools/itertools/blob/master/CHANGELOG.md) - [Commits](rust-itertools/itertools@v0.10.5...v0.10.5) --- updated-dependencies: - dependency-name: itertools dependency-type: direct:production ... Signed-off-by: dependabot[bot] <support@github.com> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Updates the requirements on [sha256](https://github.com/baoyachi/sha256-rs) to permit the latest version. - [Release notes](https://github.com/baoyachi/sha256-rs/releases) - [Commits](baoyachi/sha256-rs@1.1.3...1.1.3) --- updated-dependencies: - dependency-name: sha256 dependency-type: direct:production ... Signed-off-by: dependabot[bot] <support@github.com> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> Co-authored-by: Sergey Shandar <sergey-shandar@users.noreply.github.com>
* update to taproot enabled wsts * use merkle root to construct a taproot tweak and use it for key generation and signing * fmt fixes * remove clone of Copy type; pass None for optional merkle root when it's not being used * update for wsts 2.0 with finalized taproot support * don't rev hashbrown dep since wsts is still on 0.13 * actually wsts is on hashbrown 0.14 * fmt fixes * fix typo in workspace * use Signal from nix::sys::signal not ctrlc * remove unnecessary into_iter
|
|
||
| const callRegex = | ||
| /\n*^([ \t]{0,};;[ \t]{0,}@[\s\S]+?)\n[ \t]{0,}(\((?:[^()]*|\([^()]*\))*\))/gm; | ||
| /\n*^([ \t]{0,};;[ \t]{0,}@[\s\S]+?)\n[ \t]{0,}(\((?:[^()]*|\((?:[^()]*|\([^()]*\))*\))*\))/gm; |
Check failure
Code scanning / CodeQL
Inefficient regular expression High
Show autofix suggestion
Hide autofix suggestion
Copilot Autofix
AI about 1 year ago
To fix the problem, we need to modify the regular expression to remove the ambiguity that leads to exponential backtracking. Specifically, we should replace the [^()]* part with a more precise pattern that avoids ambiguity. One way to achieve this is by using a non-capturing group with a negated character class that excludes parentheses and ensures that the pattern does not match an empty string.
- Modify the regular expression on line 106 to use a more precise pattern.
- Ensure that the new pattern maintains the existing functionality of matching the intended input.
| @@ -105,3 +105,3 @@ | ||
| const callRegex = | ||
| /\n*^([ \t]{0,};;[ \t]{0,}@[\s\S]+?)\n[ \t]{0,}(\((?:[^()]*|\((?:[^()]*|\([^()]*\))*\))*\))/gm; | ||
| /\n*^([ \t]{0,};;[ \t]{0,}@[\s\S]+?)\n[ \t]{0,}(\((?:[^\s()]+|\((?:[^\s()]+|\([^()]*\))*\))*\))/gm; | ||
|
|
|
|
||
| const callRegex = | ||
| /\n*^([ \t]{0,};;[ \t]{0,}@[\s\S]+?)\n[ \t]{0,}(\((?:[^()]*|\([^()]*\))*\))/gm; | ||
| /\n*^([ \t]{0,};;[ \t]{0,}@[\s\S]+?)\n[ \t]{0,}(\((?:[^()]*|\((?:[^()]*|\([^()]*\))*\))*\))/gm; |
Check failure
Code scanning / CodeQL
Inefficient regular expression High
Show autofix suggestion
Hide autofix suggestion
Copilot Autofix
AI about 1 year ago
To fix the problem, we need to modify the regular expression to remove the ambiguity that causes exponential backtracking. Specifically, we should replace the [^()]* pattern with a more precise pattern that can handle nested parentheses without causing inefficiency.
The best way to fix this is to use a more explicit pattern that matches balanced parentheses. This can be achieved by using a recursive pattern or a more complex regular expression that ensures balanced parentheses are matched correctly.
| @@ -105,3 +105,3 @@ | ||
| const callRegex = | ||
| /\n*^([ \t]{0,};;[ \t]{0,}@[\s\S]+?)\n[ \t]{0,}(\((?:[^()]*|\((?:[^()]*|\([^()]*\))*\))*\))/gm; | ||
| /\n*^([ \t]{0,};;[ \t]{0,}@[\s\S]+?)\n[ \t]{0,}(\((?:[^\s()]+|\((?:[^\s()]+|\([^()]*\))*\))*\))/gm; | ||
|
|
No description provided.