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: Alphanet #651

Draft
wants to merge 22 commits into
base: main
Choose a base branch
from
Draft

feat: Alphanet #651

wants to merge 22 commits into from

Conversation

nopestack
Copy link
Contributor

@nopestack nopestack commented Nov 8, 2023

Ensure the network protocol is fully functional.

Closes #640
Closes #584

@nopestack nopestack self-assigned this Nov 13, 2023
@nopestack nopestack changed the title Vrs 649 Refactor NodeRuntime to remove deprecated and redundant handlers Nov 14, 2023
@nopestack nopestack added bug Something isn't working documentation Improvements or additions to documentation enhancement New feature or request labels Nov 14, 2023
@eureka-cpu eureka-cpu assigned mitch-vrrb and unassigned nopestack Dec 5, 2023
@eureka-cpu eureka-cpu added this to the alphanet milestone Dec 5, 2023
# Conflicts:
#	Cargo.lock
#	Cargo.toml
#	crates/node/src/consensus/consensus_event_handler.rs
#	crates/node/src/runtime/node_runtime_handler.rs
#	crates/node/src/state_manager/dag.rs
#	crates/node/src/test_utils/mod.rs
#	examples/multichain.rs
@eureka-cpu eureka-cpu self-assigned this Dec 5, 2023
@eureka-cpu eureka-cpu changed the title Refactor NodeRuntime to remove deprecated and redundant handlers feat: Alphanet Dec 5, 2023
@eureka-cpu eureka-cpu added big Will take a while to complete and removed bug Something isn't working documentation Improvements or additions to documentation labels Dec 5, 2023
Comment on lines 49 to 51
let validator_count = (n.clone() as f64 * 0.8).ceil() as usize;
let farmer_count = (validator_count.clone() as f64 * 0.7).ceil() as usize;
let harvester_count = validator_count.clone() - farmer_count;
Copy link
Contributor

@eureka-cpu eureka-cpu Dec 10, 2023

Choose a reason for hiding this comment

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

u16 and usize both implement Copy so you can remove the .clone()s here (pretty sure)

mitch-vrrb and others added 5 commits December 12, 2023 16:00
# Conflicts:
#	Cargo.toml
#	crates/node/src/consensus/consensus_module.rs
#	crates/node/src/state_manager/manager.rs
#	crates/node/src/state_manager/mod.rs
#	crates/storage/vrrbdb/src/vrrbdb.rs
#	examples/multichain.rs
Copy link
Contributor

@eureka-cpu eureka-cpu left a comment

Choose a reason for hiding this comment

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

Just a few preemptive comments while I'm sorting through the changes and cleaning up existing tests that were not compiling.

genesis_block: GenesisBlock,
) -> Result<Certificate> {
let sig = todo!();
self.certify_genesis_block(genesis_block, self.config.id.clone(), sig)
}
Copy link
Contributor

Choose a reason for hiding this comment

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

Just for posterity, anyone else reviewing, etc, this method is just moved. The inner method that is called is deleted and the logic within the deleted method is moved into the new method with this name.

Copy link
Contributor

Choose a reason for hiding this comment

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

For some reason the diff I selected isn't showing up. The method is called handle_convergence_block_certificate_received and the logic is moved to handle_convergence_block_certificate_created

"Could not append convergence block to DAG: {err:?}"
))
})?;
pub fn handle_block_received(&mut self, block: Block) -> Result<Event> {
Copy link
Contributor

@eureka-cpu eureka-cpu Dec 14, 2023

Choose a reason for hiding this comment

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

This is a pretty big change to the return type. I've tracked it down to where the Event is created, and it returns only the hash of the block (or the whole block), where it used to return an ApplyBlockResult which gave us a bit more information. This sort of feels like a regression to me, especially in the unit test cases where we used to be able to get the hashes of both state and transactions, now we only get a single hash to assert against.

Maybe my opinion here is invalid, @ASmithOWL @mitch-vrrb would you mind weighing in? Can we have the event send over the ApplyBlockResult instead of just the hash, that way the logic is maintained, or is it unreasonable to do so?

eureka-cpu and others added 4 commits December 14, 2023 10:54
mitch-vrrb and others added 4 commits March 11, 2024 10:40
# Conflicts:
#	Cargo.lock
#	crates/events/src/event.rs
#	crates/miner/src/test_helpers.rs
#	crates/node/src/state_manager/handler.rs
#	crates/node/src/test_utils/mod.rs
#	crates/node/tests/genesis_rewards.rs
Refactor error handling in node_runtime_handler.rs to avoid exiting early causing the network to crash.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
big Will take a while to complete enhancement New feature or request
Projects
None yet
4 participants