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

Implement bonds for fortification #1853

Open
wants to merge 20 commits into
base: main
Choose a base branch
from
Open

Implement bonds for fortification #1853

wants to merge 20 commits into from

Conversation

joshua-kim
Copy link
Contributor

@joshua-kim joshua-kim commented Jan 7, 2025

Implements bonds by maintaining state of an account's pending + max bond balance

@joshua-kim joshua-kim marked this pull request as ready for review January 7, 2025 18:48
_ fdsmr.Bonder[*Transaction] = (*Bonder)(nil)
)

type BondBalance struct {
Copy link
Contributor Author

Choose a reason for hiding this comment

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

TODO use canoto

chain/bond.go Outdated
// Bonder maintains state of account bond balances to limit the amount of
// pending transactions per account
type Bonder struct {
db database.Database
Copy link
Contributor Author

@joshua-kim joshua-kim Jan 7, 2025

Choose a reason for hiding this comment

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

Q: should we be using a db for this? Or should this be stored in state?

chain/transaction.go Outdated Show resolved Hide resolved
Signed-off-by: Joshua Kim <[email protected]>
Signed-off-by: Joshua Kim <[email protected]>
Signed-off-by: Joshua Kim <[email protected]>
Signed-off-by: Joshua Kim <[email protected]>
Signed-off-by: Joshua Kim <[email protected]>
Signed-off-by: Joshua Kim <[email protected]>
Signed-off-by: Joshua Kim <[email protected]>
Signed-off-by: Joshua Kim <[email protected]>
Signed-off-by: Joshua Kim <[email protected]>
Signed-off-by: Joshua Kim <[email protected]>
Signed-off-by: Joshua Kim <[email protected]>
Signed-off-by: Joshua Kim <[email protected]>
Signed-off-by: Joshua Kim <[email protected]>
Signed-off-by: Joshua Kim <[email protected]>
Signed-off-by: Joshua Kim <[email protected]>
Signed-off-by: Joshua Kim <[email protected]>
Signed-off-by: Joshua Kim <[email protected]>
Signed-off-by: Joshua Kim <[email protected]>
@joshua-kim joshua-kim self-assigned this Jan 10, 2025
Signed-off-by: Joshua Kim <[email protected]>
chain/bond.go Show resolved Hide resolved
return false, nil
}

balance.Pending++
Copy link
Collaborator

Choose a reason for hiding this comment

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

Shouldn't this be a fee amount as opposed to incrementing by one? Technically, we only need to make sure that it can pay for bandwidth, not MDF.

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.

3 participants