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

Fix interaction with max and unbounded overdraft #474

Closed
wants to merge 1,336 commits into from

Conversation

Azorlogh
Copy link
Contributor

@Azorlogh Azorlogh commented Dec 20, 2023

Fixes #473

Bug explanation:
Each source is associated with an optional fallback account that is used to fund any missing amount from that source.
When using the max source, it will use the OP_TAKE_MAX instruction to cap the subsource's funding.
OP_TAKE_MAX returns the amount missing to max out (or 0), and the amount remaining if it was already maxed out.
When the subsource has no fallback, the amount missing is simply discarded
When the subsource has a fallback, the amount missing should be taken from it unconditionally to max out the funding, which should be done with the OP_TAKE_ALWAYS instruction.

flemzord and others added 30 commits February 9, 2023 15:00
subrepo:
  subdir:   "components/ledger"
  merged:   "565dedc7"
upstream:
  origin:   "ledger"
  branch:   "main"
  commit:   "565dedc7"
git-subrepo:
  version:  "0.4.5"
  origin:   "???"
  commit:   "???"
Co-authored-by: Antoine Gelloz <[email protected]>
Co-authored-by: Maxence Maireaux <[email protected]>
Co-authored-by: Geoffrey Ragot <[email protected]>
Co-authored-by: Maxence Maireaux <[email protected]>
Signed-off-by: Clément Salaün <[email protected]>
gfyrag and others added 21 commits December 4, 2023 16:45
…bs/go-libs (#896)

Signed-off-by: dependabot[bot] <[email protected]>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: Maxence Maireaux <[email protected]>
… to 24.0.7+incompatible in /components/ledger/libs (#905)

Signed-off-by: dependabot[bot] <[email protected]>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: Maxence Maireaux <[email protected]>
… to 24.0.7+incompatible in /components/ledger (#903)

Signed-off-by: dependabot[bot] <[email protected]>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: Maxence Maireaux <[email protected]>
….23 in /components/ledger/libs (#912)

Signed-off-by: dependabot[bot] <[email protected]>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
…mponents/ledger/libs (#914)

Signed-off-by: dependabot[bot] <[email protected]>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
….23 in /libs/go-libs (#910)

Signed-off-by: dependabot[bot] <[email protected]>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: Maxence Maireaux <[email protected]>
* chore(deps): bump actions/setup-go from 3 to 4 (#463)

Bumps [actions/setup-go](https://github.com/actions/setup-go) from 3 to 4.
- [Release notes](https://github.com/actions/setup-go/releases)
- [Commits](actions/setup-go@v3...v4)

---
updated-dependencies:
- dependency-name: actions/setup-go
  dependency-type: direct:production
  update-type: version-update:semver-major
...

Signed-off-by: dependabot[bot] <[email protected]>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>

* chore(deps): bump docker/login-action from 2 to 3 (#466)

Bumps [docker/login-action](https://github.com/docker/login-action) from 2 to 3.
- [Release notes](https://github.com/docker/login-action/releases)
- [Commits](docker/login-action@v2...v3)

---
updated-dependencies:
- dependency-name: docker/login-action
  dependency-type: direct:production
  update-type: version-update:semver-major
...

Signed-off-by: dependabot[bot] <[email protected]>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>

* chore(deps): bump goreleaser/goreleaser-action from 4 to 5 (#464)

Bumps [goreleaser/goreleaser-action](https://github.com/goreleaser/goreleaser-action) from 4 to 5.
- [Release notes](https://github.com/goreleaser/goreleaser-action/releases)
- [Commits](goreleaser/goreleaser-action@v4...v5)

---
updated-dependencies:
- dependency-name: goreleaser/goreleaser-action
  dependency-type: direct:production
  update-type: version-update:semver-major
...

Signed-off-by: dependabot[bot] <[email protected]>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>

---------

Signed-off-by: dependabot[bot] <[email protected]>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
@flemzord flemzord changed the base branch from main to release/v1.10 December 20, 2023 21:12
@flemzord flemzord self-requested a review as a code owner December 20, 2023 21:12
@flemzord flemzord changed the base branch from release/v1.10 to main December 20, 2023 21:13
@edwardmp
Copy link
Contributor

@flemzord hope this bugfix can be merged soon :)

@flemzord
Copy link
Member

@edwardmp Yes, this PR will be merged into the v2 ledger. However, we need another fix for the v1 ledger.

@edwardmp
Copy link
Contributor

@flemzord will this still get backported to v1? Thanks

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.

NumScript max operator doesn't work correctly when source account has negative balance
10 participants