Skip to content

Conversation

@febo
Copy link
Contributor

@febo febo commented Nov 1, 2024

Problem

The initial PR #10 adds the Stake interface files from the SDK without their git history.

Summary of changes

Copy the files from the SDK together with their associated history using git-filter-repo:

# add the remote for the source repo
git remote add agave https://github.com/anza-xyz/agave.git
# fetch the master from agave under a different local branch
git fetch agave master:stake-from-agave
git switch stake-from-agave
# be safe, remove the remote
git remote rm agave
# filter the stake related files
python3 ../git-filter-repo \
--path sdk/program/src/stake/config.rs \
--path sdk/program/src/stake/instruction.rs  \
--path sdk/program/src/stake/mod.rs \
--path sdk/program/src/stake/stake_flags.rs \
--path sdk/program/src/stake/state.rs \
--path sdk/program/src/stake/tools.rs \
--path sdk/program/src/stake_history.rs \
--path-rename sdk/program/src/stake/config.rs:interface/src/config.rs \
--path-rename sdk/program/src/stake/instruction.rs:interface/src/instruction.rs \
--path-rename sdk/program/src/stake/mod.rs:interface/src/lib.rs \
--path-rename sdk/program/src/stake/stake_flags.rs:interface/src/stake_flags.rs \
--path-rename sdk/program/src/stake/state.rs:interface/src/state.rs \
--path-rename sdk/program/src/stake/tools.rs:interface/src/tools.rs \
--path-rename sdk/program/src/stake_history.rs:interface/src/stake_history.rs \
--force
# re-add this repo
git remote add origin https://github.com/febo/stake.git
git fetch origin master
git rebase master

mvines and others added 30 commits November 1, 2024 12:01
* Move stake state / instructions into solana_program

* Update account-decoder

* Update cli and runtime

* Update all other parts

* Commit Cargo.lock changes in programs/bpf

* Update cli stake instruction import

* Allow integer arithmetic

* Update ABI digest

* Bump rust mem instruction count

* Remove useless structs

* Move stake::id() -> stake::program::id()

* Re-export from solana_sdk and mark deprecated

* Address feedback

* Run cargo fmt
* Fix link target in doc comment

* Fix formatting of log examples in process_instruction

* Fix doc markdown in solana-gossip

* Fix doc markdown in solana-runtime

* Escape square braces in doc comments to avoid warnings

* Surround 'account references' doc items in code spans to avoid warnings

* Fix code block in loader_upgradeable_instruction

* Fix doctest for loader_upgradable_instruction
* stake: Remove v2 program references

* Remove stake v2 feature, along with stake rewrite
…#20392)

* Add struct and convenience methods to track stake activation status

* fix nits

* rename
rustfmt.toml configuration:
  imports_granularity = "One"
  group_imports = "One"
…128)

* And short descriptions to all solana-program modules and macros.

Also fill out some of the docs within these modules.

* Update sdk/program/src/lib.rs

Co-authored-by: Tyera Eulberg <[email protected]>

* Update sdk/program/src/sanitize.rs

Co-authored-by: Tyera Eulberg <[email protected]>

* Update sdk/program/src/pubkey.rs

Co-authored-by: Tyera Eulberg <[email protected]>

* Update sdk/program/src/program_memory.rs

Co-authored-by: Tyera Eulberg <[email protected]>

* Update sdk/program/src/program_memory.rs

Co-authored-by: Tyera Eulberg <[email protected]>

* Update sdk/program/src/program_memory.rs

Co-authored-by: Tyera Eulberg <[email protected]>

* Update sdk/program/src/program_memory.rs

Co-authored-by: Tyera Eulberg <[email protected]>

* Update sdk/program/src/program_memory.rs

Co-authored-by: Tyera Eulberg <[email protected]>

* Update hash module docs

* Make solana-program crate docs match Pubkey docs

* Update sdk/program/src/program_memory.rs

Co-authored-by: Tyera Eulberg <[email protected]>
* Upgrade to Rust v1.63.0

* Add nightly_clippy_allows

* Resolve some new clippy nightly lints

* Increase QUIC packets completion timeout

Co-authored-by: Michael Vines <[email protected]>
This reverts commit f48ca035dbc3aa82ef42e100b97fffbe72015ac4.
* Upgrade to Rust v1.63.0

* Add nightly_clippy_allows

* Resolve some new clippy nightly lints

* Increase QUIC packets completion timeout

* Update quinn-udp crate

Co-authored-by: Michael Vines <[email protected]>
* Bump borsh to 0.10.3

transaction-status relies on SPL which still requires borsh 0.9, so
until SPL also gets updated that package alone will use an older version of
borsh.

* ci: Temporarily disable spl and openbook-dex builds
CriesofCarrots and others added 15 commits November 1, 2024 12:01
* Add new StakeError variant

* Add closure to return error if EpochRewards::active

* Use error_during_epoch_rewards for Instructions that mutate stake accounts

* Use try instead of manually matching Ok/Err

* Consolidate error_during_epoch_rewards check

* Add new test helper

* Add test demonstrating which ix return StakeError::EpochRewardsActive

* Remove single-use fn
* make frozen-abi optional in solana-program

* fix syntax error

* activate solana-program's frozen-abi feature in dev deps of program and sdk

* undo putting solana-program itself in solana-program dev deps

* add missing whitespace

Co-authored-by: Tyera <[email protected]>

---------

Co-authored-by: Tyera <[email protected]>
clippy: legacy_numeric_constants
implement ProgramError conversion for StakeError
* make borsh optional in sdk and program

* fmt

* don't include borsh in dev-context-only-utils
implement two new instructions for moving delegated stake and undelegated lamports, respectively, between accounts with the same Authorized and Lockup using the Staker authority
* extract decode-error crate

* update decode_error dependents and re-export in sdk and program

* fmt

* fix bad import after rebase
* stake: Remove redelegate code and tests

* Mark stake flags as deprecated

* Remove usage of feature gate

* Add a changelog entry for the removal

* Remove repeated #[allow(deprecated)]s

* Re-add "redelegate-stake" command

* Remove feature

* Make CI happy -> `hidden_unless_forced()`
* fix: remove expensive versioned epoch stakes clone

* Add custom partialeq impl for dcou
* improve type safety in stake state module

* feedback

* fix new method
* extract clock crate

* update clock usage in solana-program

* fmt

* fmt after rebase

* update lock file after rebase

* fmt after rebase

* fmt after rebase

* fmt

* make serde optional in solana-clock

* fix description

Co-authored-by: Jon C <[email protected]>

* fix docs link

Co-authored-by: Jon C <[email protected]>

* fix accidental deletions from workspace members table

---------

Co-authored-by: Jon C <[email protected]>
@febo febo requested a review from joncinque November 1, 2024 12:12
@febo
Copy link
Contributor Author

febo commented Nov 1, 2024

cc: @kevinheavey

@febo
Copy link
Contributor Author

febo commented Nov 1, 2024

CI seems to be broken on master. I will fix it in a separate PR.

Copy link
Contributor

@joncinque joncinque left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good to me! The one question is whether we want to include sdk/program/src/sysvar/stake_history.rs, but I think we can do that once the sysvar trait has been extracted

@febo febo merged commit 5ea4e9b into solana-program:master Nov 11, 2024
@febo febo deleted the stake-from-agave branch November 11, 2024 16:51
@joncinque
Copy link
Contributor

It looks like this was squashed & merged instead of rebased & merged, so it doesn't put the whole history in the repo -- can you revert this and do it again with a rebase instead?

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

Successfully merging this pull request may close these issues.