Add new float host functions and versioning rules#504
Open
sappenin wants to merge 40 commits into
Open
Conversation
sappenin
commented
Mar 23, 2026
Collaborator
- Updated §5.8 (Floats) preamble to describe OpaqueFloat as a general-purpose 12-byte buffer (4-byte exponent + 8-byte mantissa), document the rounding_modes values, and drop the IOU-specific framing
- Added six new host functions to §5.8 (all at 1000 gas, consistent with existing float operations)
- Added §5.11 Host Function Versioning Rules, covering the immutability of deployed host functions and the requirement to introduce new function names if buffer layouts change
- Updated §5.8 (Floats) preamble to describe OpaqueFloat as a general-purpose 12-byte buffer (4-byte exponent + 8-byte mantissa), document the rounding_modes values, and drop the IOU-specific framing - Added six new host functions to §5.8 (all at 1000 gas, consistent with existing float operations) - Added §5.11 Host Function Versioning Rules, covering the immutability of deployed host functions and the requirement to introduce new function names if buffer layouts change Signed-off-by: David Fuelling <sappenin@gmail.com>
Signed-off-by: David Fuelling <sappenin@gmail.com>
sappenin
commented
Mar 23, 2026
sappenin
commented
Mar 24, 2026
sappenin
commented
Mar 24, 2026
Contributor
|
Because a smart escrow should store the mantissa and exponent as separate integers in a contract-defined format if the smart escrow needs to persist the opaque float in the ledger. It needs a way to get the mantissa and exponent, through a new host function: float_to_mantissa_and_exponent( Does it need a rounding mode? Not, right? |
Signed-off-by: David Fuelling <sappenin@gmail.com>
Signed-off-by: David Fuelling <sappenin@gmail.com>
sappenin
commented
Mar 24, 2026
sappenin
commented
Mar 24, 2026
Signed-off-by: David Fuelling <sappenin@gmail.com>
Collaborator
Author
|
@pwang200 I addressed your comment above via e56c1b9 |
sappenin
commented
Mar 24, 2026
sappenin
commented
Mar 24, 2026
sappenin
commented
Mar 24, 2026
pwang200
reviewed
Mar 27, 2026
pwang200
reviewed
Mar 27, 2026
Signed-off-by: David Fuelling <sappenin@gmail.com>
Signed-off-by: David Fuelling <sappenin@gmail.com>
Signed-off-by: David Fuelling <sappenin@gmail.com>
gip
reviewed
Mar 30, 2026
sappenin
commented
Apr 14, 2026
Collaborator
Author
|
@pwang200 said:
We decided that we don't, because the float is already rounded. |
sappenin
commented
Apr 14, 2026
sappenin
commented
Apr 14, 2026
sappenin
commented
Apr 14, 2026
sappenin
commented
Jun 23, 2026
Remove specific byte layout
sappenin
commented
Jun 23, 2026
sappenin
commented
Jun 23, 2026
Fix byte ordering.
pwang200
reviewed
Jun 23, 2026
sappenin
commented
Jun 23, 2026
oleks-rip
approved these changes
Jun 23, 2026
oleks-rip
reviewed
Jun 23, 2026
sappenin
commented
Jun 23, 2026
Signed-off-by: David Fuelling <sappenin@gmail.com>
oleks-rip
reviewed
Jun 23, 2026
oleks-rip
reviewed
Jun 23, 2026
oleks-rip
reviewed
Jun 23, 2026
oleks-rip
reviewed
Jun 23, 2026
oleks-rip
reviewed
Jun 23, 2026
oleks-rip
reviewed
Jun 23, 2026
sappenin
commented
Jun 24, 2026
Signed-off-by: David Fuelling <sappenin@gmail.com>
…dards into df/update-host-functions
oleks-rip
approved these changes
Jun 24, 2026
pwang200
approved these changes
Jun 24, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.