Commit Graph

10697 Commits

Author SHA1 Message Date
Jack May 42f88484f4 Update lock files 2020-07-14 14:40:02 -07:00
Aaron Hill b0cb2b0106 Replace FIXME with an issue link 2020-07-14 14:40:02 -07:00
Aaron Hill 05445c718e Fix hygiene issues in `declare_program!` and `declare_loader!`
The `declare_program!` and `declare_loader!` macros both expand to
new macro definitions (based on the `$name` argument). These 'inner'
macros make use of the special `$crate` metavariable to access items in
the crate where the 'inner' macros is defined.

However, this only works due to a bug in rustc. When a macro is
expanded, all `$crate` tokens in its output are 'marked' as being
resolved in the defining crate of that macro. An inner macro (including
the body of its arms) is 'just' another set of tokens that appears in
the body of the outer macro, so any `$crate` identifiers used there are
resolved relative to the 'outer' macro.

For example, consider the following code:

```rust
macro_rules! outer {
    () => {
        macro_rules! inner {
            () => {
                $crate::Foo
            }
        }
    }
}
```

The path `$crate::Foo` will be resolved relative to the crate that defines `outer`,
**not** the crate which defines `inner`.

However, rustc currently loses this extra resolution information
(referred to as 'hygiene' information) when a crate is serialized.
In the above example, this means that the macro `inner` (which gets
defined in whatever crate invokes `outer!`) will behave differently
depending on which crate it is invoked from:

When `inner` is invoked from the same crate in which it is defined,
the hygiene information will still be available,
which will cause `$crate::Foo` to be resolved in the crate which defines 'outer'.

When `inner` is invoked from a different crate, it will be loaded from
the metadata of the crate which defines 'inner'. Since the hygiene
information is currently lost, rust will 'forget' that `$crate::Foo` is
supposed to be resolved in the context of 'outer'. Instead, it will be
resolved relative to the crate which defines 'inner', which can cause
incorrect code to compile.

This bug will soon be fixed in rust (see https://github.com/rust-lang/rust/pull/72121),
which will break `declare_program!` and `declare_loader!`. Fortunately,
it's possible to obtain the desired behavior (`$crate` resolving in the
context of the 'inner' macro) by use of a procedural macro.

This commit adds a `respan!` proc-macro to the `sdk/macro` crate.
Using the newly-stabilized (on Nightly) `Span::resolved_at` method,
the `$crate` identifier can be made to be resolved in the context of the
proper crate.

Since `Span::resolved_at` is only stable on the latest nightly,
referencing it on an earlier version of Rust will cause a compilation error.
This requires the `rustversion` crate to be used, which allows conditionally
compiling code epending on the Rust compiler version in use. Since this method is already
stabilized in the latest nightly, there will never be a situation where
the hygiene bug is fixed (e.g. https://github.com/rust-lang/rust/pull/72121)
is merged but we are unable to call `Span::resolved_at`.
2020-07-14 14:40:02 -07:00
Michael Vines 0b919f095d
Add TRAVIS_COMMIT_RANGE logging 2020-07-14 12:10:21 -07:00
dependabot[bot] 9abfd67cd9
chore: bump ws from 7.3.0 to 7.3.1 in /web3.js (#11058)
Bumps [ws](https://github.com/websockets/ws) from 7.3.0 to 7.3.1.
- [Release notes](https://github.com/websockets/ws/releases)
- [Commits](https://github.com/websockets/ws/compare/7.3.0...7.3.1)

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

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2020-07-14 11:51:40 -07:00
dependabot[bot] 5e2d80a861
chore: bump @babel/preset-flow in /web3.js (#11061)
Bumps [@babel/preset-flow](https://github.com/babel/babel/tree/HEAD/packages/babel-preset-flow) from 7.10.1 to 7.10.4.
- [Release notes](https://github.com/babel/babel/releases)
- [Changelog](https://github.com/babel/babel/blob/main/CHANGELOG.md)
- [Commits](https://github.com/babel/babel/commits/v7.10.4/packages/babel-preset-flow)

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

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2020-07-14 11:51:21 -07:00
dependabot[bot] ab8d7924f0
chore:(deps-dev): bump marked from 1.1.0 to 1.1.1 in /web3.js (#11060)
Bumps [marked](https://github.com/markedjs/marked) from 1.1.0 to 1.1.1.
- [Release notes](https://github.com/markedjs/marked/releases)
- [Commits](https://github.com/markedjs/marked/compare/v1.1.0...v1.1.1)

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

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2020-07-14 11:50:18 -07:00
Michael Vines 0708969e9e
Update dependabot.yml 2020-07-14 11:49:25 -07:00
Michael Vines c626d515d2
No automerge for rust dependencies 2020-07-14 11:30:32 -07:00
Michael Vines 05709822f9
Create dependabot.yml 2020-07-14 11:25:05 -07:00
dependabot-buildkite 0affb1c92b [auto-commit] Update all Cargo lock files 2020-07-14 11:13:22 -07:00
dependabot-preview[bot] 5055028231 Bump serde_json from 1.0.54 to 1.0.56
Bumps [serde_json](https://github.com/serde-rs/json) from 1.0.54 to 1.0.56.
- [Release notes](https://github.com/serde-rs/json/releases)
- [Commits](https://github.com/serde-rs/json/compare/v1.0.54...v1.0.56)

Signed-off-by: dependabot-preview[bot] <support@dependabot.com>
2020-07-14 11:13:22 -07:00
dependabot-preview[bot] 95145672c8 Bump byte-unit from 3.1.3 to 4.0.8
Bumps [byte-unit](https://github.com/magiclen/byte-unit) from 3.1.3 to 4.0.8.
- [Release notes](https://github.com/magiclen/byte-unit/releases)
- [Commits](https://github.com/magiclen/byte-unit/compare/v3.1.3...v4.0.8)

Signed-off-by: dependabot-preview[bot] <support@dependabot.com>
2020-07-14 11:13:14 -07:00
Dan Albert 303a4df6ef
Clean up docs publishing flow (#11043)
* Clean up publishing flow

* Update README

Co-authored-by: publish-docs.sh <maintainers@solana.com>
2020-07-14 07:56:14 -06:00
Trent Nelson 14ac233d01 CLI: Fix explicitly plumb vote_account through create-vote-account 2020-07-14 07:29:53 -06:00
Trent Nelson 2284699889 CLI: Fix explicitly plumb withdraw_authority through vote-update-validator 2020-07-14 07:29:53 -06:00
Trent Nelson 3392ecc310 CLI: Fix explicitly plumb withdraw_authority through vote-update-commission 2020-07-14 07:29:53 -06:00
carllin e9cbdf711b
Add TreeDiff trait to reuse tree functions (#11046)
Co-authored-by: Carl <carl@solana.com>
2020-07-14 07:38:48 +00:00
Dan Albert 356b552439
Remove docs step from buildkite flow (#11035)
Co-authored-by: publish-docs.sh <maintainers@solana.com>
2020-07-14 02:44:16 +00:00
Trent Nelson 5741002a32 Mode gate RecentBlockhashes/BlockhashQueue sync 2020-07-14 00:36:31 +00:00
Trent Nelson 51283c931c Fix test advancing banks from incomplete slots 2020-07-14 00:36:31 +00:00
Trent Nelson 837ac77c02 Bump goldens 2020-07-14 00:36:31 +00:00
Trent Nelson 5357ff6d60 Synchronize BlockhashQueue and RecentBlockhashes sysvar update 2020-07-14 00:36:31 +00:00
Trent Nelson 9cc379af6c Factor locked portion of Bank::update_recent_blockhashes() out to helper 2020-07-14 00:36:31 +00:00
Tyera Eulberg 942c019d50 Add failing test 2020-07-14 00:36:31 +00:00
dependabot-preview[bot] b37192b809
Bump @testing-library/react from 10.4.5 to 10.4.6 in /explorer (#11038)
Bumps [@testing-library/react](https://github.com/testing-library/react-testing-library) from 10.4.5 to 10.4.6.
- [Release notes](https://github.com/testing-library/react-testing-library/releases)
- [Changelog](https://github.com/testing-library/react-testing-library/blob/master/CHANGELOG.md)
- [Commits](https://github.com/testing-library/react-testing-library/compare/v10.4.5...v10.4.6)

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

Co-authored-by: dependabot-preview[bot] <27856297+dependabot-preview[bot]@users.noreply.github.com>
2020-07-14 00:11:30 +00:00
Michael Vines d3784cab4f Bump spl-memo to 1.0.2 2020-07-13 23:59:33 +00:00
Michael Vines 3eea8f2fe6 Bump rust nightly to 2020-07-12 2020-07-13 23:59:33 +00:00
dependabot-preview[bot] 0d1420d868
Bump @types/node from 14.0.22 to 14.0.23 in /explorer (#11037)
Bumps [@types/node](https://github.com/DefinitelyTyped/DefinitelyTyped/tree/HEAD/types/node) from 14.0.22 to 14.0.23.
- [Release notes](https://github.com/DefinitelyTyped/DefinitelyTyped/releases)
- [Commits](https://github.com/DefinitelyTyped/DefinitelyTyped/commits/HEAD/types/node)

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

Co-authored-by: dependabot-preview[bot] <27856297+dependabot-preview[bot]@users.noreply.github.com>
2020-07-13 22:54:31 +00:00
dependabot-buildkite 2d93ca9ab3 [auto-commit] Update all Cargo lock files 2020-07-13 15:00:27 -07:00
dependabot-preview[bot] cee9177ec7 Bump libc from 0.2.71 to 0.2.72
Bumps [libc](https://github.com/rust-lang/libc) from 0.2.71 to 0.2.72.
- [Release notes](https://github.com/rust-lang/libc/releases)
- [Commits](https://github.com/rust-lang/libc/compare/0.2.71...0.2.72)

Signed-off-by: dependabot-preview[bot] <support@dependabot.com>
2020-07-13 15:00:27 -07:00
sakridge 1880621740
Add dropped vote metrics (#11009) 2020-07-13 09:11:07 -07:00
Ryo Onodera de379a8cd6
Ensure to digest non-empty snapshot_storages and add asserts (#11021)
* Add asserts to detect not-digestable example data

* Ensure to digest non-empty snapshot_storages
2020-07-13 15:58:34 +00:00
dependabot-preview[bot] e95e7a96da
Bump @types/react from 16.9.42 to 16.9.43 in /explorer (#11027)
Bumps [@types/react](https://github.com/DefinitelyTyped/DefinitelyTyped/tree/HEAD/types/react) from 16.9.42 to 16.9.43.
- [Release notes](https://github.com/DefinitelyTyped/DefinitelyTyped/releases)
- [Commits](https://github.com/DefinitelyTyped/DefinitelyTyped/commits/HEAD/types/react)

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

Co-authored-by: dependabot-preview[bot] <27856297+dependabot-preview[bot]@users.noreply.github.com>
2020-07-13 15:51:43 +00:00
Kristofer Peterson ed5a2f2a90
Fold bank serialisation into serde snapshot (#10581)
* Move bank (de)serialisation logic from bank and snapshot_utils to serde_snapshot.
Add sanity assertions between genesis config and bank fields on deserialisation.
Atomically update atomic bool in quote_for_specialization_detection().
Use same genesis config when restoring snapshots in test cases.

* Tidy up namings and duplicate structs to version

* Apply struct renames to tests

* Update abi hashes

Co-authored-by: Ryo Onodera <ryoqun@gmail.com>
2020-07-13 23:00:59 +09:00
dependabot-preview[bot] 5c86766fb2
Bump ctrlc from 3.1.4 to 3.1.5 (#11006)
Bumps [ctrlc](https://github.com/Detegr/rust-ctrlc) from 3.1.4 to 3.1.5.
- [Release notes](https://github.com/Detegr/rust-ctrlc/releases)
- [Commits](https://github.com/Detegr/rust-ctrlc/compare/3.1.4...3.1.5)

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

Co-authored-by: dependabot-preview[bot] <27856297+dependabot-preview[bot]@users.noreply.github.com>
2020-07-12 20:59:29 -06:00
dependabot-preview[bot] 33f5c17e46
Bump generic-array from 0.14.1 to 0.14.3 (#11010)
* Bump generic-array from 0.14.1 to 0.14.3

Bumps [generic-array](https://github.com/fizyk20/generic-array) from 0.14.1 to 0.14.3.
- [Release notes](https://github.com/fizyk20/generic-array/releases)
- [Changelog](https://github.com/fizyk20/generic-array/blob/master/CHANGELOG.md)
- [Commits](https://github.com/fizyk20/generic-array/commits)

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

* [auto-commit] Update all Cargo lock files

Co-authored-by: dependabot-preview[bot] <27856297+dependabot-preview[bot]@users.noreply.github.com>
Co-authored-by: dependabot-buildkite <dependabot-buildkite@noreply.solana.com>
2020-07-12 20:59:05 -06:00
Michael Vines 1437660686 Revert "Add UiTransactionEncoding::Raw"
This reverts commit a4a5438b6d.
2020-07-12 08:59:50 -07:00
sakridge edf2b1ee85
Check for deleting key, make sure list is empty again (#11007) 2020-07-11 20:38:34 -07:00
dependabot-buildkite 12d188da09 [auto-commit] Update all Cargo lock files 2020-07-10 22:53:21 -07:00
dependabot-preview[bot] 2e5cb71e54 chore(deps): bump base64 from 0.12.1 to 0.12.3
Bumps [base64](https://github.com/marshallpierce/rust-base64) from 0.12.1 to 0.12.3.
- [Release notes](https://github.com/marshallpierce/rust-base64/releases)
- [Changelog](https://github.com/marshallpierce/rust-base64/blob/master/RELEASE-NOTES.md)
- [Commits](https://github.com/marshallpierce/rust-base64/compare/v0.12.1...v0.12.3)

Signed-off-by: dependabot-preview[bot] <support@dependabot.com>
2020-07-10 22:53:21 -07:00
Dan Albert ffeac298a2
Move from gitbook to docusaurus, build docs in Travis CI (#10970)
* fix: ignore unknown fields in more RPC responses

* Remove mdbook infrastructure

* Delete gitattributes and other theme related items

Move all docs to /docs folder to support Docusaurus

* all docs need to be moved to /docs

* can be changed in the future

Add Docusaurus infrastructure

* initialize docusaurus repo

Remove trailing whitespace, add support for eslint

Change Docusaurus configuration to support `src`

* No need to rename the folder! Change a setting and we're all good to
go.

* Fixing rebase items

* Remove unneccessary markdown file, fix type

* Some fonts are hard to read. Others, not so much. Rubik, you've been
sidelined. Roboto, into the limelight!

* As much as we all love tutorials, I think we all can navigate around a
markdown file. Say goodbye, `mdx.md`.

* Setup deployment infrastructure

* Move docs job from buildkite to travic

* Fix travis config

* Add vercel token to travis config

* Only deploy docs after merge

* Docker rust env

* Revert "Docker rust env"

This reverts commit f84bc208e807aab1c0d97c7588bbfada1fedfa7c.

* Build CLI usage from docker

* Pacify shellcheck

* Run job on PR and new commits for publication

* Update README

* Fix svg image building

* shellcheck

Co-authored-by: Michael Vines <mvines@gmail.com>
Co-authored-by: Ryan Shea <rmshea@users.noreply.github.com>
Co-authored-by: publish-docs.sh <maintainers@solana.com>
2020-07-11 05:11:07 +00:00
Ryo Onodera 4046f87134
Fix compilation failure on windows (#10983)
* Fix compilation failure on windows

* Test travis window build

* more tweak trigger travis build...

* Make more debug-friendly

* Fix shellcheck

* Revert .travis.yaml after testing on travis
2020-07-11 04:35:46 +00:00
Tyera Eulberg f6f5842172
Explicit spl-memo version (#11003) 2020-07-11 03:41:53 +00:00
Michael Vines 427d0ff0b5 fix: ignore unknown fields in more RPC responses 2020-07-11 03:39:49 +00:00
Jack May f0b22b1b23
spl memo linking windows (#11000)
* Update spl-memo to fix windows linking error

* Only programs need the stubs

Co-authored-by: Ryo Onodera <ryoqun@gmail.com>
2020-07-10 18:39:52 -07:00
Greg Fitzgerald 145906123a
Simplify use of SendTransactionService (#10999)
* Send transaction upon recv

This will allow us to move the channel to the public interface

* Use a channel, not a method, to communicate

* Pipeline the services

* Ignore unused return values

* Fix clippy warning
2020-07-11 01:14:41 +00:00
Trent Nelson 19813b0ab2 fix: align web3 stake split instruction constuction with rust 2020-07-10 15:29:48 -06:00
Trent Nelson a8b1d71ae6 fix: inconsistent tx message compilation accounting 2020-07-10 15:29:48 -06:00
Trent Nelson 40800e257c test: tweak test to suss out tx message serialization bug 2020-07-10 15:29:48 -06:00