solana-foundation / specs Goto Github PK
View Code? Open in Web Editor NEWProtocol specifications of the Solana network, maintained by various protocol teams.
Protocol specifications of the Solana network, maintained by various protocol teams.
Gossip Protocol is live on mainnet but is missing a spec.
Sub-topics:
Organization
We've long struggled with having the implementation of the JSON RPC server fall out of sync with the clients (eg. the @solana/web3.js
Typescript client). This happens because the implementations are hand-rolled.
The effort to fully specify the network gives us the perfect opportunity to eliminate all sources of manual error/omission.
rpc/src/rpc.rs
)web3.js/src/connection.ts
)The specification artifact would live in this repository. Implementors would import that specification and use it as part of a codegen scheme that produces the kinds of artifacts described above, in a format that makes sense for their codebase.
We can take inspiration from schema definition languages like OpenRPC, but it's my opinion that we will have to ultimately develop our own. In particular, our extant RPC features runtime behaviours that can change the output types depending on the input to an RPC method.
Take for example, the getBlock
method. If you pass transactionDetails: 'full'
then the output takes this form:
type GetBlockMethodResponse = {
transactions: Array<{
transaction: {
message: VersionedMessage;
signatures: string[];
};
}>;
}
If, however, you pass transactionDetails: 'accounts'
then the output takes this form:
type GetBlockMethodResponse = {
transactions: Array<{
transaction: {
accountsKeys: ParsedMessageAccount[],
signatures: string[];
};
}>;
}
For this reason, we need to be able to specify multiple override signatures per JSON RPC method – something that I don't believe OpenRPC supports (see where their docs state: “The method name is used as the method field of the JSON-RPC body. It therefore MUST be unique” – issue).
The Solana on-chain runtime accepts programs as a subset of the ELF64 format.
Proposed Content
Organization
Shreds are a network-friendly and fault-tolerant encoding of blocks.
Sub-topics:
Organization
While Ed25519 is technically a standard, in reality the malleability check rules on signature verification are ambiguous.
Solana mainnet uses the ed25519-dalek verify_strict
implementation.
Proposed Content
Organization
const connection = new Connection(this.rpcUrls[this.chain], "confirmed");
const fundingAddress = this.fundingAddresses[this.chain];
const toAddress = isTradingMode ? this.walletsStore.tradingWalletAddress : fundingAddress;
console.log(toAddress);
console.log(address);
if (!toAddress) {
this.isLoading = false;
console.log('to address not found');
return;
}
const fromWallet = Keypair.fromSecretKey(bs58.decode(this.privateKey));
console.log(fromWallet);
const fromTokenAccount = await getOrCreateAssociatedTokenAccount(
connection,
fromWallet,
new PublicKey(address),
fromWallet.publicKey,
);
console.log(fromTokenAccount);
console.log(new PublicKey(toAddress));
const toTokenAccount = await getOrCreateAssociatedTokenAccount(
connection,
fromWallet,
new PublicKey(address),
new PublicKey(toAddress),
);
console.log(fromTokenAccount);
const PRIORITY_FEE_INSTRUCTIONS = ComputeBudgetProgram.setComputeUnitPrice({microLamports: 5000});
const transaction = new Transaction()
.add(PRIORITY_FEE_INSTRUCTIONS)
.add(createTransferInstruction(
fromTokenAccount.address,
toTokenAccount.address,
fromWallet.publicKey,
this.amount * Math.pow(10, decimals),
)
);
let latestBlockhash = await connection.getLatestBlockhash('confirmed');
console.log(" ✅ - Fetched latest blockhash. Last Valid Height:", latestBlockhash.lastValidBlockHeight);
transaction.payerKey = fromWallet.publicKey;
transaction.recentBlockhash = latestBlockhash.blockhash;
console.log(transaction);
const txid = await connection.sendTransaction(transaction, [fromWallet]);
console.log(txid);
const confirmation = await connection.confirmTransaction({
signature: txid,
blockhash: latestBlockhash.blockhash,
lastValidBlockHeight: latestBlockhash.lastValidBlockHeight,
});
console.log(confirmation);
const txResult = await connection.getTransaction(txid, {maxSupportedTransactionVersion: 0})
console.log('🚀 Transaction Successfully Confirmed!', '\n', `https://solscan.io/tx/${txid}`);
console.log(`Transaction Fee: ${txResult?.meta?.fee} Lamports`);
To assist with client development, we should provide pcap (packet capture) files containing TPU/QUIC and TPU/UDP flows.
In the TPU/QUIC case, we will also have to dump TLS session keys as traffic will be encrypted.
Hey not sure if its supposed to work yet but the links lead to some page that doesn't exist like https://github.com/solana-foundation/specs/blob/main/consensus .
lemme know if I could help!
The TPU protocol advertises the solana-tpu
string in ALPN (Application-Layer Protocol Negotiation).
Needs to be amended in the doc, as non-ALPN and ALPN-enabled clients are incompatible.
The aim is to write a detailed spec for Tower BFT is Solana's custom implementation of PBFT.
Bincode is a serialization format used in many data structures.
Proposed Content
Organization
Proposing the following repo changes
Change the GitHub repo description to (in settings, shown in Twitter embeds).
Protocol specifications of the Solana network, maintained by various protocol teams.
Disable merge and squash merges, only allow rebase merging.
Related to #6 -- Document the syscalls available to Solana Bytecode
Proposed Content
Organization
SBF is live on mainnet but is missing a spec.
Current architectures:
Proposed Content
Organization
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.