-
Notifications
You must be signed in to change notification settings - Fork 14
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: refactor build and tests pipeline #94
Conversation
So far I've:
One possible next step is removing the usage of docker in our make/just targets. Currently, we have a I think a better workflow just invokes the intended commands, without docker, and assumes all dependencies are there (i.e. the target |
5bcc9fb
to
d92a44c
Compare
d21df14
to
85eb123
Compare
|
83f676e
to
114708d
Compare
This PR is getting close to completion. Feature-wise, the main change is from block timestamp -> block number, which is a delicate change. The rest is mainly refactoring and changes to how we invoke programs. Running tests on the host: $ just setup
$ just build && just -f prt/tests/rollups/justfile test-echo Running tests in docker: $ just run-dockered just -f prt/tests/rollups/justfile test-echo |
Cargo.toml
Outdated
|
||
# rollups-node | ||
rollups-blockchain-reader = { version = "0.1", path = "cartesi-rollups/node/blockchain-reader" } | ||
rollups-compute-runner = { version = "0.1", path = "cartesi-rollups/node/compute-runner" } |
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.
Now I think that compute-runner
should be named to something like prt-runner
.
@@ -16,14 +16,15 @@ use cartesi_machine::{break_reason, configuration::RuntimeConfig, htif, machine: | |||
use cartesi_prt_core::machine::constants::{LOG2_EMULATOR_SPAN, LOG2_INPUT_SPAN, LOG2_UARCH_SPAN}; | |||
use rollups_state_manager::{InputId, StateManager}; | |||
|
|||
// gap of each leaf in the commitment tree, should use the same value as CanonicalConstants.sol:log2step(0) | |||
// gap of each leaf in the commitment tree, should use the same value as CanonicalConstants.sol:log2step(0)a |
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.
was the last a
a typo or was it put there on purpose?
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.
Typo!
e9bd3b7
to
fa2efd0
Compare
With newer foundry version, we started hitting smart contracts size limit. The solution (great catch @stephenctw!) is to add the option An important consideration is whether this limit will appear when deploying to main net (or whether it's only our tests that hit this limit). |
eff31e4
to
ab86aa2
Compare
* introduce `just` and rewrite makefiles into justfiles * unify all cargo workspaces into a single cargo workspace; * unify all Dockerfiles into a single Dockerfile; * implement anvil deployments as state dumps and loads; * update `blockchain-reader` tests to load anvil state; * Change PRT time from timestamp to block number; * refactor `echo` program build; * implement node state directory configuration; * update PRT tests to newest changes; * simplify `machine-runner` test; * fix `persistent-state-access` tests; * add ci (check/fmt/build/test) with cache; * add machine bindings to workspace; * rename `rollups-compute-runner` to `rollups-prt-runner`; * extract `prt/tests` shared modules into `prt/tests/common` dir; * remove `step` dependency on `CanonicalConstants`; * remove unused files.
ab86aa2
to
45f3409
Compare
This ended up being a larger PR than I'd imagined. It's mostly refactoring, except from the change of timestamp -> blocknumber, which is quite major, but the smart contracts were well implemented enough that it was a simple change (but the clients required more effort). |
--broadcast \ | ||
--sig 'run(bytes32,address)' \ | ||
{{INITIAL_HASH}} \ | ||
$(jq -r '.transactions[] | select(.transactionType=="CREATE").contractAddress' broadcast/InputBox.s.sol/{{ANVIL_CHAIN_ID}}/run-latest.json) \ |
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.
To avoid this, we could join these two Solidity scripts into one.
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.
Good idea!
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.
I think I purposely want them to be two separate blocks so that the the first epoch already have inputs to process
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.
Ok! I've kept as @stephenctw prefer, and we can keep discussing this later. I'm fine either way.
I think there's one more place to update timestamp -> blocknumber |
just -f ./prt/contracts/justfile clean-bindings | ||
bind-prt: | ||
just -f ./prt/contracts/justfile bind | ||
|
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.
Should we also add the tests
related just targets? Something like
test-prt-rollups-echo:
just -f prt/tests/rollups/justfile test-echo
?
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.
I think we can add it in a later PR!
chore(prt-tests): remove
--platform
from Dockerfile