Skip to content

feat: Fast Bridge unhappy path #60

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

Merged
merged 1 commit into from
Apr 7, 2022
Merged

feat: Fast Bridge unhappy path #60

merged 1 commit into from
Apr 7, 2022

Conversation

jaybuidl
Copy link
Member

Resolves #53

@shotaronowhere
Copy link
Contributor

Should use storage instead of memory to persist state changes in struct L94, L134, etc.

I fixed the registered mapping logic in the challenge-path-2-merkle-root branch. I think the single message fast bridge should implement a similar pattern for safe send.

Apologies, the fix I just pushed was supposed to be included in the original push, but I had 2 code editors open at the same time and on overwrote the other.

@jaybuidl
Copy link
Member Author

jaybuidl commented Apr 4, 2022

Why close the PR thou..

@jaybuidl jaybuidl reopened this Apr 4, 2022
@jaybuidl
Copy link
Member Author

jaybuidl commented Apr 4, 2022

Should use storage instead of memory to persist state changes in struct L94, L134, etc.

Fixed

@jaybuidl jaybuidl force-pushed the feat/challenge-path-2 branch from fb4b661 to 5ef660d Compare April 5, 2022 10:01
Copy link
Contributor

@shotaronowhere shotaronowhere left a comment

Choose a reason for hiding this comment

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

@jaybuidl jaybuidl force-pushed the feat/challenge-path-2 branch from 90cf1bc to 7bc2272 Compare April 5, 2022 18:02
@jaybuidl
Copy link
Member Author

jaybuidl commented Apr 5, 2022

  1. Unpredictable hashes using the block numbers.

Implemented

  1. Challenger reward lower than the Bridger's one.

Can be done via configuration/governance.

  1. Claims rate-limited to a period equivalent to the batching period.

Will be done in the branch feat/challenge-path-with-merkle-proof.

  1. Null message to prove the non-existence of a ticketID.

Implemented this in a separate branch feat/challenge-path-2-null-message, it introduces extra complexity and edge cases which may not be necessary given 2. 3. and 4. .

@jaybuidl jaybuidl requested a review from shotaronowhere April 5, 2022 18:36
@shotaronowhere
Copy link
Contributor

shotaronowhere commented Apr 6, 2022

  1. Challenger reward lower than the Bridger's one.

Can be done via configuration/governance.

Governance / configuration can only change the challenger and claim deposit size. In order to change the pay-out of the challenger, we need to modify L170
To something like:

uint public constant ALPHA_DIVISOR = 1e4;
uint public rewardBurnRatio = 5e3; // half reward, half burnt

uint256 amount = ticket.claim.claimDeposit*rewardBurnRatio/ALPHA_DIVISOR + ticket.challenge.challengeDeposit;

And let governance update / change the rewardBurnRatio. Or to be honest, maybe rewardBurnRatio should be immutable.

To make sure that a dishonest claim -> self challenge does not result in a zero-cost delay grief.

shotaronowhere
shotaronowhere previously approved these changes Apr 7, 2022
hrishibhat
hrishibhat previously approved these changes Apr 7, 2022
Copy link
Contributor

@hrishibhat hrishibhat left a comment

Choose a reason for hiding this comment

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

Looks good.

@jaybuidl jaybuidl closed this Apr 7, 2022
@jaybuidl jaybuidl force-pushed the feat/challenge-path-2 branch from bd983f3 to 388fe48 Compare April 7, 2022 18:50

Verified

This commit was created on GitHub.com and signed with GitHub’s verified signature. The key has expired.
…e interface level
@jaybuidl jaybuidl reopened this Apr 7, 2022
@jaybuidl jaybuidl dismissed stale reviews from hrishibhat and shotaronowhere via 4e393e3 April 7, 2022 20:46
@codeclimate
Copy link

codeclimate bot commented Apr 7, 2022

Code Climate has analyzed commit 4e393e3 and detected 0 issues on this pull request.

View more on Code Climate.

@jaybuidl jaybuidl deleted the feat/challenge-path-2 branch November 24, 2022 03:10
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Fast Bridging: unhappy path, no extra hop
3 participants