-
Notifications
You must be signed in to change notification settings - Fork 45
feat: implement TEP-503 changes #89
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
base: main
Are you sure you want to change the base?
Conversation
|
Thanks for working on TEP-503 implementation. I've reviewed the changes and want to share some concerns about the current approach. The main issue is that this introduces a breaking change by renaming I came across this gist https://gist.github.com/mr-tron/89161b6c839d7b92bdce2de6c92ee2bd that shows an approach with two distinct types: What I'm uncertain about is whether to keep the existing Another concern is the The approach with separate message types in the union would make the structure clearer and provide better foundation for reasoning about backward compatibility. However, this is something to consider for future updates. For the current release, we should focus on finding a solution that doesn't break existing code while still enabling TEP-503 functionality. Breaking compatibility now would impact the entire ecosystem, so we need to think carefully about a transition strategy that works both short-term and long-term. |
|
I agree on the breaking change part. If we want to introduce it, we should do it in a more thought through way. I think we should not change CommonMessageInfoInternal struct in this PR, instead we should start by adding new types introduced to blockchain(new_bounce_body) and keep it backwards compatible, so users can still update and use new types, but won't need to refactor their entire codebase. For easier access and upgrade in the future we can make a function that accepts struct like CommonMessageInfoInternal or Coins and slice to parse and returns appropriate body function loadNewBody(flagsInfo: CommonMessageInfoInternal | bigint | MessageBounceFlags, data: Slice): OldBody | NewBounceBodyThat way we can later introduce more message formats and still keep compatibility. I also think that we should not parse extra flags to single structure or enum MessageFlags since we would need to update it if new flags are added in the future. Instead we can keep it as coins and have simple functions that accept coins field as input and return corresponding flags type MessageBounceFlags = 'truncate' | 'body-root' | 'whole-body'
function parseMessageBodyFlags(flags: bigint): MessageBounceFlags |
| ihrDisabled: boolean, | ||
| bounce: boolean, | ||
| bounced: boolean, | ||
| src?: Maybe<Address>, |
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
TEP 503: ton-blockchain/TEPs#503