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(c-bridge): force min collateral #2468

Open
wants to merge 78 commits into
base: 2.0-master
Choose a base branch
from

Conversation

guidiaz
Copy link
Contributor

@guidiaz guidiaz commented May 31, 2024

No description provided.

aesedepece and others added 30 commits February 12, 2024 17:59
This method allows to query the stakes of the specified argument.
The argument can contain:
- A validator and a withdrawer
- A validator
- A withdrawer
- Empty argument, uses the node's address as validator.

The type of the argument is an address as a string.
 Please enter the commit message for your changes. Lines starting
guidiaz added 20 commits May 29, 2024 17:31
- adapt to wsb v2.0
- report dr_tally_tx_hash instead of dr_tx_hash
- low evm funds alert
- detect and dismiss already reported queries
- adapt to wsb v2.0
- reject queries with collateral too low (<20 wit)
- reject queries with total wit value too high
- set dr tx fee to the minimum of query sla and config
- polling rate set to half of eth_pollers'
- log trace reporting witnet node's pkh
- adapt to wsb v2.0
- limit max batch sizes by config
- extract dr_tally_tx_hash from wit_dataRequestReport
- calculate dr_timestamp as that of the block where the dr commit txs were included
@guidiaz guidiaz requested a review from Tommytrg May 31, 2024 11:46
@guidiaz guidiaz force-pushed the c-bridge/force-min-collateral branch from 2a8be75 to b540f8b Compare June 4, 2024 13:01
dr_min_collateral_nanowits,
reward_collateral_ratio,
);
log::warn!("DRO [{}]: witnessing collateral ({}) increased to mininum ({})", dro_hash, dro_prev_collateral, dr_min_collateral_nanowits);
Copy link
Member

Choose a reason for hiding this comment

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

Suggested change
log::warn!("DRO [{}]: witnessing collateral ({}) increased to mininum ({})", dro_hash, dro_prev_collateral, dr_min_collateral_nanowits);
log::warn!("DRO [{}]: witnessing collateral ({}) increased to minimum ({})", dro_hash, dro_prev_collateral, dr_min_collateral_nanowits);

@@ -310,12 +311,11 @@ fn deserialize_and_validate_dr_bytes(
match DataRequestOutput::from_pb_bytes(dr_bytes) {
Err(e) => Err(DrSenderError::Deserialization { msg: e.to_string() }),
Ok(dr_output) => {
let required_reward_collateral_ratio =
PSEUDO_CONSENSUS_CONSTANTS_WIP0022_REWARD_COLLATERAL_RATIO;
let mut dr_output = dr_output.clone();
Copy link
Member

Choose a reason for hiding this comment

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

I think this .clone isn't necessary

Suggested change
let mut dr_output = dr_output.clone();
let mut dr_output = dr_output;

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants