-
Notifications
You must be signed in to change notification settings - Fork 229
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: minted early tracking #11066
fix: minted early tracking #11066
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Good test.
We should have a multiset abstraction. Either with durable multiset or a light wrapper to make MapStore act like one.
c8ec060
to
400b37b
Compare
Deploying agoric-sdk with
|
Latest commit: |
5597958
|
Status: | ✅ Deploy successful! |
Preview URL: | https://a55f4145.agoric-sdk.pages.dev |
Branch Preview URL: | https://pc-minted-early-fix.agoric-sdk.pages.dev |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@0xpatrickdev I pushed the changes I requested but I won't merge. PTAL
if (count <= 0) { | ||
throw Fail`Cannot add a non-positive count ${count} to bag`; | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Probably should check that count
is a Nat ?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm using number and Nat is bigint
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Sure, but we should still enforce that this in an integer, not any float.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Actually it's not just floats, but any NaN or non number values that will cause unexpected value for current count.
if (currentCount <= count) { | ||
mapStore.delete(item); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Feels like removing more than what is currently there should be an error.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
it's returning a success boolean. we can align on this when moved to another package.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Asking to remove 5 from an entry that only has 3 still returns true
, which seems incorrect.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
400b37b
to
ca5ae30
Compare
This pull request has been removed from the queue for the following reason: The merge conditions cannot be satisfied due to failing checks: You should look at the reason for the failure and decide if the pull request needs to be fixed or if you want to requeue it. If you want to requeue this pull request, you need to post a comment with the text: |
ca5ae30
to
6c3832a
Compare
This pull request has been removed from the queue for the following reason: The merge conditions cannot be satisfied due to failing checks: You should look at the reason for the failure and decide if the pull request needs to be fixed or if you want to requeue it. If you want to requeue this pull request, you need to post a comment with the text: |
b3af0a0
to
3e5eaec
Compare
- ensure multiples of the same NFA+amount are tracked
- `borrower.returnPool` already exits the seat
3e5eaec
to
5597958
Compare
This pull request has been removed from the queue for the following reason: The merge conditions cannot be satisfied due to failing checks: You should look at the reason for the failure and decide if the pull request needs to be fixed or if you want to requeue it. If you want to requeue this pull request, you need to post a comment with the text: |
### Description Cherrypicks the following changes: - #11065 - #11052 Using the following rebase-todo: ``` # PR #11065 Branch fix-cosmos-upgrade-to-agoric-labs-ibc-go-v6-3-1-alpha-agoric-3-11065- label base-fix-cosmos-upgrade-to-agoric-labs-ibc-go-v6-3-1-alpha-agoric-3-11065- pick 52fb6cf build(deps): use new version of ibc-go pick 3dbb1bc chore(golang): `go mod tidy` label pr-11065--fix-cosmos-upgrade-to-agoric-labs-ibc-go-v6-3-1-alpha-agoric-3-11065- reset base-fix-cosmos-upgrade-to-agoric-labs-ibc-go-v6-3-1-alpha-agoric-3-11065- merge -C ee18609 pr-11065--fix-cosmos-upgrade-to-agoric-labs-ibc-go-v6-3-1-alpha-agoric-3-11065- # fix(cosmos): upgrade to `agoric-labs/ibc-go` `v6.3.1-alpha.agoric.3` (#11065) # PR #11052 Branch fix-Properly-synchronize-slog-sender-termination-11052- label base-fix-Properly-synchronize-slog-sender-termination-11052- pick ec3c1a2 chore(SwingSet): Remove unused code and comments pick 9ab1630 fix(SwingSet): Include level in kernel console slog output pick fcfb944 refactor(SwingSet): Simplify makeFinishersKit into addSlogCallbacks pick d8a5947 refactor(SwingSet): Improve addSlogCallbacks parameter/variable names pick f83c01d fix: Properly synchronize slog sender termination pick 318269e chore(telemetry): Use more readable async patterns pick fa1f04a chore(SwingSet): Prefer type Callable over Function pick 117c766 fix(internal): Exempt process.stdout from being closed by makeFsStreamWriter pick 6c6fba4 refactor(internal): Prefer fs.WriteStream close() over stream.Writable end() label pr-11052--fix-Properly-synchronize-slog-sender-termination-11052- reset base-fix-Properly-synchronize-slog-sender-termination-11052- # fix: minted early tracking (#11066) merge -C 42d5764 pr-11052--fix-Properly-synchronize-slog-sender-termination-11052- # fix: Properly synchronize slog sender termination (#11052) ```
Description
Ensures the
mintedEarly
store can track multiple settlements for the same amount from the same address.Security Considerations
Ensures state diagram invariants are upheld.
Scaling Considerations
Same considerations as #10729 - the mapStore could grow large if an attacker spams the settlementAccount with uusdc. In these changes we ensure to delete map store entries when the count goes to 0.
Documentation Considerations
Changes should be clear to maintainers.
Testing Considerations
Adds a new test for the scenario not originally considered.
Upgrade Considerations
The
mintedEarly
kind is a Remotable, so changing from aSetStore
to aMapStore
does not seem to affect upgradability.These change should be included in the FUSDC GTM CE.