Skip to content
This repository has been archived by the owner on Jan 13, 2025. It is now read-only.

Account interface that works with overlays. #2595

Merged
merged 1 commit into from
Jan 30, 2019

Conversation

aeyakovenko
Copy link
Member

Problem

Account interface handles last_id and signature dup verification. It should only handle accounts, and it needs to work with overlays for checkpointing and forking.

Summary of Changes

  • Move last_id/sig dup checks out of accounts
  • handle overlays in the load apis

Fixes #

@codecov
Copy link

codecov bot commented Jan 30, 2019

Codecov Report

❗ No coverage uploaded for pull request base (master@a0bed53). Click here to learn what that means.
The diff coverage is 85.9%.

@@           Coverage Diff            @@
##             master   #2595   +/-   ##
========================================
  Coverage          ?   78.1%           
========================================
  Files             ?     112           
  Lines             ?   18250           
  Branches          ?       0           
========================================
  Hits              ?   14255           
  Misses            ?    3995           
  Partials          ?       0

@codecov
Copy link

codecov bot commented Jan 30, 2019

Codecov Report

❗ No coverage uploaded for pull request base (master@668d353). Click here to learn what that means.
The diff coverage is 87.8%.

@@           Coverage Diff            @@
##             master   #2595   +/-   ##
========================================
  Coverage          ?   77.7%           
========================================
  Files             ?     112           
  Lines             ?   18156           
  Branches          ?       0           
========================================
  Hits              ?   14108           
  Misses            ?    4048           
  Partials          ?       0

src/bank.rs Show resolved Hide resolved
@aeyakovenko aeyakovenko added the automerge Merge this Pull Request automatically once CI passes label Jan 30, 2019
@solana-grimes solana-grimes removed the automerge Merge this Pull Request automatically once CI passes label Jan 30, 2019
@solana-grimes
Copy link
Contributor

💔 Unable to automerge due to CI failure

@aeyakovenko aeyakovenko added the automerge Merge this Pull Request automatically once CI passes label Jan 30, 2019
@solana-grimes
Copy link
Contributor

💔 Unable to automerge due to CI failure

@solana-grimes solana-grimes removed the automerge Merge this Pull Request automatically once CI passes label Jan 30, 2019
if account.tokens == 0 {
self.accounts.remove(pubkey);
if purge {
Copy link
Contributor

Choose a reason for hiding this comment

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

purge is hurting my brain... is that only set on collapse of a fork?

Copy link
Member Author

Choose a reason for hiding this comment

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

@rob-solana, yea when merging into root it’s set to true. I could probably hide it better.

Copy link
Contributor

@rob-solana rob-solana Jan 30, 2019

Choose a reason for hiding this comment

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

you could accept the same &[U] argument as load() does and deduce purge by checkpoints.len()?

@@ -178,7 +179,7 @@ impl Bank {
loader: solana_native_loader::id(),
};
self.accounts
.store_slow(&system_program::id(), &system_program_account);
.store_slow(true, &system_program::id(), &system_program_account);
Copy link
Contributor

Choose a reason for hiding this comment

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

if you store(tokens=0) with purge=true onto a fork with a parent, it exposes the parent's state, right?

* Move last_id and signature dup handling out of Accounts.
* Accounts that handle overlays.
@aeyakovenko aeyakovenko added the automerge Merge this Pull Request automatically once CI passes label Jan 30, 2019
@solana-grimes solana-grimes merged commit 1c0758e into solana-labs:master Jan 30, 2019
@aeyakovenko
Copy link
Member Author

part of #2289

lijunwangs pushed a commit to lijunwangs/solana that referenced this pull request Aug 15, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
automerge Merge this Pull Request automatically once CI passes
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants