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

Enable a rolling update of "Permit paying oneself" #10374

Closed
mvines opened this issue Jun 2, 2020 · 10 comments
Closed

Enable a rolling update of "Permit paying oneself" #10374

mvines opened this issue Jun 2, 2020 · 10 comments
Milestone

Comments

@mvines
Copy link
Member

mvines commented Jun 2, 2020

#10337 will cause a hard fork if anybody sends a transfer to themselves with a collection of mixed validator nodes with/without this PR.

This affects both 1.2 and 1.1 and blocks an update of testnet and mainnet-beta

Options:

  1. Back out Permit paying oneself #10337 entirely
  2. Duplicate the system program, old and new version, and at a well-defined epoch swap in the new version
@mvines mvines added this to the v1.1.16 milestone Jun 2, 2020
@garious
Copy link
Contributor

garious commented Jun 2, 2020

What about rejecting payment to self below a particular epoch?

@mvines
Copy link
Member Author

mvines commented Jun 2, 2020

It's a plumbing problem, system program doesn't have epoch info

@garious
Copy link
Contributor

garious commented Jun 2, 2020

Coincidentally, builtins have a different process_instruction signature than the ones loaders call. You can pass in whatever you'd like, so long as you pass it to all builtins. https://github.com/solana-labs/solana/blob/master/runtime/src/message_processor.rs#L295

@garious
Copy link
Contributor

garious commented Jun 2, 2020

Also, keep in mind you can register the same process_instruction with multiple program IDs. The program ID is passed to process_instruction, which you can use to toggle operational semantics as-needed. This isn't a hack - it's actually what that program_id parameter was intended for.

@mvines
Copy link
Member Author

mvines commented Jun 2, 2020

Making everybody jump to System211111... doesn't sound nice though

@garious
Copy link
Contributor

garious commented Jun 3, 2020

You don't need to. The trick is that you use System2 to represent the old behavior, not the new. Then, just add a special case such that before a certain epoch, System1 is swapped with System2.

@mvines
Copy link
Member Author

mvines commented Jun 3, 2020

The paths through bank to do this are very sneaky, unless you're seeing something I'm not.

@garious
Copy link
Contributor

garious commented Jun 3, 2020

Thinking either here:
https://github.com/solana-labs/solana/blob/master/runtime/src/bank.rs#L1372

Or pass the epoch into process_message and do the swap in its for loop.

@mvines
Copy link
Member Author

mvines commented Jun 3, 2020

Here's the direction I'm thinking of, wdyt? #10375

@mvines
Copy link
Member Author

mvines commented Jun 8, 2020

Done.

@mvines mvines closed this as completed Jun 8, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants