sui icon indicating copy to clipboard operation
sui copied to clipboard

[Move] relax restrictions on allowed types in entrypoints

Open sblackshear opened this issue 2 years ago • 4 comments

There are a few recurring requests for allowing the following types as entrypoint arguments that I think we should consider granting:

  • object::ID
  • ASCII::String
  • string::String (i.e., UTF8 strings)

Without these, it is hard for entrypoint type signatures to fully convey the intention of the entrypoint.

sblackshear avatar May 18 '22 17:05 sblackshear

CC @kchalkias @oxade

sblackshear avatar May 18 '22 17:05 sblackshear

ASCII::String would be a bit tricky since it would require deserializing the argument to do the verification, which isn't something we need today.

Could also be a bit expensive (depending on the size of the data), and then not captured in gas...

tnowacki avatar May 20 '22 22:05 tnowacki

Good points @tnowacki, is there a way that we enforce deserialization and verification after signature verification? so it's included in gas if it fails?

kchalkias avatar May 20 '22 22:05 kchalkias

Its about metering more than anything. I think you should just manually convert/verify the string once you are in Move so you have a well metered environment, which clear semantics about the gas usage/metering.

Things like ID or even Option for that matter are much easier as they do not have the same concerns

tnowacki avatar May 20 '22 23:05 tnowacki