Releases: canvasxyz/canvas
Releases · canvasxyz/canvas
v0.8.2
v0.8.1
Stability improvements.
Changed
- Rebroadcast the session along with every action over pubsub
- Allow actions with missing parents to be applied if history indexing is off
- Change
app.connectionsto a mapping of PeerIDs to detailed information about the peer, including connection status and whether that peer is subscribed to the application topic - Ping peers to detect if we have a valid connection
- Maintain
app.statuswhich tracks if there is at least one online connection, subscribed to the application topic
v0.7.2
Stability improvements.
Changed
- Prevent multiple tabs from trying to use the same PeerId
- Prevent locks for Merkle sync from being held indefinitely
- Reduce GossipSub penalties for misbehaving peers
- Default to using browser-to-server WebSocket transport; only use browser-to-browser WebRTC if
enableWebRTC: trueis set in the config- You should use WebSocket for production applications now.
- Note that using WebSocket means you must use a replication server (i.e.
canvas clior another persistent node in the cloud). See below for a universal solution to this.
- Applications now start libp2p automatically
app.start/stop()have been moved toapp.libp2p.start/stop()but are no longer needed.
- Adds a
heartbeatmessage type, in preparation for live presence support.
Added
@canvas-js/replication-server: A universal replication server that watches a discovery topic and saves and replicates all actions on all topics broadcast to it.- If you configure any application with the universal replication server's discovery topic, the application will automatically be replicated.
v0.7.0
Changed
- Add active peer discovery to
@canvas-js/discovery. Applications can configure a peer discovery topic, where clients will broadcast a regular heartbeat. The same peer discovery topic can be shared across Canvas applications, for e.g. a network of chat rooms - Unified syntax for database accessors. We now use
db.get("table")everywhere instead ofdb.table.get()inside the contract
Added
- Added
booleantype to ModelDB - Added
jsontype to ModelDB - Added
useTick()hook
v0.6.1
v0.5.0
Changed
- Rewrite the entire framework! 🎉
- Add causal graph structure to the action log
- Separate ModelDB and GossipLog into standalone packages
- New basic data structures using the IPLD data model
- New
SessionSignerinterface - Use WebRTC for direct browser-to-browser peering
- Support
db.getinside contracts via history indexing
Added
New packages:
@canvas-js/signed-cid@canvas-js/modeldb@canvas-js/gossiplog@canvas-js/discovery@canvas-js/templates@canvas-js/vm
v0.4.0
This release brings some breaking changes to the message payload formats, migrating to CAIP-2 identifiers everywhere, and some major networking upgrades!
What's new
- Specs now declare exactly which chains they support using an
export const chains: string[]export.- If one isn't declared, it defaults to
["eip155:1"](Ethereum mainnet only). - Applying a message will throw an error if the message is signed for a chain not declared in the
chainsarray. - You must provide a chain implementation for every chain declared in the spec to
Core.initialize.
- If one isn't declared, it defaults to
- Ethereum session signatures now use SIWE instead of EIP-712. This should be transparent to users, but is a breaking change to the signature generation and verification.
- The subject URI of the SIWE message is
ethereum:${sessionAddress}. - The
ipfs://Qm...URI of the app is given as the only resource URI. - Ethereum session signatures are now a 3-tuple string format
${domain}/${nonce}/${signatureBytes}so that the SIWE message text can be deterministically reconstructed by verifiers.
- The subject URI of the SIWE message is
- major libp2p upgrades resulting in faster peer discovery times and more reliable connections. Many thanks to the libp2p team for responding quickly to some bugs we found!
- More organized and colorful logging :)
Breaking changes
appNamehas been removed from specs and message payloads.chainandchainIdin action and session payloads have been consolidated into a single CAIP-2 chain identifierchain: string. CAIP is a great project dedicated to solving cross-chain identifier formats better than we could have.- Before:
{ chain: "ethereum", chainId: "1", ... } - After:
{ chain: "eip155:1", ... }
- Before:
- As a result, the constructor signature of the chain implementation classes have all changed.
EthereumChainImplementationis nowconstructor(chainId: number, domain: string)SubstrateChainImplementationandSolanaChainImplementationare bothconstructor(genesisHash: string)CosmosChainImplementationis nowconstructor(chainId: string, bech32Prefix: string)
Upgrade guide
The user-facing changes in this release are
- Update the constructor of your chain implementations. For example, if you're creating a
EthereumChainImplementation, you have to pass it a number instead of a string. - A new way to pass Ethereum RPC URLs to the CLI
- Before:
--chain-rpc ethereum 1 http://... - After:
--chain eip155:1=http://...
- Before:
- There are changes to the
ApplicationDataobject returned from the root HTTP route.chainsis nowstring[]instead ofRecord<string, string[]>.
- Multi-chain apps now have to declare their specific set of supported chains using the
export const chains = [ ... ]export with CAIP-2 identifiers.
v0.3.0
This release lands support for running Canvas apps entirely in the browser, along with improvements to the underlying libp2p networking stack!
What's New
@canvas-js/corecan be bundled and imported from the browser. Browser cores use IndexedDB for persisting messages, and an in-memory WASM SQLite database for the model store. You can provide acore: Coreinstance directly to the<Canvas />element instead of a host API URL, and use the rest of the hooks exactly the same way. See the example in examples/chat-browser!- Upgrade to libp2p v0.43.0 with the new Circuit Relay v2 implementation
Breaking Changes
- The
--listenCLI argument is now a string /ws multiaddr, not a port number. This makes it possible to control the network interface in addition to the port. - The WebSocket API has been redesigned as a more minimal server-to-client event stream.
- The
ApplicationDatainterface has been updated to include peering and merkle root metadata.
v0.2.2
What's Changed
- Added a
GET /messagesAPI endpoint, disabled by default - Added a top-level
validateSpec(string: string): Promise<{ valid: boolean; warnings: string[]; errors: string[] }>method
Full Changelog: v0.2.1...v0.2.2
v0.2.1
What's Changed
- Better connection and stream event logging
- Fixed a bug in MST sync where streams to empty sources were reset instead of closed
Full Changelog: v0.2.0...v0.2.1