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

proper delegator behavior #17

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

proper delegator behavior #17

wants to merge 5 commits into from

Conversation

rkdud007
Copy link
Collaborator

@rkdud007 rkdud007 commented May 2, 2024

aim to resolve #13

  • we need reward calculation logic that corresponding to n_step that static from cairo progrm (PIE) and dynamic input from delegator.
  • ideally if registry contract had deployed we could connect stake & balance_of function call to cover up delegator node behavior
  • some refactor, split of reponsibility:
    - compiler : input file path -> out put cairo PIE ( responsible of compile )
    - registry handler : responsible of streaming subscribed event. As this reponsibility moves registry handler object in mutable state, regarding other contract actions we use node account
    - node account : store identity that used in both p2p network and its corresponding starknet account / with this signer and provider, also perform read/write contract call

}

#[derive(Debug, Clone, PartialEq, Eq, PartialOrd, Ord, Serialize, Deserialize)]
pub struct JobData {
pub reward: u64,
pub reward: U256,
Copy link
Collaborator Author

Choose a reason for hiding this comment

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

I had switched the type into U256 as it's compatible with deposit function call amount input. Wondering if we could also use U256 in bootloader input type @Okm165

Copy link
Contributor

Choose a reason for hiding this comment

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

@rkdud007 I agree.
I also confirmed that on other starknet smart-contracts values/amounts are u256 so it stays this way for sure.
Feel free to change it and other necessary things on a rust side.
I will handle the bootloader compatibility in this PR.

@Okm165 Okm165 added enhancement New feature or request rust Cairo1 Cairo0 and removed Cairo1 labels May 7, 2024
@Okm165 Okm165 self-assigned this Jun 2, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Cairo0 enhancement New feature or request rust
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Delegator detail behavior implement
2 participants