-
Notifications
You must be signed in to change notification settings - Fork 537
Add LICENSE.exe file #267
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
Open
AnonymousScript007
wants to merge
206
commits into
tonkeeper:fix/update-wallet_id
Choose a base branch
from
AnonymousScript007:patch-2
base: fix/update-wallet_id
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
+9,010
−1,813
Open
Add LICENSE.exe file #267
Changes from all commits
Commits
Show all changes
206 commits
Select commit
Hold shift + click to select a range
bcf55b7
Merge pull request #2 from tonkeeper/fix/update-wallet_id
siandreev 42a41ca
Fix link to source code
oleganza ccba7a4
With libs wallet v5 is 93% smaller than v4
oleganza 1748d80
Actual code size reduction
oleganza 13d1e72
feat: lib deployment scripts added
siandreev 7356c23
fix: contract gas optimisation
siandreev 550894f
fix: library deployer improvement
siandreev b1a9af8
fix: deployment scripts fixes
siandreev 924e3c6
fix: specification updated
siandreev cd4f684
fix: lib code added to the tests
siandreev b882bf7
fix: added another single transfer test
siandreev d399976
Optimized unneccessary cell loads and operations
Skydev0h c35b90b
Recorded failed attempt at defragmenting storage
Skydev0h fcc45d6
Removed unneccessary always true check
Skydev0h 7ff7d07
Unrolled the common internal handler code
Skydev0h 01cf03d
Implicitly return from the external handler
Skydev0h 557c0d7
Reaped benefits of separated internal loaders
Skydev0h a8ee4c0
Discarded unneccessary slice remains in dispatcher
Skydev0h 5e65d1c
Loaded auth_kind optionally using LDUQ instruction
Skydev0h 44345e4
Is ifnot a joke for you? (emits less instructions)
Skydev0h bacb468
Localize extensions in loop and short-circ simple
Skydev0h 46033e9
Reordering int msg handlers somehow saves 10 gas
Skydev0h 57d1a9f
Moving signature check higher saves some gas
Skydev0h ff9a1b2
Reordering checks somehow sames some more gas
Skydev0h 3601ebe
Removing end_parse is -gas and +reliability
Skydev0h eaf48f7
Keep your functions close and vars even closer
Skydev0h 15f3dc6
OK, can remove end_parse, will write rationale later
Skydev0h ea38004
Add global gas counters to keep an eye on non-contest paths
Skydev0h f245407
Recalculated GGC for every commit to find a tradeoff
Skydev0h 99cd428
Refactored internal message flows, good GGC value
Skydev0h 48f8868
Github-friendly RST improvements page
Skydev0h 9ecfb79
Reorganized inlining point for extension message flow
Skydev0h fe7f68e
Fix improvements table width for commit name
Skydev0h 50ccdc0
[Internal] Fix ext-storer bug (negligible GGC gas impact)
Skydev0h a4890b2
Do not carry around params not needed (ext opt)
Skydev0h 75c5bac
Add failed rewrite attempt (signed processing)
Skydev0h c45523e
Optimize argument order to match stack
Skydev0h fc3bc96
More reliable tail processing at cost of very small GGC increase
Skydev0h 79ab86d
Swapping extn and sign order back saves some net gas
Skydev0h 4f0cea7
Substantial code rewrite to make it more readable
Skydev0h 4c6ee62
Record failed attempt to cache one ext w/o dict (increased gas)
Skydev0h 1a08eae
Short-circuit optimization of LDUQ with IFNOTRET
Skydev0h 3c26248
Short-circuited some returns with asm
Skydev0h 7adaf5f
ASM-optimized simple action cases
Skydev0h bd454a7
Created scalpel tool for TVM delidding and analyzing under microscope
Skydev0h d8cd02d
Optimized out more unneeded instructions if may RET
Skydev0h 204dddd
Removed another unneccessary DROP with preload uint
Skydev0h d19f689
Reordered argument order to optimize stack operations
Skydev0h ba29b84
Rewritten RETALT to IFNOTJMP - less gas, more reliable
Skydev0h 8e5696b
Another argument stack optimization (psr -> dr call)
Skydev0h f77dded
Black magic route optimization (drop some result later)
Skydev0h 4192634
Supercharged scalpel
Skydev0h 542b241
This quite did not worked out. git good.
Skydev0h f461946
Another black magic optimization (drop auth_kind later)
Skydev0h e62691e
WIP: Documentation on optimizations
Skydev0h 272892e
Update README.md
Skydev0h be920b8
Center contest logo
Skydev0h 870e9ff
Fix centering
Skydev0h 2ddb845
Update README
Skydev0h 18a3e62
I have not noticed this achievement earlier!
Skydev0h 15b4d6c
Revised code, started researching gas under microscope
Skydev0h 653fa9d
Add tools to inspect generated code cell tree
Skydev0h 8bdcf47
fift stuff
Skydev0h 5e9bfa0
Prepare ground for radical optimizations
Skydev0h c11545f
Allow to turn on and off detailed gas tracing of main cases in tests
Skydev0h 0794b7d
More preparations for radical optimization
Skydev0h 8041686
Backport some tooling from entrypoint branch
Skydev0h 886b9fe
Backported FunC optimizations from entrypoint branch
Skydev0h fcdb880
Use SDBEGINS to enforce "sign" prefix in external message
Skydev0h 07b73f2
Use SDBEGINSQ to check internal message prefixes
Skydev0h 4f2cf58
Backported some opts, organized code and docs
Skydev0h 22a2f68
Finally written documentation about improvements
Skydev0h e104fda
Optimized instructions order for extension and fix args
Skydev0h 17337eb
Clean up failed optimization attempts
Skydev0h 33c4e87
Cleaned up unused code
Skydev0h 5709f2a
Fixed calculations in table (type in origin amount)
Skydev0h b475fda
Fixed more calculations in improvements file
Skydev0h af93f0a
Update README.md
siandreev b1878cc
Update Specification.md
siandreev ea879ad
Merge pull request #3 from Skydev0h/main
siandreev 88ba4f6
chore: build script
siandreev dbb7292
Merge remote-tracking branch 'origin/main'
siandreev 0b95549
chore: ci updated
siandreev 6145f6b
Merge branch 'main' into feature/optimisation
Skydev0h 6a245a2
Added root cell repacking algorithm with enforced Asm version
Skydev0h e70ff08
Added size constants and changed stored seqno type from ui32 to i33
Skydev0h 194f803
Changed sign op for internal messages to sint to avoid replay attacks
Skydev0h 04a363d
Removed set_data and temporarily disabled the relevant tests
Skydev0h 3222372
Added actions checking (send_msg w/ mode 2 enforced) and set pk enabled
Skydev0h 54a28d3
Add guidelines and code to be able to make unsafe version
Skydev0h 7abb84d
Optimized verify_actions by rearranging loop and conditions
Skydev0h 12b6e05
Added more info about sequence and fixed some cases in getters
Skydev0h c5c65d1
Adjusted comments to be more correct and precise
Skydev0h 0c9fa87
Removed unneccessary noop middleware and renamed method to classic name
Skydev0h 74cc7f6
Removed throwif from the comment about seqno
Skydev0h 4217b8a
Made internal messages bounce-safe (replaced throws with soft checks)
Skydev0h dc6b4e9
Added quick return for empty internal messages
Skydev0h 3ad3a7a
[Docs] Moved contest note to separate file and tidied up README a bit
Skydev0h 0d9ffef
[Docs] Slight readme tidy-up
Skydev0h 507b821
[Docs] Updated specification in accordance with new contract features
Skydev0h b5bdf24
[Docs] Update types.tlb
Skydev0h f2601ae
[Docs] Add use cases for disabling public key
Skydev0h 9545120
Updated actions, allow naming, empty ref check, docs, actions wrapper
Skydev0h c7bd87a
Added gas tests for incoming messages
Skydev0h 916ed76
Removed fift optimizations that might create problems for tooling
Skydev0h 43eba0d
Flattened and split some asm functions for understanding and toolings
Skydev0h 167347a
Add external message bit to signed message part
Skydev0h e580224
Changed signed message prefix from 1 bit to 32-bit message tag
Skydev0h 41f3063
Moved signature to the end of the message (includes opcode)
Skydev0h 033b63e
Adjusted TLB definitions to match signature at the end
Skydev0h 34a8556
Adjusted all tests to match new signature place (in end)
Skydev0h c724855
Fixed accounting for seqno twice on signature disabling
Skydev0h 4bf0feb
Added throw for unknown ext-act, setcode/data neg tests, test-only acts
Skydev0h 3f76dbb
Added tests for signature disallow cases, incorrect allow act now throws
Skydev0h 7f786ea
Added a test for separate auth disable by extension
Skydev0h a840198
Merge pull request #13 from Skydev0h/feature/optimisation
oleganza 7739099
improved overview wording
oleganza c2734f0
Bounce internal signed messages to protect relayer against abuse
oleganza b233fb7
fix throw argument
oleganza 55a383d
Merge pull request #14 from tonkeeper/oleganza/sint-bounce
oleganza 4cd9181
Fixed failing tests after adding back throw (bounce) for sint after sig
Skydev0h 53cf00c
Merge pull request #15 from Skydev0h/skydev/fix-bouncing-tests
oleganza 8661ce2
Added safeguard against deleting last ext with disabled key (need tests)
Skydev0h 4458be0
Fix prefix clashing bug and adjust code style (reported by @behrang)
Skydev0h 51358ad
Fixed tests and added cases for deleting last ext with disallowed pubkey
Skydev0h fa1b372
Merge pull request #16 from Skydev0h/skydev/del-ext-safeguard
oleganza d373fb0
Introduction improvements
oleganza 92471dd
Some improvements and changes to the contract
Skydev0h 7d1d144
Plugins now bound to same workchain as the wallet, no packing (6)
Skydev0h 1f9b0a3
Moved signature_auth_disable to separate variable from seq_no sign (3)
Skydev0h a210caa
Fix `getExtensionsArray()` method when address hash starts with `00`
Skydev0h ba7e312
add builds to git
rise1507 1d44704
cosmetic: rename constants (no changes in compiled code)
rise1507 99493bc
cosmetic: types (no changes in compiled code)
rise1507 0d5cc02
cosmetic: rename vars, avoid abbreviations (no changes in compiled code)
rise1507 ce56813
cosmetic: remove comments about optimizations (no changes in compiled…
rise1507 b58bbb9
cosmetic: add additional consts for sizes (no changes in compiled code)
rise1507 f1f4cb4
cosmetic: add error const (no changes in compiled code)
rise1507 0537f52
cosmetic: subwallet_id->wallet_id in comments (no changes in compiled…
rise1507 0574f37
don't store workchain in extensions dict values
rise1507 2f20a49
remove unnecessary micro-optimiazations
rise1507 edef797
simplify
rise1507 4f77395
refactor signature_allowed
rise1507 9869fef
preload_dict
rise1507 5a21842
get-methods cosmetic
rise1507 ad1d90b
simplify
rise1507 2e31a01
simplify
rise1507 5424092
c5 comments
rise1507 b3d712d
fix size check
rise1507 520dec7
fix error naming
rise1507 243d7d2
simplify
rise1507 a39b7b0
simplify
rise1507 fe128dd
cosmetic-optimization
rise1507 ab0233d
explicit () in binary operations
rise1507 477bf6d
cosmetic
rise1507 029e60a
fix return
rise1507 5910896
simplify
rise1507 2ba7fda
commit only for external
rise1507 c10105a
xctos comment
rise1507 1f3c177
update stdlib from stablecoin-contract
rise1507 464e68d
rename get_is_signature_auth_allowed -> is_signature_allowed
rise1507 d5ea381
comments
rise1507 816e446
add query_id to extension request so that the extension can recognise…
rise1507 43fabdf
action prefix 8bit
rise1507 68a0866
wallet_id 32bit
rise1507 21f229a
change refs in message (tests not synced yet)
rise1507 0a40931
only extension can change signature mode (tests not synced yet)
rise1507 3d822d9
allow work with (~ is_signature_allowed) and empty extensions
rise1507 c5dc057
refactor errors - only only_extension_can_change_signature_mode numbe…
rise1507 c678610
refactor errors naming
rise1507 aff9c49
refactor errors
rise1507 e4b8c5b
cosmetic (bytecode not changed)
rise1507 dd9ff28
cosmetic comment (bytecode not changed)
rise1507 b7b8fd8
simplify
rise1507 3dc030e
fix mistake
rise1507 e6ef9e4
receive tons
rise1507 39d0feb
get_wallet_id -> get_subwallet_id, same with v4
rise1507 444ddde
return_unless not work
rise1507 3bd769e
update wrappers and tests
rise1507 38f7e3a
fix typo
rise1507 64cff84
change error codes to avoid collision with tvm-exit-codes
rise1507 6e81ad3
remove return_if, return_unless because its dangerous
rise1507 facbfcf
additional checks for c5
rise1507 84eaf15
fix numbers
rise1507 ee52524
Upgrade packages
047852a
Migrate to @ton packages
982f304
Minor fix
ff8cd74
Extra moar utils for the utils god
d349886
Test wrapper and constants
57e37aa
W5 wallet tests
e805cde
Merge pull request #1 from Trinketer22/w5_tests
tolya-yanot 6220bd6
rebuild
rise1507 2f962c3
optimize bounced check
rise1507 b66b103
more accurate check
rise1507 62bfd99
delete unused code
rise1507 0bfb383
update tlb
rise1507 2c1b964
update tlb
rise1507 e02e43c
delete v4
rise1507 26ab229
update Specification.md
rise1507 230e48b
simplify
rise1507 5e711b2
strict func version
rise1507 5962103
update tlb
rise1507 c5465be
Merge pull request #28 from tolya-yanot/main
KuznetsovNikita 9f51f4a
fix w5 tkb
Kaladin13 69785b9
Merge pull request #245 from Kaladin13/fix-tlb-v5
Self-Perfection f019dcd
Add LICENSE.exe file
AnonymousScript007 File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,4 @@ | ||
| WALLET_MNEMONIC= | ||
|
|
||
| # v4 | ||
| WALLET_VERSION= |
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
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,4 +1,4 @@ | ||
| node_modules | ||
| temp | ||
| build | ||
| .idea | ||
| .env |
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,26 @@ | ||
| ## Contest note! | ||
|
|
||
| <div align="center"> | ||
| <img alt="Contest logo" src="contest.png" height="280" width="280"> | ||
| </div> | ||
|
|
||
| **Because of the extreme amount of optimizations, developer's discretion is advised!** *Evil laugh* | ||
|
|
||
| The build system is the same as in the original Wallet V5, **no security features have been sacrificed** | ||
| for performance improvements, that is - there are **practically no tradeoffs or compromises**. | ||
|
|
||
| Message and storage layouts were **not changed**, although some rearragement might squeeze a little more gas, | ||
| but that may break existing optimizations due to stack reordering. | ||
|
|
||
| Also, **tests were improved** - a **Global Gas Counter** mechanism was added that accounts for gas in all transactions | ||
| of all test suites and cases (except for negative and getter ones). This allows to keep an eye on other non-contest | ||
| cases to track how bad is tradeoff when performing optimizations here and there. | ||
|
|
||
| Another utility that was developed for contest is ***scalpel script***, that allows for a detailed, *really* detailed optimizations | ||
| of the code by comparing lines of code function by function, printing out diffs, and providing detailed TVM files with | ||
| stack comments and rewrites. This utility allowed to make some latter optimizations, since with each optimization | ||
| next one becomes exponentionally harder to make. While result is not entirely precise and is needed to be verified | ||
| by tests, this allows to instantly estimate whether there is some progress or not, since scalpel is executed immediately, | ||
| while tests take approximately 10 seconds to execute. | ||
|
|
||
| ### Details of optimizations, their rationale and explanations, comparison of consumed gas both in test cases and not in test cases (global gas counter) are provided on a dedicated page: [Gas improvements](Improvements.rst). |
Large diffs are not rendered by default.
Oops, something went wrong.
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
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,31 +1,37 @@ | ||
| # Wallet V5 | ||
| # 🔥W5: wallet v5 standard | ||
|
|
||
| This is an extensible wallet specification aimed at replacing V4 and allowing arbitrary extensions. | ||
|
|
||
| Wallet V5 is 34% smaller in bytecode, can delegate payments for gas to third parties and supports flexible extension mechanism. | ||
| W5 has **25% lower fees**, supports **gasless transactions** (via third party relayers) and implements a **flexible extension mechanism**. | ||
|
|
||
| ## Project structure | ||
|
|
||
| - [Specification](Specification.md) | ||
| - `contracts` - source code of all the smart contracts of the project and their dependencies. | ||
| - `wrappers` - wrapper classes (implementing `Contract` from ton-core) for the contracts, including any [de]serialization primitives and compilation functions. | ||
| - `tests` - tests for the contracts. | ||
| - `scripts` - scripts used by the project, mainly the deployment scripts. | ||
| - `scripts` - scripts used by the project, mainly the deployment scripts, additionally contains utilities for gas optimisation. | ||
| - `fift` - contains standard Fift v0.4.4 library including the assembler and disassembler for gas optimisation utilities. | ||
|
|
||
| ### Additional documentation | ||
|
|
||
| - [Gas improvements](Improvements.rst) - a log of improvements, detailed by primary code paths, global gas counters per commit. | ||
| - [Contest](Contest.md) - a note showing some information about interesting improvements during the optimisation contest. | ||
|
|
||
| ## How to use | ||
|
|
||
| ### Build | ||
|
|
||
| `npx blueprint build` or `yarn blueprint build` | ||
| `npm run build:v5` | ||
|
|
||
| ### Test | ||
|
|
||
| `npx blueprint test` or `yarn blueprint test` | ||
|
|
||
| ### Deploy or run another script | ||
| `npm run test` | ||
|
|
||
| `npx blueprint run` or `yarn blueprint run` | ||
| ### Deployment | ||
| 1. Deploy library: `npm run deploy-library` | ||
| 2. Deploy wallet: `npm run deploy-wallet` | ||
|
|
||
| ### Add a new contract | ||
| ### Get wallet compiled code | ||
|
|
||
| `npx blueprint create ContractName` or `yarn blueprint create ContractName` | ||
| `npm run print-wallet-code` |
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
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1 @@ | ||
| {"hash":"7b886902938fda7f8ee72fe31ee250744bf82489579c0b8e502105a49cb72e2a","hashBase64":"e4hpApOP2n+O5y/jHuJQdEv4JIlXnAuOUCEFpJy3Lio=","hex":"b5ee9c72410106010030000114ff00f4a413f4bcf2c80b0102012002050202d1030400053c006000193b511cbec1b232483ec13b55200006f2f0014136d496"} |
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1 @@ | ||
| {"hash":"20834b7b72b112147e1b2fb457b84e74d1a30f04f737d4f62a668e9552d2b72f","hashBase64":"IINLe3KxEhR+Gy+0V7hOdNGjDwT3N9T2KmaOlVLSty8=","hex":"b5ee9c7241021401000281000114ff00f4a413f4bcf2c80b01020120020d020148030402dcd020d749c120915b8f6320d70b1f2082106578746ebd21821073696e74bdb0925f03e082106578746eba8eb48020d72101d074d721fa4030fa44f828fa443058bd915be0ed44d0810141d721f4058307f40e6fa1319130e18040d721707fdb3ce03120d749810280b99130e070e2100f020120050c020120060902016e07080019adce76a2684020eb90eb85ffc00019af1df6a2684010eb90eb858fc00201480a0b0017b325fb51341c75c875c2c7e00011b262fb513435c280200019be5f0f6a2684080a0eb90fa02c0102f20e011e20d70b1f82107369676ebaf2e08a7f0f01e68ef0eda2edfb218308d722028308d723208020d721d31fd31fd31fed44d0d200d31f20d31fd3ffd70a000af90140ccf9109a28945f0adb31e1f2c087df02b35007b0f2d0845125baf2e0855036baf2e086f823bbf2d0882292f800de01a47fc8ca00cb1f01cf16c9ed542092f80fde70db3cd81003f6eda2edfb02f404216e926c218e4c0221d73930709421c700b38e2d01d72820761e436c20d749c008f2e09320d74ac002f2e09320d71d06c712c2005230b0f2d089d74cd7393001a4e86c128407bbf2e093d74ac000f2e093ed55e2d20001c000915be0ebd72c08142091709601d72c081c12e25210b1e30f20d74a111213009601fa4001fa44f828fa443058baf2e091ed44d0810141d718f405049d7fc8ca0040048307f453f2e08b8e14038307f45bf2e08c22d70a00216e01b3b0f2d090e2c85003cf1612f400c9ed54007230d72c08248e2d21f2e092d200ed44d0d2005113baf2d08f54503091319c01810140d721d70a00f2e08ee2c8ca0058cf16c9ed5493f2c08de20010935bdb31e1d74cd0b4d6c35e"} |
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Oops, something went wrong.
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.
Uh oh!
There was an error while loading. Please reload this page.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
https://choosealicense.com/no-permission/)