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

Memory metering #1653

Merged
merged 405 commits into from
May 16, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
405 commits
Select commit Hold shift + click to select a range
a6907a9
Merge pull request #1509 from onflow/supun/memory-metering
SupunS Mar 16, 2022
2506e30
Merge pull request #1507 from onflow/remove-memorykind-block
dsainati1 Mar 16, 2022
9277202
Bump onflow/atree from 0.2.0 to 0.3.0
fxamacker Mar 16, 2022
2e995e2
Merge pull request #1510 from onflow/supun/bump-atree-version
SupunS Mar 16, 2022
14c9211
Memory metering for small types (#1442)
robert-e-davidson3 Mar 17, 2022
b23d45b
Robert/metering small types 2 (#1512)
robert-e-davidson3 Mar 17, 2022
63338ca
Meter address value before creation, whenever possible
SupunS Mar 17, 2022
6e9fd12
atree string value metering
dsainati1 Mar 18, 2022
465e251
fix lint
dsainati1 Mar 18, 2022
e0ed81d
Merge pull request #1513 from onflow/supun/mem-metering-refactor
SupunS Mar 18, 2022
6a06a9e
add 1 to decoded string values
dsainati1 Mar 18, 2022
fc89125
Add memory metering for fixed-size numbers
SupunS Mar 17, 2022
8b483dd
Add fized-size number metering tests
SupunS Mar 21, 2022
7bdcb9b
Refactor tests
SupunS Mar 21, 2022
e8112c7
Fix ufix/fix metering when constructed as supertype (FixedPoint)
SupunS Mar 21, 2022
22b6d5f
Refactor fix/ufix converters
SupunS Mar 21, 2022
21c6daa
meter path ids as raw strings instead of strings
dsainati1 Mar 21, 2022
032cbfc
Merge branch 'feature/memory-metering' of github.com:onflow/cadence i…
dsainati1 Mar 21, 2022
1eca9ad
fix test
dsainati1 Mar 21, 2022
a1f3984
Check address length before decoding
SupunS Mar 21, 2022
b669fa3
Refactor fix64/ufix64 converters
SupunS Mar 21, 2022
ca330df
Merge pull request #1514 from onflow/atreestringvalue-metering
dsainati1 Mar 21, 2022
8010734
Merge branch 'feature/memory-metering' of https://github.com/onflow/c…
SupunS Mar 22, 2022
6103342
Merge pull request #1522 from onflow/supun/mem-metering-refactor
SupunS Mar 23, 2022
682e900
memory metering for variables
dsainati1 Mar 24, 2022
3e402d0
fix test
dsainati1 Mar 24, 2022
4faabfd
Apply suggestions from code review
dsainati1 Mar 24, 2022
72b4c0a
add more tests
dsainati1 Mar 24, 2022
5fdd0da
add constructors and memorykinds for locations
dsainati1 Mar 24, 2022
444e2ab
address location metering
dsainati1 Mar 24, 2022
ddbd291
meter string locations
dsainati1 Mar 24, 2022
780f535
refactor from code review
dsainati1 Mar 24, 2022
332dbd1
Merge pull request #1531 from onflow/variable-metering
dsainati1 Mar 24, 2022
3b90a53
Merge branch 'feature/memory-metering' of https://github.com/onflow/c…
SupunS Mar 24, 2022
8e5492b
Merge pull request #1521 from onflow/supun/fixed-numbers-metering
SupunS Mar 24, 2022
fb9ce86
Meter results of logical operations on number values (#1526)
SupunS Mar 24, 2022
1f4f06e
Meter tokens
SupunS Mar 24, 2022
8e1ab15
Merge branch 'feature/memory-metering' of https://github.com/onflow/c…
SupunS Mar 24, 2022
fb39941
Refactor code
SupunS Mar 24, 2022
faf6fac
Fix tests
SupunS Mar 25, 2022
ca9d62c
Merge branch 'feature/memory-metering' of github.com:onflow/cadence i…
dsainati1 Mar 25, 2022
010f40c
update test
dsainati1 Mar 25, 2022
5d1f56e
fix compile
dsainati1 Mar 25, 2022
d6be34c
add test for stringlocation
dsainati1 Mar 25, 2022
48933a9
meter transaction and script locations in decoding
dsainati1 Mar 25, 2022
690e6bf
add test for address location
dsainati1 Mar 25, 2022
6ca43c7
fix lint
dsainati1 Mar 25, 2022
389807e
Merge pull request #1533 from onflow/supun/meter-tokens
SupunS Mar 28, 2022
f2790aa
Meter identifiers
SupunS Mar 25, 2022
b168423
Add identifier metering tests
SupunS Mar 25, 2022
271d72b
Meter identifiers created in member resolvers
SupunS Mar 25, 2022
bc3936e
Generate memorykind stringer
SupunS Mar 28, 2022
c45ec30
Meter arguments
SupunS Mar 28, 2022
d3ead52
Meter blocks
SupunS Mar 28, 2022
c092219
Meter composite and interface declarations
SupunS Mar 28, 2022
84ad3a0
Meter enum-cases and field declarations
SupunS Mar 28, 2022
d3f81fd
Meter function and transaction declarations
SupunS Mar 28, 2022
f0361a2
Meter import declarations
SupunS Mar 28, 2022
f19bd93
Meter variable declarations
SupunS Mar 28, 2022
84357fb
Meter special funcs and pragma declarations
SupunS Mar 28, 2022
d7ac025
Fix event decl initializer
SupunS Mar 28, 2022
79e6f2d
Add metering for assignment, return, break and continue statements
SupunS Mar 28, 2022
c8cee47
Meter For, If, Emit and Expression statements
SupunS Mar 28, 2022
5ad5c3c
Meter while, swap and switch statements
SupunS Mar 29, 2022
5579638
Merge branch 'feature/memory-metering' of github.com:onflow/cadence i…
dsainati1 Mar 29, 2022
8b09188
respond to review
dsainati1 Mar 30, 2022
6c64efb
Add AST statement metering tests
SupunS Mar 30, 2022
8853dd4
Refactor code
SupunS Mar 31, 2022
905c579
meter container types (arrays, dictionaries, composites) based on length
dsainati1 Mar 31, 2022
1b6ff67
use decodeAddressBytes
dsainati1 Mar 31, 2022
6e1c7d9
additionally meter append and insert operations on containers
dsainati1 Mar 31, 2022
afb5985
Merge pull request #1535 from onflow/location-metering
dsainati1 Mar 31, 2022
f30e47b
Merge branch 'feature/memory-metering' of github.com:onflow/cadence i…
dsainati1 Mar 31, 2022
e9a1dc4
Merge branch 'feature/memory-metering' of https://github.com/onflow/c…
SupunS Apr 1, 2022
008bce0
Meter boolean, nil, and string expressions
SupunS Apr 1, 2022
efb8a90
Meter numeric expressions
SupunS Apr 1, 2022
6ad568a
Meter array, dictionary and identifier expressions
SupunS Apr 1, 2022
b11e7da
Meter invocation, member, and index expressions
SupunS Apr 2, 2022
978e83e
Add metering for unary, binary and consitional expressions
SupunS Apr 4, 2022
96d2c4f
Add metering for remaining expressions
SupunS Apr 4, 2022
015fc52
Add expression metering tests
SupunS Apr 4, 2022
0ee28a7
Merge pull request #1536 from onflow/supun/meter-ast-v1
SupunS Apr 5, 2022
6892ee0
Merge branch 'feature/memory-metering' of https://github.com/onflow/c…
SupunS Apr 5, 2022
50e6214
Cleanup code
SupunS Apr 5, 2022
577b035
Incoperate element size to array/dictionary expression metering
SupunS Apr 5, 2022
74a84b7
Meter function block, parameters and parameters list
SupunS Apr 5, 2022
952bd69
Meter program, members, and transfers
SupunS Apr 5, 2022
fb0b8df
Meter AST types
SupunS Apr 5, 2022
3b673b6
Merge pull request #1541 from onflow/supun/meter-ast-v2
SupunS Apr 5, 2022
04be939
Merge branch 'feature/memory-metering' of https://github.com/onflow/c…
SupunS Apr 5, 2022
98d5e82
Merge pull request #1545 from onflow/supun/meter-ast-v3
SupunS Apr 5, 2022
91eb714
Meter AST types
SupunS Apr 5, 2022
d7a7ef4
Merge branch 'feature/memory-metering' of https://github.com/onflow/c…
SupunS Apr 5, 2022
44dc8f9
Merge pull request #1554 from onflow/supun/meter-ast-v4
SupunS Apr 5, 2022
c696f6d
Merge branch 'feature/memory-metering' of https://github.com/onflow/c…
SupunS Apr 5, 2022
65001f0
Meter AST position
SupunS Apr 5, 2022
0f890c3
Add position metering tests
SupunS Apr 5, 2022
2e963b1
Merge branch 'supun/meter-ast-v5' of https://github.com/onflow/cadenc…
SupunS Apr 5, 2022
667407c
Meter remaining position creations in parser
SupunS Apr 5, 2022
f78423b
Meter AST range
SupunS Apr 6, 2022
8b56a33
change type signatures of functions to be more usable by the FVM
dsainati1 Apr 6, 2022
003010d
Merge branch 'feature/memory-metering' of github.com:onflow/cadence i…
dsainati1 Apr 6, 2022
df11999
separate container base and size memory kinds
dsainati1 Apr 6, 2022
486e028
fix lint
dsainati1 Apr 6, 2022
ece7569
Fix lint
SupunS Apr 6, 2022
84d30e0
add memory kind last
dsainati1 Apr 6, 2022
eb9c106
Merge pull request #1555 from onflow/supun/meter-ast-v5
SupunS Apr 6, 2022
f0838f4
Merge branch 'feature/memory-metering' of https://github.com/onflow/c…
SupunS Apr 6, 2022
b8efa6a
Merge pull request #1558 from onflow/flow-go-compatibility
dsainati1 Apr 6, 2022
9c47f7a
Fix lint
SupunS Apr 6, 2022
99072d3
Merge branch 'feature/memory-metering' of github.com:onflow/cadence i…
dsainati1 Apr 6, 2022
2145b20
Merge branch 'feature/memory-metering' of github.com:onflow/cadence i…
dsainati1 Apr 6, 2022
2fa93bf
respond to review
dsainati1 Apr 7, 2022
903b8c5
Merge pull request #1560 from onflow/memory-kind-last
dsainati1 Apr 7, 2022
5d96c72
Merge branch 'feature/memory-metering' of github.com:onflow/cadence i…
dsainati1 Apr 7, 2022
3b3da2a
Meter dictionary entries
SupunS Apr 8, 2022
d1c8541
Merge pull request #1546 from onflow/container-length-metering
dsainati1 Apr 11, 2022
e660906
Merge branch 'master' into bastian/master-into-memory-metering
turbolent Apr 12, 2022
bb2dd6d
Merge pull request #1574 from onflow/bastian/master-into-memory-metering
turbolent Apr 12, 2022
309ae7c
Merge branch 'feature/memory-metering' of https://github.com/onflow/c…
SupunS Apr 12, 2022
41d7891
Merge pull request #1556 from onflow/supun/meter-ast-v6
SupunS Apr 12, 2022
d77e472
Merge branch 'feature/memory-metering' of https://github.com/onflow/c…
SupunS Apr 12, 2022
ac9d910
Improve token metering
SupunS Apr 12, 2022
3d163d6
dictionary and array length metering should now be based on both how …
dsainati1 Apr 13, 2022
9cd2204
use logs to compute size change
dsainati1 Apr 13, 2022
3954ad0
Merge branch 'master' into bastian/master-into-memory-metering-2
turbolent Apr 13, 2022
89f7936
meter BigNumberValue.ToBigInt
turbolent Mar 24, 2022
b116d4c
Update runtime/common/metering.go
dsainati1 Apr 13, 2022
9b58e62
fix lint
dsainati1 Apr 13, 2022
a21d2ac
fix test
turbolent Apr 13, 2022
8513e4a
Merge pull request #1579 from onflow/variable-length-container-metering
dsainati1 Apr 13, 2022
58a3481
Merge pull request #1532 from onflow/bastian/improve-big-int-metering
turbolent Apr 13, 2022
8cefe07
Merge pull request #1559 from onflow/supun/meter-ast-v7
SupunS Apr 13, 2022
cef02db
Merge branch 'feature/memory-metering' of https://github.com/onflow/c…
SupunS Apr 13, 2022
8cda3e6
Merge pull request #1564 from onflow/supun/meter-ast-v8
SupunS Apr 14, 2022
f0c934e
Merge branch 'feature/memory-metering' of https://github.com/onflow/c…
SupunS Apr 14, 2022
859a582
Merge pull request #1575 from onflow/supun/token-metering
SupunS Apr 14, 2022
2f9c66f
refactor log computation
dsainati1 Apr 14, 2022
a629d6e
add metering for elaborations
dsainati1 Apr 14, 2022
2e9742b
Merge branch 'feature/memory-metering' of github.com:onflow/cadence i…
dsainati1 Apr 14, 2022
de4b76b
properly include gauge in new checker
dsainati1 Apr 14, 2022
c8eaa32
add test for deploying and importing multiple contracts
dsainati1 Apr 14, 2022
c698592
fix contract deployement and imports
turbolent Apr 14, 2022
0a0d731
fix test expectations
dsainati1 Apr 15, 2022
2000da7
fix test
dsainati1 Apr 15, 2022
63656ca
fix test
dsainati1 Apr 15, 2022
5111926
fix memory race
dsainati1 Apr 18, 2022
769685e
Merge pull request #1580 from onflow/bastian/master-into-memory-meter…
turbolent Apr 18, 2022
9347dfe
Merge branch 'master' into bastian/master-into-memory-metering-3
turbolent Apr 18, 2022
bd50a44
Merge branch 'feature/memory-metering' of github.com:onflow/cadence i…
dsainati1 Apr 18, 2022
2b47860
Memory metering for primitive StaticType (#1538)
robert-e-davidson3 Apr 18, 2022
c961663
adjust formulas for calculating memory usage of arithmetic operations…
turbolent Apr 18, 2022
f7f1e58
Merge pull request #1588 from onflow/bastian/master-into-memory-meter…
turbolent Apr 18, 2022
268a3fe
Meter memory for more static types (#1563)
robert-e-davidson3 Apr 19, 2022
d5202c1
Meter the rest of the static types (#1567)
robert-e-davidson3 Apr 19, 2022
9781d73
Merge branch 'feature/memory-metering' of github.com:onflow/cadence i…
dsainati1 Apr 19, 2022
eff676a
Merge branch 'feature/memory-metering' of github.com:onflow/cadence i…
dsainati1 Apr 19, 2022
1e5fd93
meter arrays on update, and add tests
dsainati1 Apr 19, 2022
601d262
fix formatting
dsainati1 Apr 19, 2022
f601547
fix test
dsainati1 Apr 19, 2022
c094707
fix and comment formulas
turbolent Apr 19, 2022
be06794
fix tests
turbolent Apr 19, 2022
eab1954
Merge pull request #1590 from onflow/bastian/adjust-big-int-memory-me…
turbolent Apr 19, 2022
9d390c5
Do not double count memory for primitive (#1593)
robert-e-davidson3 Apr 20, 2022
6b4e106
Merge branch 'master' of https://github.com/onflow/cadence into supun…
SupunS Apr 20, 2022
8c7443e
Update memory metering tests
SupunS Apr 20, 2022
3ce13a0
Merge pull request #1584 from onflow/elaboration-metering
dsainati1 Apr 20, 2022
852eb02
Merge pull request #1595 from onflow/supun/memory-metering-sync-master
SupunS Apr 20, 2022
86d0f44
compute atree data and metadata slabs distinctly
dsainati1 Apr 21, 2022
2fd24ab
add elementSizes to static types
dsainati1 Apr 22, 2022
f1f3f78
update tests
dsainati1 Apr 22, 2022
f49273c
Merge branch 'feature/memory-metering' of github.com:onflow/cadence i…
dsainati1 Apr 22, 2022
bc70524
use ceiling of count to compute leaf nodes
dsainati1 Apr 22, 2022
5ba7ff3
revert "Remove addPublicKey and removePublicKey" (#1604)
robert-e-davidson3 Apr 22, 2022
371b92d
add new memory kind for simple composites, and use it instead of Comp…
dsainati1 Apr 25, 2022
467a9d1
Merge branch 'improve-container-length' of github.com:onflow/cadence …
dsainati1 Apr 25, 2022
d27f592
split slab kinds into separate kinds for array and map
dsainati1 Apr 26, 2022
3fa8d8c
Update runtime/common/metering.go
dsainati1 Apr 26, 2022
5025bbf
Merge branch 'improve-container-length' of github.com:onflow/cadence …
dsainati1 Apr 26, 2022
5c9362b
fix imprecise sizes in elementSize
dsainati1 Apr 26, 2022
03c0110
cache elementSize in dictionary and array values
dsainati1 Apr 26, 2022
ea4ace0
no additional metering on array update
dsainati1 Apr 26, 2022
75879bd
Merge branch 'feature/memory-metering' of github.com:onflow/cadence i…
dsainati1 Apr 27, 2022
678ed02
respond to review
dsainati1 Apr 27, 2022
e3a7f3b
Merge branch 'improve-container-length' of github.com:onflow/cadence …
dsainati1 Apr 27, 2022
d905826
fix test
dsainati1 Apr 27, 2022
3edb81a
Merge branch 'improve-container-length' of github.com:onflow/cadence …
dsainati1 Apr 27, 2022
b168562
don't remeter elements less than the maximum historical size of a tree
dsainati1 Apr 27, 2022
455af0d
Revert "don't remeter elements less than the maximum historical size …
dsainati1 Apr 28, 2022
083476a
use 20-ary branching factor to compute branch nodes for atree
dsainati1 Apr 28, 2022
adb04ef
Merge pull request #1605 from onflow/simple-composite-metering
dsainati1 Apr 29, 2022
5042298
Meter variable activation
SupunS Apr 30, 2022
af6619c
add overhead memory kind
dsainati1 May 2, 2022
8f4ab1f
Add activation metering tests
SupunS May 2, 2022
d3503c4
Update generated code
SupunS May 2, 2022
2e7bcca
meter atree before actually allocating
dsainati1 May 3, 2022
8da341b
fix lint
dsainati1 May 3, 2022
381727f
Update runtime/tests/interpreter/memory_metering_test.go
dsainati1 May 3, 2022
32241f6
Apply suggestions from code review
dsainati1 May 3, 2022
3e406a9
add clarifying comment
dsainati1 May 3, 2022
ad2f6fd
add cbor tag size to elements
dsainati1 May 3, 2022
096bfde
Merge pull request #1591 from onflow/improve-container-length
dsainati1 May 3, 2022
fcb2ec6
Improve comment
SupunS May 4, 2022
a6b1144
Merge branch 'feature/memory-metering' of https://github.com/onflow/c…
SupunS May 4, 2022
220288a
Merge pull request #1616 from onflow/supun/activation-metering
SupunS May 4, 2022
c30dd4c
Meter atree map's pre-allocated element memory
SupunS May 4, 2022
c6e9ad6
Add element overhead to atree metering
SupunS May 4, 2022
4b1ed09
Adjust tests
SupunS May 5, 2022
c554731
Meter static type to sema type conversion
SupunS May 5, 2022
95267aa
Meter restrictions set of restricted semaType
SupunS May 5, 2022
78e4900
Meter typeID generation
SupunS May 6, 2022
81d994b
Meter location ID generation
SupunS May 6, 2022
4192fab
Merge pull request #1624 from onflow/supun/improve-array-metering
SupunS May 6, 2022
2bc2f13
Update the dictionary pre-allocated elements formula
SupunS May 6, 2022
c4b65ed
Merge branch 'feature/memory-metering' of https://github.com/onflow/c…
SupunS May 6, 2022
72ccb84
Fix test
SupunS May 6, 2022
f5324b1
Merge branch 'feature/memory-metering' of https://github.com/onflow/c…
SupunS May 6, 2022
37cac8e
Add static type to sematype conversion tests
SupunS May 6, 2022
ca61392
Merge branch 'feature/memory-metering' of https://github.com/onflow/c…
SupunS May 6, 2022
6c582ba
Merge pull request #1623 from onflow/supun/improve-composite-metering
SupunS May 6, 2022
76539aa
meter cadence.Value string. languageserver fails
Apr 12, 2022
7cb1f67
lint
May 6, 2022
4b35426
Merge branch 'feature/memory-metering' of https://github.com/onflow/c…
SupunS May 6, 2022
522ea92
Merge branch 'feature/memory-metering' of https://github.com/onflow/c…
SupunS May 6, 2022
a16a826
Merge branch 'master' of https://github.com/onflow/cadence into supun…
SupunS May 6, 2022
33cd9e0
Merge pull request #1632 from onflow/supun/memory-metering-sync-master
SupunS May 6, 2022
9c7913f
cadence.Value.Type method back to original param list; add MeteredTyp…
May 6, 2022
8c3c249
wip
May 6, 2022
24d36f1
revert NewU?Fix functions; lint
May 6, 2022
2ae7d1c
adjust big int metering minor errors
May 7, 2022
756fba6
Merge branch 'master' of https://github.com/onflow/cadence into supun…
SupunS May 9, 2022
7708076
Fix test
SupunS May 9, 2022
9a1afbe
Merge pull request #1637 from onflow/supun/mermory-metering-sync-master
j1010001 May 9, 2022
85911e3
Merge pull request #1635 from onflow/tarak/minor-big-int-fixes
tarakby May 9, 2022
b95fe8d
Merge pull request #1631 from onflow/supun/sematype-conversion-metering
SupunS May 10, 2022
5f352ad
Merge branch 'master' into bastian/merge-master
turbolent May 11, 2022
01565ef
Merge branch 'master' into bastian/merge-master
turbolent May 11, 2022
5f7141d
fix merge
turbolent May 11, 2022
86986a4
Meter composite typeinfo
SupunS May 11, 2022
1186612
Merge pull request #1646 from onflow/bastian/merge-master
turbolent May 11, 2022
0ecebfb
Meter composite field
SupunS May 11, 2022
fd6d376
Meter invocation
SupunS May 11, 2022
2eaeb43
Metere storage map
SupunS May 11, 2022
30f82e4
Meter storage key
SupunS May 11, 2022
a2207b8
Merge branch 'feature/memory-metering' of https://github.com/onflow/c…
SupunS May 11, 2022
98ed308
Refactor
SupunS May 11, 2022
808fe14
Merge pull request #1647 from onflow/supun/improve-metering
SupunS May 11, 2022
fcded44
Merge branch 'master' of github.com:onflow/cadence into merge-master-…
dsainati1 May 13, 2022
41927f8
Merge pull request #1648 from onflow/merge-master-metering
dsainati1 May 13, 2022
08b93d4
Merge pull request #1626 from onflow/supun/meter-id-generation
turbolent May 13, 2022
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
35 changes: 35 additions & 0 deletions docs/language/accounts.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -88,6 +88,19 @@ to the `prepare` phase of the transaction.

let keys: AuthAccount.Keys

// Key management
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is this supposed to include the public key API changes?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This PR just reverts the removal of the deprecated functions. This documentation should have been added back to master already before, but it seems like it wasn't


// Adds a public key to the account.
// The public key must be encoded together with their signature algorithm, hashing algorithm and weight.
// This method is currently deprecated and is available only for the backward compatibility.
// `keys.add` method can be use instead.
fun addPublicKey(_ publicKey: [UInt8])

// Revokes the key at the given index.
// This method is currently deprecated and is available only for the backward compatibility.
// `keys.revoke` method can be use instead.
fun removePublicKey(_ index: Int)

// Account storage API (see the section below for documentation)

fun save<T>(_ value: T, to: StoragePath)
Expand Down Expand Up @@ -233,6 +246,23 @@ transaction(publicKey: [UInt8]) {
}
```

<Callout type="info">
⚠️ Note: Keys can also be added using the `addPublicKey` function.
However, this method is currently deprecated and is available only for the backward compatibility.
The `addPublicKey` method accepts the public key encoded together with their signature algorithm,
hashing algorithm and weight.

```cadence
transaction(key: [UInt8]) {
prepare(signer: AuthAccount) {
let account = AuthAccount(payer: signer)
account.addPublicKey(key)
}
}
```
</Callout>


#### Get Account Keys

Keys that are added to an account can be retrieved using `get()` function, using the index of the key.
Expand Down Expand Up @@ -268,6 +298,11 @@ transaction() {
}
```

<Callout type="info">
⚠️ Note: Keys can also be removed using the `removePublicKey` function.
However, this method is deprecated and is available only for the backward compatibility.
</Callout>

## Account Storage

All accounts have storage.
Expand Down
Loading