8000 chore(node): minor cleanup by GCdePaula · Pull Request #165 · cartesi/dave · GitHub
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content

chore(node): minor cleanup #165

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

Merged
merged 1 commit into from
May 19, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
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
3 changes: 3 additions & 0 deletions .luarc.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
{
"runtime.version": "Lua 5.4",
}
14 changes: 11 additions & 3 deletions cartesi-rollups/node/blockchain-reader/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -38,23 +38,31 @@ use rollups_state_manager::{Epoch, Input, InputId, StateManager};
pub struct AddressBook {
/// address of app
pub app: Address,

/// address of Dave consensus
pub consensus: Address,

/// address of input box
pub input_box: Address,
/// earliest block number where contracts exist
pub genesis_block_number: u64,

/// initial state hash of application
pub initial_hash: Hash,

/// earliest block number where contracts exist
pub genesis_block_number: u64,
}

impl fmt::Display for AddressBook {
fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
writeln!(f, "App Address: {}", self.app)?;
writeln!(f, "Consensus Address: {}", self.consensus)?;
writeln!(f, "Input Box Address: {}", self.input_box)?;
writeln!(
f,
"Initial Hash: 0x{}",
alloy::hex::encode(self.initial_hash)
)?;
writeln!(f, "Genesis Block Number: {}", self.genesis_block_number)?;
writeln!(f, "Initial Hash: {}", alloy::hex::encode(self.initial_hash))?;
Ok(())
}
}
Expand Down
15 changes: 11 additions & 4 deletions cartesi-rollups/node/cartesi-rollups-prt-node/src/args.rs
Original file line number Diff line number Diff line change
Expand Up @@ -109,12 +109,16 @@ pub struct PRTConfig {

impl fmt::Display for PRTConfig {
fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
writeln!(f, "{}", self.address_book)?;
write!(f, "{}", self.address_book)?;
writeln!(f, "Machine path: {}", self.machine_path.display())?;
writeln!(f, "Ethereum gateway: <redacted>")?;
writeln!(f, "Signer address: {}", self.signer_address)?;
writeln!(f, "Ethereum gateway: <redacted>")?;
writeln!(f, "State directory: {}", self.state_dir.display())?;
writeln!(f, "Sleep duration: {}s", self.sleep_duration.as_secs())?;
writeln!(
f,
"Sleep duration: {} seconds",
self.sleep_duration.as_secs()
)?;
Ok(())
}
}
Expand Down Expand Up @@ -155,7 +159,10 @@ impl PRTConfig {
(
Self {
address_book,
state_dir: state_manager.state_dir().to_owned(),
state_dir: state_manager
.state_dir()
.canonicalize()
.expect("could not canonicalize state directory"),
machine_path: args.machine_path,
signer_address,
provider,
Expand Down
4 changes: 2 additions & 2 deletions justfile
Original file line number Diff line number Diff line change
Expand Up @@ -71,9 +71,9 @@ run-dockered +CMD: build-docker-image
exec-dockered +CMD:
docker exec dave-node {{CMD}}

test-rollups-echo:
test-rollups-echo: build-rust-workspace
just -f ./prt/tests/rollups/justfile test-echo
test-rollups-honeypot:
test-rollups-honeypot: build-rust-workspace
just -f ./prt/tests/rollups/justfile test-honeypot
view-rollups-logs:
just -f ./prt/tests/rollups/justfile read-node-logs
Expand Down
1 change: 0 additions & 1 deletion prt/client-lua/computation/commitment.lua
Original file line number Diff line number Diff line change
Expand Up @@ -111,7 +111,6 @@ local function build_commitment(base_cycle, log2_stride, log2_stride_count, mach
initial_state = machine:state().root_hash
else
-- treat it as compute

machine = Machine:new_from_path(machine_path)
machine:load_snapshot(snapshot_dir, base_cycle)
initial_state = machine:run(base_cycle).root_hash
Expand Down
0