Skip to content
This repository has been archived by the owner on Jan 29, 2024. It is now read-only.

Refactor checkpoints #74

Merged
merged 16 commits into from
Apr 3, 2023
Merged

Refactor checkpoints #74

merged 16 commits into from
Apr 3, 2023

Conversation

cryptoAtwill
Copy link
Collaborator

Changes

Initial implementation to simplify bottom up messages. Replaced meta with vec.

@cryptoAtwill cryptoAtwill changed the base branch from main to cron_submit_tests March 22, 2023 15:45
Copy link
Contributor

@adlrocha adlrocha left a comment

Choose a reason for hiding this comment

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

LGTM. I think we are just missing executing the messages, removing apply_msg as an external function, and testing. In the future, we may be able to improve the design, but I guess it is good for now

@@ -63,17 +63,17 @@ impl Checkpoint {
}

/// return cross_msg included in the checkpoint.
pub fn cross_msgs(&self) -> Option<&CrossMsgMeta> {
pub fn cross_msgs(&self) -> &Vec<CrossMsg> {
Copy link
Contributor

Choose a reason for hiding this comment

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

I guess there's no need for the ref now that this is a vector.

Suggested change
pub fn cross_msgs(&self) -> &Vec<CrossMsg> {
pub fn cross_msgs(&self) -> Vec<CrossMsg> {

gateway/src/checkpoint.rs Outdated Show resolved Hide resolved
})?;
}
let mut value = TokenAmount::zero();
commit.cross_msgs().iter().for_each(|m| value += &m.msg.value);
Copy link
Contributor

Choose a reason for hiding this comment

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

I guess you'll accommodate this in the next PR/commit, but here we need to call apply_msg to execute the messages committed.

Base automatically changed from cron_submit_tests to cron_impl March 23, 2023 03:08
cryptoAtwill and others added 2 commits March 28, 2023 09:30
* update bottom up execution

* update cross message execution

* fix fmt

* update review and clean up

* check message ordering

* Cross execution tests (#76)

* fix clippy

* fmt code
@cryptoAtwill cryptoAtwill merged commit de4875b into cron_impl Apr 3, 2023
@cryptoAtwill cryptoAtwill deleted the refactor_checkpoints branch April 3, 2023 05:59
adlrocha added a commit that referenced this pull request Apr 10, 2023
* add cron fields

* fmt code

* Update gateway/src/state.rs

Co-authored-by: adlrocha <adlrocha@tutamail.com>

* Update gateway/src/types.rs

Co-authored-by: adlrocha <adlrocha@tutamail.com>

* update cron (#65)

* update cron

* fix lint

---------

Co-authored-by: willesxm <willeslau@gmail.com>

* add submit cron impl

* add more checks

* add some todo

* derive total validators

* add todo

* specify rust tool chain

* add tests

* support abort

* simplify impl

* Track validators (#70)

* track validators

* add validator check to submit cron

* update impl

* Weighted vote (#71)

* track validators

* add validator check to submit cron

* update impl

* weighted vote

* Update gateway/src/cron.rs

Co-authored-by: adlrocha <adlrocha@tutamail.com>

* update method name

---------

Co-authored-by: adlrocha <adlrocha@tutamail.com>

* Cron submit tests (#73)

* track validators

* add validator check to submit cron

* update impl

* weighted vote

* Update gateway/src/cron.rs

Co-authored-by: adlrocha <adlrocha@tutamail.com>

* update method name

* add tests

* refactor pending epoches

* fix clippy

* add more tests

---------

Co-authored-by: adlrocha <adlrocha@tutamail.com>

* Refactor checkpoints (#74)

* track validators

* add validator check to submit cron

* update impl

* weighted vote

* Update gateway/src/cron.rs

Co-authored-by: adlrocha <adlrocha@tutamail.com>

* update method name

* add tests

* refactor pending epoches

* fix clippy

* add more tests

* initial commit

* Cross execution (#75)

* update bottom up execution

* update cross message execution

* fix fmt

* update review and clean up

* check message ordering

* Cross execution tests (#76)

* fix clippy

* fmt code

---------

Co-authored-by: adlrocha <adlrocha@tutamail.com>

* cargo fmt

* Vote checkpoints (#81)

* track validators

* add validator check to submit cron

* update impl

* weighted vote

* Update gateway/src/cron.rs

Co-authored-by: adlrocha <adlrocha@tutamail.com>

* update method name

* add tests

* refactor pending epoches

* fix clippy

* add more tests

* initial commit

* Cross execution (#75)

* update bottom up execution

* update cross message execution

* fix fmt

* update review and clean up

* check message ordering

* Cross execution tests (#76)

* fix clippy

* fmt code

* generics for cron submission

* migrate to sdk

* format code

* remove wip field

* work in progress

* local changes

* reorg code

* update comment

* update tests

* format code and clippy

* fix error

---------

Co-authored-by: adlrocha <adlrocha@tutamail.com>

* rename checkpoints to bottomup and topdown

* fix tests

* use CrossMsg for topdown checkpoint

* fix checkpoint (#85)

* update queue serialization (#86)

* update queue serialization

* remove println

* fix fmt

* genesis_epoch bottomup checkpoints to zero

* fix test with new genesis checkpoint

---------

Co-authored-by: willesxm <willeslau@gmail.com>
Co-authored-by: adlrocha <adlrocha@tutamail.com>
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants