Commit Graph

20922 Commits

Author SHA1 Message Date
Steven Luscher b112d01a5d
feat: the web3.js getBlock APIs now accept `rewards` and `transactionDetails` config (#29000)
* Add `transactionDetails` and `rewards` params to `getBlock` API of web3.js

* Add the same content to the legacy call

…because it's such a PITA to share config between two methods and not have Typedoc throw a fit.

* Add tests to exercise block deserialization in the case that `transactionDetails` is `none` or `accounts`

* Extract the annotated account key parser into a separate struct

* Parse the `getBlock()` responses differently depending on the mode
2022-12-01 22:04:47 -08:00
Tao Zhu 5850af5316
Refactor to remove requested_cu from cost_trarcker (#29015)
* refactor cost tracker by removing requested_cu from it, call sites to use cost_model forr consistency

* review fix
2022-12-02 00:25:09 +00:00
Jeff Washington (jwash) 20aeff3632
test_purge_empty_accounts uses write cache (#29018) 2022-12-01 15:22:26 -08:00
Jeff Washington (jwash) dbd6ce8f21
test_bank_update_sysvar_account uses write cache (#29022)
* test_add_precompiled_account_inherited_cap_while_replacing uses write cache

* test_bank_update_sysvar_account uses write cache
2022-12-01 15:21:05 -08:00
Tyera 28d8b072c9
Update filter docs, v1.11 -> v1.14 (#29017)
v1.11 -> v1.14
2022-12-01 15:55:58 -07:00
Jeff Washington (jwash) a9c8f26a66
test_add_precompiled_account_inherited_cap_while_replacing uses write cache (#29019) 2022-12-01 14:07:39 -08:00
steviez 01cd55a27a
Change SlotMeta is_connected bool to bitflags (#29001)
We currently use the is_connected field to be able to signal to
ReplayStage that a slot has replayable updates. It was discovered that
this functionality is effectively broken, and that is_connected is never
true. In order to convey this information to ReplayStage more
effectively, we need extra state information so this PR changes the
existing bool to bitflags with two bits.

From a compatibility standpoint, the is_connected bool was already
occupying one byte in the serialized SlotMeta in blockstore. Thus, the
change from a bool to bitflags still "fits" in that one byte allotment.

In consideration of a case where a client may wish to downgrade software
and use the same ledger, deserializing the bitflags into a bool could
fail if the new bit is set. As such, this PR introduces the second bit
field, but does not set it anywhere. Once clusters have mass adopted a
software version with this PR, a subsequent change to actually set and
use the new field can be introduced.
2022-12-01 14:42:35 -06:00
Jeff Washington (jwash) 631d93dd2d
tests use write cache (#29012) 2022-12-01 12:17:13 -08:00
Alexander Meißner 73e55a184b
Adjusts docs about changing the data, size and balance of accounts. (#29007) 2022-12-01 19:42:34 +01:00
steviez 3c42c87098
Remove obsoleted return value from Blockstore insert shred method (#28992) 2022-12-01 11:17:46 -06:00
samkim-crypto ae57a14ef6
[zk-token-sdk] reorganize errors (#29005)
* reorganize error using DRY principle

* rename error `Format` to `Deserialization`

* Rename `EncryptionError` to `DiscreteLogError`

* resolve errors from rebase

* resolve clippy

* change `ProofInstructionError` to `ProofError`
2022-12-01 20:29:14 +09:00
Alexander Meißner f766895f78
Adds a feature ID for `enable_alt_bn128_syscall` (#28908)
Adds a feature ID for enable_alt_bn128_syscall.
2022-12-01 09:58:23 +01:00
Jeff Washington (jwash) e6cc5052c3
pass alive bytes to AccountsToStore::new (#28994) 2022-11-30 15:46:52 -08:00
Jeff Washington (jwash) 2c912c9049
use files for merkle tree inputs on accounts hash (#28965)
* use files for merkle tree inputs on accounts hash

* remove multi-pass scan, simplify

* cleanup and comments

* rework writing into the hash file for clarity

* add test, cleanup

* rename

* move count into option
2022-11-30 12:27:27 -08:00
Pankaj Garg 07d21d4114
Use estimated current slot in tpu client (#28997) 2022-11-30 11:36:26 -08:00
Jeff Washington (jwash) 58e12cf963
avoid copies when writing to an ancient append vec (#28981)
* avoid copies when writing to an ancient append vec

* update comments
2022-11-30 10:09:23 -08:00
Jon Cinque 337621d031
fix: support `VersionedMessage` in `getFeeForMessage` (#28996) 2022-11-30 10:06:43 -08:00
Lijun Wang 16e2c5c0a2
Increase stream timeout to 1 sec to fix flaky tests (#28983) 2022-11-30 10:04:32 -08:00
Steven Luscher 491d4f3331
fix: TransactionMessage.decompile() now counts the correct number of unsigned, writable accounts (#28990)
* Test that `TransactionMessage.decompile()` can decompile a legacy `Message`

* `TransactionMessage.decompile()` now correctly accounts for the number of writable unsigned accounts
2022-11-30 09:57:54 -08:00
steviez b6dce6cf3b
Move BlockstoreInsertionMetrics field update to blockstore.rs (#28991)
The num_repair field is only blockstore insertion metric being updated
outside of Blockstore::insert() call chain; move the update to insert()
with the rest of the fields in BlockstoreInsertionMetrics struct.
2022-11-30 11:46:35 -06:00
Ashwin Sekar edacd3c411
Add dump_node to update stake for heaviest subtrees (#28827)
* Add dump_node to update stake for heaviest subtrees

Additionally refactor subtrees to store children as a hashset

* Add a more complicated forks test

* chose -> choose

* remove is_dumped flag and reuse latest_invalid_ancestor instead
2022-11-30 09:26:13 -08:00
Brennan Watt 9a6ab5e7fe
Distinguish turbine vs repair insertion metrics (#28980) 2022-11-30 09:03:53 -08:00
Jeff Washington (jwash) 2427004dba
add 'bytes' to aligned/alive_total for clarity (#28982) 2022-11-30 07:38:57 -08:00
Haoran Yi 597828630b fix account-cluster-bench logging 2022-11-30 09:00:14 -06:00
Haoran Yi ed1d0788ed fix typo 2022-11-30 09:00:14 -06:00
samkim-crypto 11efaf75a4
[zk-token-sdk] divide fee encryption into two ciphertexts (#28472)
* divide fee encryption into two ciphertexts

* clippy

* update range proof

* add fee ciphertext decryption

* clean up split_u64 function

* remove unnecessary casting
2022-11-30 15:11:38 +09:00
Tyera 3d6eb16753
Bump spl-ata to v1.1.2 (#28979) 2022-11-30 03:46:42 +00:00
Steven Luscher 8c6ad8c001
A GitHub workflow to automagically label PRs with Explorer or web3.js changes (#28986) 2022-11-29 18:14:53 -08:00
Jeff Washington (jwash) c8cc1270f1
log # append vecs open (#28958) 2022-11-29 16:48:02 -08:00
Jeff Washington (jwash) e42649a8ba
remove cli arg to specify # accounts hash scan passes (#28976) 2022-11-29 16:47:51 -08:00
apfitzge 4d338ed882
Bugfix/mi_remove_never_entries (#28978) 2022-11-29 16:00:21 -06:00
Jeff Washington (jwash) 19d86bd2b1
add balance to cap overflow message (#28975) 2022-11-29 13:55:07 -08:00
Jon Cinque 99d8929ab4
program-test: Add `ProgramTestContext::get_new_latest_blockhash` (#28977) 2022-11-29 22:38:01 +01:00
Tyera fd13323f4b
Split rpc_accounts api to identify calls that scan accountsDB (#28968)
* Update stale comment

* Collect RPC endpoints that perform accounts scans
2022-11-29 10:08:19 -07:00
Yihau Chen a665d679cc
Merge pull request from GHSA-cq9g-c286-6ch7
* create a reusable workflow for current error reporting logic

* make github.event.head_commit.message as a env, COMMIT_MESSAGE

* make github.event.head_commit.author.name as a env, COMMIT_AUTHOR_NAME

* remove redundant name

* replace error reporting step with the reusalble workflow
2022-11-30 00:58:42 +08:00
steveluscher 45291a5001 chore: remove @babel/register dependency from web3.js 2022-11-29 08:04:19 +00:00
steveluscher 85e6b80347 chore: remove unused http-server dependency from web3.js 2022-11-29 08:00:06 +00:00
dependabot[bot] cc296839da
chore: bump http-server from 14.1.0 to 14.1.1 in /web3.js (#27333)
Bumps [http-server](https://github.com/http-party/http-server) from 14.1.0 to 14.1.1.
- [Release notes](https://github.com/http-party/http-server/releases)
- [Commits](https://github.com/http-party/http-server/compare/v14.1.0...v14.1.1)

---
updated-dependencies:
- dependency-name: http-server
  dependency-type: direct:development
  update-type: version-update:semver-patch
...

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

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2022-11-28 23:48:26 -08:00
Ian Macalinao f53aa5f12b
chore: remove redundant 'Buffer' from 'Account' class (#27865) 2022-11-28 23:42:58 -08:00
Ian Macalinao 0e70275b07
chore: use constant for PUBLIC_KEY_LENGTH for checking length of input (#27876) 2022-11-28 23:29:40 -08:00
Ian Macalinao 61803b914f
chore: add deprecation notice for createProgramAddress (#27879) 2022-11-28 23:29:06 -08:00
Ian Macalinao ac8ddc841c
chore: deprecate PublicKey.findProgramAddress (#27882) 2022-11-28 23:28:35 -08:00
Ian Macalinao 19ec2dc0b1
chore: replace casts with not-null assertions (#27883) 2022-11-28 23:26:08 -08:00
Ian Macalinao 8c8e113879
chore: fix typo in PublicKey.unique (#27884) 2022-11-28 23:15:58 -08:00
Steven Luscher 7646521a6e
feat: a nonce-based transaction confirmation strategy for web3.js (#25839)
* feat: you can now construct a `Transaction` with durable nonce information

* chore: refactor confirmation logic so that each strategy gets its own method

* feat: `geNonce` now accepts a `minContextSlot` param

* feat: a nonce-based transaction confirmation strategy

* feat: add nonce confirmation strategy to send-and-confirm helpers

* fix: nits from July 8 review

* Use Typescript narrowing to determine which strategy to use

* Double check the signature confirmation against the slot in which the nonce was discovered to have advanced
2022-11-28 22:46:27 -08:00
Ashwin Sekar 0d0a491f27
More documentation + small refactor for RepairService (#28933) 2022-11-28 19:46:06 -08:00
Steven Luscher 04789cab81
fix: verify commitment level when confirming transactions with one-shot fetch (#28969)
* Rename `subscriptionCommitment` to `confirmationCommitment`

* Reorganize status checking code to return early if `value` is `null`

* Bail if the one-shot signature result does not meet the target commitment
2022-11-28 18:50:16 -08:00
Ian Macalinao 3b2014ddc1
fix: remove Buffer from transaction signature verification (#27868) 2022-11-28 16:32:16 -08:00
Jeff Washington (jwash) 7999f4278e
add feature #28934 (no-op in master) (#28936) 2022-11-28 14:58:59 -08:00
Pankaj Garg a369b4a070
TPU client fix for leader schedule cache lookup (#28954)
TPU client fix for leader schedule cache
2022-11-28 13:44:08 -08:00