2497 Commits

Author SHA1 Message Date
250a8503fe Make rewards tracer async friendly (#20452) 2021-10-05 21:30:08 -04:00
d03bf2bbfe AcctIdx: metrics fixes (#20449) 2021-10-05 22:26:29 +00:00
4267419349 AcctIdx: sleep thread when enough threads are running to complete the remaining work (#20446) 2021-10-05 16:48:23 -05:00
0d98a91511 AcctIdx: metric for bucket grow time (#20445) 2021-10-05 20:22:01 +00:00
64cf354651 Add clean metrics (#20410) 2021-10-04 18:21:45 -05:00
2d78f8ad2a parallelize unref_from_storage from clean_dead_slots_from_accounts_index (#20411) 2021-10-04 18:20:10 -05:00
0ddb34a0b4 Add struct and convenience methods to track stake activation status (#20392)
* Add struct and convenience methods to track stake activation status

* fix nits

* rename
2021-10-04 18:59:11 -04:00
b6a6d6986d lift store.slot() from loop (#20409) 2021-10-04 16:07:01 -05:00
8da2eb980a AcctIdx: introduce BucketApi for access to a specific bucket (#20359) 2021-10-04 11:48:09 -05:00
e31c065544 AcctIdx: when disk index insert needs to grow, drop locks, grow, then restart flush (#20333) 2021-09-30 19:27:09 -04:00
fe97cb2ddf AccountsDb plugin framework (#20047)
Summary of Changes

Create a plugin mechanism in the accounts update path so that accounts data can be streamed out to external data stores (be it Kafka or Postgres). The plugin mechanism allows

Data stores of connection strings/credentials to be configured,
Accounts with patterns to be streamed
PostgreSQL implementation of the streaming for different destination stores to be plugged in.

The code comprises 4 major parts:

accountsdb-plugin-intf: defines the plugin interface which concrete plugin should implement.
accountsdb-plugin-manager: manages the load/unload of plugins and provide interfaces which the validator can notify of accounts update to plugins.
accountsdb-plugin-postgres: the concrete plugin implementation for PostgreSQL
The validator integrations: updated streamed right after snapshot restore and after account update from transaction processing or other real updates.
The plugin is optionally loaded on demand by new validator CLI argument -- there is no impact if the plugin is not loaded.
2021-09-30 14:26:17 -07:00
9ef1f06b3f chore: bump ouroboros from 0.11.1 to 0.12.0 (#20344)
* chore: bump ouroboros from 0.11.1 to 0.12.0

Bumps [ouroboros](https://github.com/joshua-maros/ouroboros) from 0.11.1 to 0.12.0.
- [Release notes](https://github.com/joshua-maros/ouroboros/releases)
- [Commits](https://github.com/joshua-maros/ouroboros/commits)

---
updated-dependencies:
- dependency-name: ouroboros
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>

* [auto-commit] Update all Cargo lock files

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: dependabot-buildkite <dependabot-buildkite@noreply.solana.com>
2021-09-30 13:20:05 -06:00
8db9586599 AcctIdx: randomly evict items from in mem (#20319) 2021-09-30 02:51:54 +00:00
5e05f12c48 AcctIdx: bucket perf improvements (#20328) 2021-09-30 01:53:26 +00:00
59112adac1 AcctIdx: us stats were showing ms (#20324) 2021-09-29 22:18:07 +00:00
2ec74474e9 AcctIdx: optimize should_remove_from_mem (#20327) 2021-09-29 16:41:54 -05:00
4de5fff3ca Simplifies return_data accessors in InvokeContext. (#20290) 2021-09-29 19:11:06 +02:00
57c8abf499 Refactor: Merge message processor into invoke context (#20308)
* Inlines MessageProcessor::execute_instruction() in MessageProcessor::process_message().

* Moves MessageProcessor::create_pre_accounts() into ThisInvokeContext::push().

* Move instruction_recorders slice into InvokeContext.

* Makes account_indices optional in InvokeContext::push().

* Separates initial InvokeContext::push() from ThisInvokeContext::new().

* invoke_context.pop() the base invocation frame.

* Zip message.instructions.iter() and program_indices.iter().

* Moves ThisInvokeContext::new() to the beginning of the loop inside MessageProcessor::process_message().

* Hoists ThisInvokeContext::new() out of loop inside MessageProcessor::process_message().

* Removes unnecessary clone() from ThisInvokeContext::new() in MessageProcessor ::process_message().

* Stop ignoring errors from MessageProcessor::create_pre_accounts().

* Moves MessageProcessor::verify_account_references() and MessageProcessor::verify() into InvokeContext::verify().
2021-09-29 12:05:25 -05:00
062d8e6c5a AcctIdx: fix logic on should_remove_from_mem (#20302) 2021-09-29 13:07:40 +00:00
bd9b2f6f39 AcctIdx: throttling bg flushing to spread out work over interval (#20176)
* AcctIdx: throttling bg flushing to spread out work over interval

* prevent hang
2021-09-29 07:42:54 -05:00
8fee9a2e1a Dont call precompiled programs (#19930) 2021-09-29 06:25:08 +00:00
491877de3d Revert "Refactor: Merge MessageProcessor into InvokeContext (#20165)" (#20301)
This reverts commit df6905c3a6.
2021-09-28 16:59:01 -07:00
fa5b091b4c prior to panicing with cap mismatch, try other calculation (#20292) 2021-09-28 16:09:36 -05:00
320beb76f6 AcctIdx: implement wait_for_idle (#20256) 2021-09-28 11:07:19 -05:00
2cd9dc99b6 Restore ability for programs to upgrade themselves (#20265)
* Make helper associated fn

* Add feature definition

* Add handling to preserve program-id write lock when upgradeable loader is present; restore bpf upgrade-self test

* Use single feature
2021-09-28 09:59:08 -06:00
4e27543415 Allow programs to realloc their accounts within limits (#19475) 2021-09-28 01:13:03 -07:00
e50a26e6cf AcctIdx: add age_interval_ms() to remove constant use (#20264) 2021-09-28 01:22:07 +00:00
af309c126c AcctIdx: refactor get to use more refs (#20268) 2021-09-28 00:18:36 +00:00
34406d4815 chore: bump ouroboros from 0.10.1 to 0.11.1 (#20244)
* chore: bump ouroboros from 0.10.1 to 0.11.1

Bumps [ouroboros](https://github.com/joshua-maros/ouroboros) from 0.10.1 to 0.11.1.
- [Release notes](https://github.com/joshua-maros/ouroboros/releases)
- [Commits](https://github.com/joshua-maros/ouroboros/commits)

---
updated-dependencies:
- dependency-name: ouroboros
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>

* [auto-commit] Update all Cargo lock files

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: dependabot-buildkite <dependabot-buildkite@noreply.solana.com>
2021-09-27 23:26:08 +00:00
f6812523cd handle race condition with flush and delete (#20255) 2021-09-27 16:55:15 -05:00
bbd2f9672d clone -> Arc::clone to make cost clear (#20262) 2021-09-27 16:49:53 -05:00
4f83818fdb get rid of WriteAccountMapEntry instance (#19093) 2021-09-27 16:24:19 -05:00
e4795ae7ed AcctIdx: keep cached or multiple slot lists in cache (#20257) 2021-09-27 16:09:26 -05:00
9d91a6f1b7 shrink slots at startup uses more threads (#20251) 2021-09-27 14:14:55 -05:00
8266864adc AcctIdx: maybe advance age when a bg thread wakes up (#20250)
* fix math error with stats calc

* AcctIdx: maybe report stats when a bg thread wakes up
2021-09-27 18:39:41 +00:00
95fbc29500 Add stats when getting snapshot storages (#20234) 2021-09-27 13:07:00 -05:00
46263d405e fix math error with stats calc (#20253) 2021-09-27 11:55:19 -05:00
bc50fd4ad6 allocate threads for accounts idx based on cpus (#20118) 2021-09-27 11:25:06 -05:00
025261c05e AcctIdx: when no disk index, always wait for stats (#20248) 2021-09-27 11:24:36 -05:00
833f7761d2 AcctIdx: upsert uses get from mem first (#20186) 2021-09-27 11:23:53 -05:00
d8f98b3dcb AcctIdx: avoid crazy #s on ms_per_age stat (#20184) 2021-09-27 08:25:23 -05:00
df6905c3a6 Refactor: Merge MessageProcessor into InvokeContext (#20165)
* Inlines MessageProcessor::execute_instruction() in MessageProcessor::process_message().

* Moves MessageProcessor::create_pre_accounts() into ThisInvokeContext::push().

* Hoists ThisInvokeContext::new() out of loop inside MessageProcessor::process_message().

* Moves MessageProcessor::verify_account_references() and MessageProcessor::verify() into InvokeContext::verify().
2021-09-27 08:28:45 +02:00
c6d189dac2 bg threads wait until next expected event (#20126) 2021-09-24 16:00:41 -05:00
122206dbb1 AcctIdx: bg loop sleeps when all buckets flushed at current age (#20168) 2021-09-24 13:19:06 -05:00
1d13594c1c AcctIdx: store # threads in BucketHolder. Used later. (#20151) 2021-09-23 19:56:44 -05:00
b3bb079d9f AcctIdx: condense upsert to always use read lock (#20148) 2021-09-23 19:19:27 -05:00
1347b507da Handle duplicate AppendVec IDs (#20096)
When reconstructing the AccountsDb, if the storages came from full and
incremental snapshots generated on different nodes, it's possible that
the AppendVec IDs could overlap/have duplicates, which would cause the
reconstruction to fail.

This commit handles this issue by unconditionally remapping the
AppendVec ID for every AppendVec.

Fixes #17088
2021-09-23 17:34:32 -05:00
2ae1e80013 AcctIdx: items needs to load from disk (#20138) 2021-09-23 17:33:54 -05:00
334d38d200 AcctIdx: generation per thread starts at a random bucket (#20122) 2021-09-23 19:59:37 +00:00
254d9c8903 range takes a ref (#20140) 2021-09-23 13:57:56 -05:00