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

feat: generate inversions of abi.encodePacked() for StakingMessages.unpack*() #482

Draft
wants to merge 30 commits into
base: main
Choose a base branch
from
Draft
Changes from 1 commit
Commits
Show all changes
30 commits
Select commit Hold shift + click to select a range
8777f88
perf: `SetSubnetValidatorWeightMessage` (un)packing gas reductions
ARR4N Aug 6, 2024
8b0557a
chore: `forge fmt`
ARR4N Aug 6, 2024
d5f52da
chore: `solhint-disable` assembly checks + some commentary
ARR4N Aug 6, 2024
1c94c27
feat: generated code for `abi.encodePacked()` inversion
ARR4N Aug 9, 2024
c89bd4a
fix: `solc` pragma `^0.8.0` unless using `mcopy` then `^0.8.25`
ARR4N Aug 9, 2024
dac07fc
fix: remove unused variable when dynamically sized at end
ARR4N Aug 9, 2024
c3ac02a
chore: add copyright notices
ARR4N Aug 9, 2024
e264572
chore: placate the linters... ssshhhhh
ARR4N Aug 9, 2024
7f0bd2e
perf: `SetSubnetValidatorWeightMessage` (un)packing gas reductions
ARR4N Aug 6, 2024
9890cca
chore: `forge fmt`
ARR4N Aug 6, 2024
721b63e
chore: `solhint-disable` assembly checks + some commentary
ARR4N Aug 6, 2024
ef87566
feat: generated code for `abi.encodePacked()` inversion
ARR4N Aug 9, 2024
c9e28b6
fix: `solc` pragma `^0.8.0` unless using `mcopy` then `^0.8.25`
ARR4N Aug 9, 2024
1c2ad1e
fix: remove unused variable when dynamically sized at end
ARR4N Aug 9, 2024
7f98e2a
chore: add copyright notices
ARR4N Aug 9, 2024
ee4bbf6
chore: placate the linters... ssshhhhh
ARR4N Aug 9, 2024
e6cf4e5
Merge branch 'arr4n/staking-messages' of github.com:ava-labs/teleport…
ARR4N Aug 9, 2024
3bb7bb6
chore: remove obsolete test of equivalence
ARR4N Aug 9, 2024
34f629f
refactor: `abi.encodePacked()` and `Unpack.unpack_...()` all the things
ARR4N Aug 9, 2024
f32bbcf
chore: make Slither keep quiet
ARR4N Aug 9, 2024
0272bde
chore: disable `line-length-limiter` on flag usage
ARR4N Aug 9, 2024
aed84c7
feat: use literal "dyn" string in `unpackgen` flag
ARR4N Aug 9, 2024
a279844
Merge branch 'staking-contract' into arr4n/staking-messages
ARR4N Aug 12, 2024
de4da9f
Merge branch 'staking-contract' into arr4n/staking-messages
ARR4N Sep 6, 2024
aab0874
feat: `pragma solidity` version override
ARR4N Sep 6, 2024
f4a773c
fix: apply explicit `solc` version to generated tests
ARR4N Sep 6, 2024
1bfcf4b
doc: clarify allowable interchange of `bytes<N>` and `uint<8N>` types
ARR4N Sep 6, 2024
78a1f47
refactor: only change `pack*()` methods to `abi.encodePacked()`
ARR4N Sep 6, 2024
e13cabc
refactor: change `unpack*()` methods to use generated code
ARR4N Sep 6, 2024
a19b841
chore: regenerate ABI bindings
ARR4N Sep 6, 2024
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
Prev Previous commit
Next Next commit
chore: add copyright notices
ARR4N committed Aug 9, 2024
commit 7f98e2a91a6267130a23547cb3a61ddb31194276
2 changes: 2 additions & 0 deletions contracts/staking/Unpack.sol
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
// (c) 2024, Ava Labs, Inc. All rights reserved.
// See the file LICENSE for licensing terms.
// SPDX-License-Identifier: UNLICENSED
pragma solidity ^0.8.0;

2 changes: 2 additions & 0 deletions contracts/staking/tests/Unpack.t.sol
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
// (c) 2024, Ava Labs, Inc. All rights reserved.
// See the file LICENSE for licensing terms.
// SPDX-License-Identifier: UNLICENSED
pragma solidity ^0.8.0;

2 changes: 2 additions & 0 deletions utils/unpack/Unpack.sol.gotmpl
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
// (c) 2024, Ava Labs, Inc. All rights reserved.
// See the file LICENSE for licensing terms.
// SPDX-License-Identifier: UNLICENSED
pragma solidity ^{{if .UsesMCopy}}0.8.25{{else}}0.8.0{{end}};

2 changes: 2 additions & 0 deletions utils/unpack/Unpack.t.sol.gotmpl
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
// (c) 2024, Ava Labs, Inc. All rights reserved.
// See the file LICENSE for licensing terms.
// SPDX-License-Identifier: UNLICENSED
pragma solidity ^{{if .UsesMCopy}}0.8.25{{else}}0.8.0{{end}};

3 changes: 3 additions & 0 deletions utils/unpack/unpack.go
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
// (c) 2024, Ava Labs, Inc. All rights reserved.
// See the file LICENSE for licensing terms.
//
// Package unpack generates Solidity code to invert `abi.encodePacked()` for
// known, unambiguous output sizes.
package unpack
3 changes: 3 additions & 0 deletions utils/unpack/unpackgen/unpackgen.go
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
// (c) 2024, Ava Labs, Inc. All rights reserved.
// See the file LICENSE for licensing terms.
//
// The unpackgen binary generates Solidity code to invert `abi.encodePacked()`
// for known, unambiguous output sizes. See the [unpack] package for details.
package main