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

Number of required_signatures could be different with actual number of signatures required for transactions validation #74

Closed
akolotov opened this issue May 5, 2018 · 0 comments
Assignees

Comments

@akolotov
Copy link
Contributor

akolotov commented May 5, 2018

The validators information is completely configured through bridge contracts and does not depend on authorities.required_signatures parameter of the bridge configuration.
The number of validators also could be changed during run-time and therefore authorities.required_signatures parameter will not reflect actual number of signatures required for a transaction validation.

The number of required signatures is required during withdraw_relay process to fetch signatures from foreign contract:
https://github.com/poanetwork/poa-bridge/blob/009d40aa504e7a48ddae6e965863b0338a8ebb0e/bridge/src/bridge/withdraw_relay.rs#L130-L134
Since the value of this parameter is picked up from configuration file it could be different from the actual number of signatures and it could cause:

  1. the bridge cannot fetch enough number of signatures if the the value stored in the contract is greater than the value from the bridge config, so it will not be able to relay withdraws.
  2. the bridge will fail on fetching signatures in the line
    https://github.com/poanetwork/poa-bridge/blob/009d40aa504e7a48ddae6e965863b0338a8ebb0e/bridge/src/bridge/withdraw_relay.rs#L51
    if the value stored in the contract is less than the value from the bridge configuration file.

The suggested changes are:

  1. To get the address of Bridge Validators contracts from both home and foreign side.
  2. To invoke requiredSignatures() on the foreign side for the same block which contains CollectedSignatures (an option could be to listen the event which will be introduced under setRequiredSignatures must raise an event to upgrade values on the bridge instances tokenbridge-contracts#27 as so update the value in the bridge instance on demand instead of polling)
  3. To relay withdraw with the number of required signatures got in the step 2.

The situation when numbers of required signatures are different on both sides of bridges will be handled by monitoring. In order to make sure that number of the same the procedure to add/remove validators should make sure that no withdraw transactions are being sent at the moment of changing number of required signatures.

yrashk added a commit to yrashk/parity-bridge that referenced this issue May 11, 2018
Validators' information is completely configured through bridge
contracts and does not depend on `authorities.required_signatures`
parameter of bridge's configuration.

The number of validators also could be changed during run-time and
therefore `authorities.required_signatures` parameter will not reflect
the actual number of signatures required for transaction validation.

Solution: retrieve required_signatures from RequiredSignaturesChanged
event

Closes omni#74
yrashk added a commit to yrashk/parity-bridge that referenced this issue May 18, 2018
Validators' information is completely configured through bridge
contracts and does not depend on `authorities.required_signatures`
parameter of bridge's configuration.

The number of validators also could be changed during run-time and
therefore `authorities.required_signatures` parameter will not reflect
the actual number of signatures required for transaction validation.

Solution: retrieve required_signatures from RequiredSignaturesChanged
event

Closes omni#74
yrashk added a commit to yrashk/parity-bridge that referenced this issue May 19, 2018
Validators' information is completely configured through validators
contracts and does not depend on `authorities.required_signatures`
parameter of bridge's configuration.

The number of validators also could be changed during run-time and
therefore `authorities.required_signatures` parameter will not reflect
the actual number of signatures required for transaction validation.

Solution: retrieve required_signatures from RequiredSignaturesChanged
event and requiredSignatures() method

Closes omni#74
@ghost ghost assigned yrashk May 19, 2018
@ghost ghost added the in progress label May 19, 2018
yrashk added a commit to yrashk/parity-bridge that referenced this issue May 19, 2018
Validators' information is completely configured through validators
contracts and does not depend on `authorities.required_signatures`
parameter of bridge's configuration.

The number of validators also could be changed during run-time and
therefore `authorities.required_signatures` parameter will not reflect
the actual number of signatures required for transaction validation.

Solution: retrieve required_signatures from RequiredSignaturesChanged
event and requiredSignatures() method

Closes omni#74
yrashk added a commit to yrashk/parity-bridge that referenced this issue May 19, 2018
Validators' information is completely configured through validators
contracts and does not depend on `authorities.required_signatures`
parameter of bridge's configuration.

The number of validators also could be changed during run-time and
therefore `authorities.required_signatures` parameter will not reflect
the actual number of signatures required for transaction validation.

Solution: retrieve required_signatures from RequiredSignaturesChanged
event and requiredSignatures() method

Closes omni#74
yrashk added a commit to yrashk/parity-bridge that referenced this issue May 19, 2018
Validators' information is completely configured through validators
contracts and does not depend on `authorities.required_signatures`
parameter of bridge's configuration.

The number of validators also could be changed during run-time and
therefore `authorities.required_signatures` parameter will not reflect
the actual number of signatures required for transaction validation.

Solution: retrieve required_signatures from RequiredSignaturesChanged
event and requiredSignatures() method

Closes omni#74
@ghost ghost removed the in progress label Jul 5, 2018
noot pushed a commit to noot/poa-bridge that referenced this issue Jul 18, 2018
Validators' information is completely configured through validators
contracts and does not depend on `authorities.required_signatures`
parameter of bridge's configuration.

The number of validators also could be changed during run-time and
therefore `authorities.required_signatures` parameter will not reflect
the actual number of signatures required for transaction validation.

Solution: retrieve required_signatures from RequiredSignaturesChanged
event and requiredSignatures() method

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

No branches or pull requests

2 participants