Skip to content

0.1.4-rc2: Better consensus, jsonrpc.Snapshot, improved tx API

Pre-release
Pre-release
Compare
Choose a tag to compare
@Geod24 Geod24 released this 28 Jan 09:41
· 26 commits to master since this release

New features

The JSONRPC endpoints now support a Snapshot method

This allows to get an atomic view of the LevelDB data,
which in turn can be used for backups and other operations requiring atomic access.
An example usage can be found here.

/transactions endpoints now contains operations, not just links

A common usage of the transactions API endpoint was to get the transaction,
and then immediately get every associated operations.
Besides being a great way to DoS the API, this was not very convenient for callers,
so operations are now included in full instead of a mere link.
At some point in a future release, the operations endpoint will be cast into oblivion.

Sebak can auto-sync the system time

If time-sync is configured (via --ntp=my.ntp.server.net CLI arg
or SEBAK_NTP_SERVER env variable), sebak will frequently (every minute)
issue a query to the NTP server.
If the diff is over 4 seconds, Sebak will attempt to set the time, system-wide,
by calling sh $SEBAK_TIME_SYNC_COMMAND (cmd on Windows).
This can also be configured via the --time-sync-command=cmd CLI argument.
The default server is time.bora.net, and the default command is nothing,
disabling this feature by default.

Bug fixes

Saving blocks hangs when some blocks are missing

A minor bug led to Sebak hanging in some erroneous condition,
instead of correctly reporting an error.

Consensus stuck after recovering enough validators

Under certain circumstances, a network could get stuck if a prolonged outage happened.
Nodes now expose a /node/ballots API, used by the consensus protocol,
and will no longer expose this behavior.

Retry when ballot sending fails

Another liveness fix: network outage could results in nodes not talking to each other anymore.
Nodes are now much more insistent in having their ballot taken into account by other nodes,
pestering them as much as needed.

Changes

Improvements to memory usage

In an effort to reduce memory and disk usage, some refactoring reduced the overhead of operations.
This currently only have an impact on the memory usage of Sebak,
but should soon lead to large reductions of the disk usage as well.

Slight changes in the Client API

If you are using the client API that comes with Sebak, you might notice your project now fails to compile.
Worry not, for the changes are minimal: Use client.MustNewClient instead of client.NewClient
(or the later if you wish to check for the returned error instead of panicking),
remove the body parameter from client.StreamTransactionStatus (it was not used anyway),
same thing for the id parameter of client.StreamAccount (and same reasoning),
and replace your calls to client.StreamTransactionsByHash by calls to client.StreamTransactions,
as the later now provide the ability to listen to multiple transactions with one call.

... And more!

A few internal changes are not listed here for brevity and because they only affect the Go API.
If your Go code broke, we're sorry, and a git blame should give you enough informations to fix your code.
In addition, a full list of commits is available here.