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: Initialize static blocks before preprocess #2418

Merged
merged 21 commits into from
Jul 8, 2024
Merged

Conversation

jaekwon
Copy link
Contributor

@jaekwon jaekwon commented Jun 23, 2024

This PR introduces a phase 'initStaticBlock' to come before preprocess, where the StaticBlock name table is populated with BlockNode.Predefine() calls.

initStaticBlock() also does a few other things, including giving default names where no names are provided, and making 'init' function names unique with numeric suffixes.

@github-actions github-actions bot added the 📦 🤖 gnovm Issues or PRs gnovm related label Jun 23, 2024
Copy link

codecov bot commented Jun 23, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 54.89%. Comparing base (ebf4d8f) to head (aba783c).

Additional details and impacted files
@@            Coverage Diff             @@
##           master    #2418      +/-   ##
==========================================
- Coverage   54.92%   54.89%   -0.04%     
==========================================
  Files         595      595              
  Lines       79447    79341     -106     
==========================================
- Hits        43637    43551      -86     
+ Misses      32516    32494      -22     
- Partials     3294     3296       +2     
Flag Coverage Δ
contribs/gnodev 25.65% <ø> (-0.35%) ⬇️
contribs/gnofaucet 14.46% <ø> (ø)
contribs/gnokeykc 0.00% <ø> (ø)
contribs/gnomd 0.00% <ø> (ø)
gno.land 63.14% <ø> (ø)

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@jaekwon jaekwon changed the title WIP initialize static blocks before preprocess Initialize static blocks before preprocess Jun 24, 2024
@Kouteki
Copy link
Contributor

Kouteki commented Jul 1, 2024

Relates to #2077

@Kouteki Kouteki requested review from petar-dambovaliev and removed request for moul, deelawn, thehowl and piux2 July 2, 2024 10:09
@jaekwon jaekwon changed the title Initialize static blocks before preprocess feat: Initialize static blocks before preprocess Jul 3, 2024
@github-actions github-actions bot added the 🧾 package/realm Tag used for new Realms or Packages. label Jul 6, 2024
@petar-dambovaliev petar-dambovaliev requested review from a team as code owners July 6, 2024 17:33
@petar-dambovaliev petar-dambovaliev requested review from ltzmaxwell and removed request for a team July 6, 2024 17:33
@zivkovicmilos zivkovicmilos merged commit 0dc4b6d into master Jul 8, 2024
89 checks passed
@zivkovicmilos zivkovicmilos deleted the init_static branch July 8, 2024 17:08
gfanton pushed a commit to gfanton/gno that referenced this pull request Jul 23, 2024
This PR introduces a phase 'initStaticBlock' to come before preprocess,
where the StaticBlock name table is populated with BlockNode.Predefine()
calls.

initStaticBlock() also does a few other things, including giving default
names where no names are provided, and making 'init' function names
unique with numeric suffixes.

---------

Co-authored-by: Petar Dambovaliev <[email protected]>
thehowl added a commit that referenced this pull request Sep 16, 2024
fixes #2711

The bug in the benchmark was introduced in #2418, which requires to run
initStaticBlocks before running Preprocess, in most cases. (in normal
scenarios, this is run by PredefineFileSet; however this benchmark is
deep into the internals).

Related: #2716. cc/ @sw360cab 

<!-- please provide a detailed description of the changes made in this
pull request. -->

<details><summary>Contributors' checklist...</summary>

- [ ] Added new tests, or not needed, or not feasible
- [ ] Provided an example (e.g. screenshot) to aid review or the PR is
self-explanatory
- [ ] Updated the official documentation or not needed
- [ ] No breaking changes were made, or a `BREAKING CHANGE: xxx` message
was included in the description
- [ ] Added references to related issues and PRs
- [ ] Provided any useful hints for running manual tests
- [ ] Added new benchmarks to [generated
graphs](https://gnoland.github.io/benchmarks), if any. More info
[here](https://github.com/gnolang/gno/blob/master/.benchmarks/README.md).
</details>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
📦 🤖 gnovm Issues or PRs gnovm related 🧾 package/realm Tag used for new Realms or Packages.
Projects
Status: Done
Development

Successfully merging this pull request may close these issues.

5 participants