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

refactor(store): update tightcoder codegen, optimize TightCoder library #1210

Merged
merged 13 commits into from
Aug 6, 2023

Conversation

dk1a
Copy link
Contributor

@dk1a dk1a commented Jul 31, 2023

Extracted from #1183
Fixes parts of #1132

lumping codegen update and optimizations together cause TightCoder.sol gets different arguments and codegen is for the new methods

@changeset-bot
Copy link

changeset-bot bot commented Jul 31, 2023

🦋 Changeset detected

Latest commit: f09aed7

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 27 packages
Name Type
@latticexyz/common Patch
@latticexyz/store Patch
@latticexyz/world Patch
@latticexyz/block-logs-stream Patch
@latticexyz/cli Patch
@latticexyz/config Patch
@latticexyz/dev-tools Patch
@latticexyz/network Patch
@latticexyz/protocol-parser Patch
@latticexyz/std-client Patch
@latticexyz/store-cache Patch
@latticexyz/store-indexer Patch
@latticexyz/store-sync Patch
@latticexyz/utils Patch
@latticexyz/react Patch
@latticexyz/ecs-browser Patch
@latticexyz/phaserx Patch
@latticexyz/recs Patch
create-mud Patch
@latticexyz/gas-report Patch
@latticexyz/noise Patch
@latticexyz/schema-type Patch
@latticexyz/services Patch
@latticexyz/solecs Patch
solhint-config-mud Patch
solhint-plugin-mud Patch
@latticexyz/std-contracts Patch

Not sure what this means? Click here to learn what changesets are.

Click here if you're a maintainer who wants to add another changeset to this PR

@dk1a dk1a force-pushed the dk1a/tightcoder2 branch from 806419b to c4ad0af Compare July 31, 2023 11:12
@dk1a dk1a mentioned this pull request Jul 31, 2023
7 tasks
@dk1a dk1a changed the title refactor(store): update tightcoder codegen refactor(store): update tightcoder codegen, optimize TightCoder library Jul 31, 2023
@dk1a dk1a marked this pull request as ready for review July 31, 2023 11:28
@dk1a dk1a requested review from alvrs and holic as code owners July 31, 2023 11:28
@dk1a dk1a mentioned this pull request Jul 31, 2023
Copy link
Member

@alvrs alvrs left a comment

Choose a reason for hiding this comment

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

looking good, just minor nits

.changeset/witty-jokes-serve.md Outdated Show resolved Hide resolved
packages/common/src/codegen/render-solidity/common.ts Outdated Show resolved Hide resolved
Copy link
Member

Choose a reason for hiding this comment

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

nice savings 🔥

@@ -46,7 +46,7 @@
"clean:typechain": "rimraf types",
"dev": "tsup --watch",
"gas-report": "mud-gas-report --save gas-report.json",
"generate-tightcoder": "tsx ./scripts/generate-tightcoder.ts && prettier --write '**/tightcoder/*.sol'",
"generate-tightcoder": "tsx ./ts/scripts/generate-tightcoder.ts",
Copy link
Member

Choose a reason for hiding this comment

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

should we call this build:tightcoder for consistency with the other build scripts? (no strong opinion)

Suggested change
"generate-tightcoder": "tsx ./ts/scripts/generate-tightcoder.ts",
"build:tightcoder": "tsx ./ts/scripts/generate-tightcoder.ts",

Copy link
Contributor Author

Choose a reason for hiding this comment

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

it's based on generate-test-tables from cli, I also don't have a strong opinion either way.
generate-test-tables and generate-tightcoder are different so it's okay for them to diverge too (test tables are for tests only, tightcoder is for everything)
@holic thoughts?

Copy link
Member

@holic holic Aug 4, 2023

Choose a reason for hiding this comment

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

If they don't get in the way (e.g. creating a circular dependency), I'd be fine moving them both to build:* so we can get them in the "build everything" pipeline and not miss changes

Copy link
Contributor Author

Choose a reason for hiding this comment

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

changed build:tightcoder in this PR, test-tables in #1248

Comment on lines -10 to -12
function testEncodeBytesArray() public {
bytes[] memory input = new bytes[](2);
input[0] = new bytes(32);
Copy link
Member

Choose a reason for hiding this comment

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

why did this test go away?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

we don't support bytes[], string[], the test was for a function that's not used anywhere (which I also removed)

alvrs
alvrs previously approved these changes Aug 4, 2023
@dk1a dk1a merged commit cc2c8da into main Aug 6, 2023
@dk1a dk1a deleted the dk1a/tightcoder2 branch August 6, 2023 06:40
@github-actions github-actions bot mentioned this pull request Aug 6, 2023
dk1a added a commit that referenced this pull request Aug 6, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants