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

separates durable nonce and blockhash domains (backport #25744) #25780

Merged
merged 3 commits into from
Jun 4, 2022

Conversation

mergify[bot]
Copy link
Contributor

@mergify mergify bot commented Jun 4, 2022

This is an automatic backport of pull request #25744 done by Mergify.
Cherry-pick of 5ee157f has failed:

On branch mergify/bp/v1.9/pr-25744
Your branch is up to date with 'origin/v1.9'.

You are currently cherry-picking commit 5ee157f43.
  (fix conflicts and run "git cherry-pick --continue")
  (use "git cherry-pick --skip" to skip this patch)
  (use "git cherry-pick --abort" to cancel the cherry-pick operation)

Changes to be committed:
	modified:   account-decoder/src/parse_nonce.rs
	modified:   cli/tests/nonce.rs
	modified:   cli/tests/stake.rs
	modified:   cli/tests/transfer.rs
	modified:   client/src/blockhash_query.rs
	modified:   rpc/src/transaction_status_service.rs
	modified:   runtime/src/accounts.rs
	modified:   runtime/src/bank.rs
	modified:   sdk/program/src/nonce/state/mod.rs
	modified:   sdk/src/feature_set.rs
	modified:   sdk/src/nonce_account.rs

Unmerged paths:
  (use "git add <file>..." to mark resolution)
	both modified:   cli/src/nonce.rs
	both modified:   client/src/nonce_utils.rs
	both modified:   rpc/src/rpc.rs
	both modified:   runtime/src/nonce_keyed_account.rs
	both modified:   sdk/program/src/example_mocks.rs
	both modified:   sdk/program/src/nonce/state/current.rs
	both modified:   sdk/program/src/system_instruction.rs
	both modified:   send-transaction-service/src/send_transaction_service.rs

Cherry-pick of 9851774 has failed:

On branch mergify/bp/v1.9/pr-25744
Your branch is ahead of 'origin/v1.9' by 1 commit.
  (use "git push" to publish your local commits)

You are currently cherry-picking commit 985177413.
  (fix conflicts and run "git cherry-pick --continue")
  (use "git cherry-pick --skip" to skip this patch)
  (use "git cherry-pick --abort" to cancel the cherry-pick operation)

Changes to be committed:
	modified:   sdk/src/feature_set.rs

Unmerged paths:
  (use "git add <file>..." to mark resolution)
	both modified:   runtime/src/bank.rs

To fix up this pull request, you can check it out locally. See documentation: https://docs.github.com/en/github/collaborating-with-pull-requests/reviewing-changes-in-pull-requests/checking-out-pull-requests-locally


Mergify commands and options

More conditions and actions can be found in the documentation.

You can also trigger Mergify actions by commenting on this pull request:

  • @Mergifyio refresh will re-evaluate the rules
  • @Mergifyio rebase will rebase this PR on its base branch
  • @Mergifyio update will merge the base branch into this PR
  • @Mergifyio backport <destination> will backport this PR on <destination> branch

Additionally, on Mergify dashboard you can:

  • look at your merge queues
  • generate the Mergify configuration with the config editor.

Finally, you can contact us on https://mergify.com

AdvanceNonceAccount instruction updates nonce to blockhash. This makes it
possible that a durable transaction is executed twice both as a normal
transaction and a nonce transaction if it uses blockhash (as opposed to nonce)
for its recent_blockhash field.

The commit prevents this double execution by separating nonce and blockhash
domains; when advancing nonce account, blockhash is hashed with a fixed string.
As a result a blockhash cannot be a valid nonce value; and if transaction was
once executed as a normal transaction it cannot be re-executed as a durable
transaction again and vice-versa.

(cherry picked from commit 5ee157f)

# Conflicts:
#	cli/src/nonce.rs
#	client/src/nonce_utils.rs
#	rpc/src/rpc.rs
#	runtime/src/nonce_keyed_account.rs
#	sdk/program/src/example_mocks.rs
#	sdk/program/src/nonce/state/current.rs
#	sdk/program/src/system_instruction.rs
#	send-transaction-service/src/send_transaction_service.rs
Previous commit separates durable nonce and blockhash domains with a
feature gate. A 2nd feature added in this commit enables durable nonce
at least one epoch after the 1st feature.
By the time 2nd feature is activated, some nonce accounts will have an
old blockhash, but no nonce account can have a recent blockhash.
As a result no transaction (durable or normal) can be executed twice.

(cherry picked from commit 9851774)

# Conflicts:
#	runtime/src/bank.rs
@mergify mergify bot added conflicts feature-gate Pull Request adds or modifies a runtime feature gate labels Jun 4, 2022
@mergify mergify bot added the automerge Merge this Pull Request automatically once CI passes label Jun 4, 2022
@mergify
Copy link
Contributor Author

mergify bot commented Jun 4, 2022

automerge label removed due to a CI failure

@mergify mergify bot added automerge Merge this Pull Request automatically once CI passes and removed automerge Merge this Pull Request automatically once CI passes labels Jun 4, 2022
@mergify
Copy link
Contributor Author

mergify bot commented Jun 4, 2022

automerge label removed due to a CI failure

@behzadnouri behzadnouri force-pushed the mergify/bp/v1.9/pr-25744 branch from f8ff6a3 to 6c2bc33 Compare June 4, 2022 13:13
@mergify mergify bot added the automerge Merge this Pull Request automatically once CI passes label Jun 4, 2022
@behzadnouri behzadnouri force-pushed the mergify/bp/v1.9/pr-25744 branch from 6c2bc33 to 2feeb4f Compare June 4, 2022 13:18
@solana-grimes solana-grimes removed the automerge Merge this Pull Request automatically once CI passes label Jun 4, 2022
@solana-grimes
Copy link
Contributor

😱 New commits were pushed while the automerge label was present.

@mergify mergify bot added the automerge Merge this Pull Request automatically once CI passes label Jun 4, 2022
@mergify mergify bot merged commit 7215dcb into v1.9 Jun 4, 2022
@mergify mergify bot deleted the mergify/bp/v1.9/pr-25744 branch June 4, 2022 15:03
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
automerge Merge this Pull Request automatically once CI passes conflicts feature-gate Pull Request adds or modifies a runtime feature gate
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants