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

blank transitions are built with the invoice iface #276

Open
zoedberg opened this issue Oct 3, 2024 · 3 comments
Open

blank transitions are built with the invoice iface #276

zoedberg opened this issue Oct 3, 2024 · 3 comments
Assignees
Labels
enhancement New feature or request
Milestone

Comments

@zoedberg
Copy link
Contributor

zoedberg commented Oct 3, 2024

The Stock::blank_builder and TransitionBuilder::blank_transition methods require an iface in order to construct a blank transition. I expect it to get the iface of the asset that is being moving with the blank transition. But currently it's getting the iface of the asset being requested through the invoice. After checking the involved code this seems a bug to me.

@dr-orlovsky
Copy link
Member

Blank state transitions are not related to any specific interface, since they use a reserved transition type, which can't be used by any of the interfaces. So it actually doesn't matter which iface is used - but I think it could be an enhancement just to remove the second parameter from the Stock::blank_builder method

@dr-orlovsky dr-orlovsky self-assigned this Oct 3, 2024
@dr-orlovsky dr-orlovsky added the enhancement New feature or request label Oct 3, 2024
@zoedberg
Copy link
Contributor Author

zoedberg commented Oct 3, 2024

It doesn't seem so easy to remove the iface since it's used in several places (for example to extract the types for the OperationBuilder). I'm worried this might be hiding some bugs that aren't showing up because the interfaces of NIA, CFA and UDA (the only schemas we have tests for) are very similar. So if you're sure we can just remove the iface parameter from Stock::blank_builder and TransitionBuilder::blank_transition methods then please, let's do this relatively quickly.

@dr-orlovsky
Copy link
Member

Ok, I see that blank_transition returns the same TransitionBuilder, just pre-set with a proper transition type. So, to remove iface argument we need to implement a new BlankBuilder struct. Since we closed v0.11.0 for everything other than critical security fixes, that should be scheduled for v0.11.1.

I do not see how the current code can lead to bugs. Anyway, adding new builder won't be a breaking change or touch anything at the consensus, so even if there is a bug, it can always be fixed later when discovered.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants