Skip to content

Commit

Permalink
fix test2 tests; update README
Browse files Browse the repository at this point in the history
  • Loading branch information
jaekwon committed Aug 27, 2021
1 parent e04176f commit 3ac9f13
Show file tree
Hide file tree
Showing 14 changed files with 336 additions and 148 deletions.
10 changes: 7 additions & 3 deletions PHILOSOPHY.md
@@ -1,8 +1,12 @@
## General Philosophy
# Philosophy

* Simplicity.
* Simplicity of design.
* The code is the spec.
* Minimize dependencies; all dependencies must get audited.
* Minimal dependencies - all dependencies must get audited.
* Completeness - software projects that don't become
complete are projects that are forever vulnerable. One of
the primary goals of the Gno language and related works is to
become finished within a reasonable timeframe.

## Gno Philosophy

Expand Down
14 changes: 12 additions & 2 deletions PLAN.md
Expand Up @@ -23,8 +23,18 @@ improve the plan. Read the plan for details on incentives for contributions.

The ATOM distribution will be spooned, and a new premine created to incentive new contributors.

* 75% of GNOTs to ATOM holders, with minor modifications
* 25% of GNOTs as premine to new contributors
* 67% of GNOTs to ATOM holders, with minor modifications
- Governance voting-based modifications not needed
- TODO figure out how/whether to exclude/include exchanges.
- TODO figure out how/whether to exclude/include IBC locked ATOMs.
- NOTE: ATOM holders staked on the hub do not need to unstake.

* 33% of GNOTs as premine to new contributors:
- The following distribution is a work in progress:
- 15% (of 33%) for core contributors responsible for the delivery of Gno's complete objectives.
- 10% for other contributors and business partnerships.
- 4% for short term incentivization of Gno's BFT and SDK stack for use by Cosmos projects.
- 4% for long term incentivization of Gnoland adoption.

### Contributing

Expand Down
125 changes: 17 additions & 108 deletions README.md
Expand Up @@ -8,6 +8,8 @@ Among these were Tendermint and Cosmos to engineer robust PoS and IBC.
Then came Gno upon Cosmos and there spring forth Gnoland,
simulated by the Gnomes of the Greater Resistance.

<b>This README is a placeholder, check back again for updates</b>

## Language Features

* Like interpreted Go, but more ambitious.
Expand All @@ -17,6 +19,12 @@ simulated by the Gnomes of the Greater Resistance.

## Status

_Update Aug 26th, 2021: SDK/store,baseapp ported; Plan updated_

Cosmos-SDK's store and baseapp modules have been ported.
Now porting x/auth, for minimal auth usage.
Plan updated with premine distribution for GNO adoption.

_Update Aug 16th, 2021: basic file tests pass_

Basic Go file tests now pass. Working on realm/ownership logic under tests/files/zrealm\*.go.
Expand All @@ -41,115 +49,16 @@ Make sure you have >=[go1.15](https://golang.org/doc/install) installed, and the
> make test
```

## Ownership

_TODO: update documentation on ownership, which is being worked on now_

In Gno, all objects are automatically persisted to disk after every atomic
"transaction" (a function call that must return immediately.) when new objects
are associated with a "ownership tree" which is maintained overlaying the
possibly cyclic object graph (NOTE: cyclic references for persistence not
supported at this stage). The ownership tree is composed of objects (arrays,
structs, maps, and blocks) and derivatives (pointers, slices, and so on) with
optional struct-tag annotations to define the ownership tree.

If an object hangs off of the ownership tree, it becomes included in the Merkle
root, and is said to be "real". The Merkle-ized state of reality gets updated
with state transition transactions; during such a transaction, some new
temporary objects may "become real" by becoming associated in the ownership
tree (say, assigned to a struct field or appended to a slice that was part of
the ownership tree prior to the transaction), but those that don't get garbage
collected and forgotten.

In the first release of Gno, all fields are owned in the same realm, and no
cyclic dependencies are allowed outside the bounds of a realm transaction (this
will change in phase 2, where ref-counted references and weak references will
be supported).

We get a lack-of-owner problem when the ownership tree detaches an object
referred elsewhere (after running a statement or set of statements):

## Realms

Gno is designed with blockchain smart contract programming in mind. A
smart-contract enabled blockchain is like a massive-multiuser-online
operating-system (MMO-OS). Each user is provided a home package, for example
"gno.land/r/username". This is not just a regular package but a "realm
package", and functions and methods declared there have special privileges.

Every "realm package" should define at last one package-level variable:

```go
// PKGPATH: gno.land/r/alice
package alice
var root interface{}

func UpdateRoot(...) error {
root = ...
}
```

Here, the root variable can be any object, and indicates the root node in
the data realm identified by the package path "gno.land/r/alice".

Any number of package-level values may be declared in a realm; they are
all owned by the package and get merkle-hashed into a single root hash for
the package realm.

The gas cost of transactions that modify state are paid for by whoever
submits the transaction, but the storage rent is paid for by the realm.
Anyone can pay the storage upkeep of a realm to keep it alive.

## Concurrency

Initially, we don't need to implement routines because realm package functions
provide all the inter-realm functionality we need to implement rich smart
contract programming systems. But later, for various reasons including
long-running background jobs, and parallel concurrency, Gno will implement
deterministic concurrency as well.

Determinism is supported by including a deterministic timestamp with each
channel message as well as periodic heartbeat messages even with no sends, so
that select/receive operations can behave deterministically even in the
presence of multiple channels to select from.

## Logos Browser

[Logos](/logos) is a Gno object browser. The modern browser as well as the
modern javascript ecosystem is from a security point of view, completely fucked.
The entire paradigm of continuously updating browsers with incrementally added
features is a security nightmare.

The Logos browser is based on a new model that is vastly simpler than HTML.
The purpose of Logos is to become a fully expressive web API and implementation
standard that does most of what HTML and the World Wide Web originally intended
to do, but without becoming more complex than necessary.

## Completeness

Software projects that don't become complete are projects that are forever
vulnerable. One of the requisite goals of the Gno language and related
software libraries like Logos is to become finished within a reasonable timeframe.

## How to become a Gnome

First, read the license. The license doesn't take away any of your rights, but
it gives the Gno project rights to your contributions.

Contributions in the form of completed work in a pull request or issue or
comments are welcome and encouraged, especially if you are interested in
joining the project.

The biggest bottleneck in these sorts of projects is finding the right people
with the right skillset and character; and my highest priority besides coding,
is to find the right contributors. If you can grok the complexities of this
and related projects without hand holding, and you understand the implications
of this project and are aligned with its mission, read on.
## Resources

The Gno Foundation is a non-profit with missions originally stated in the
[Virgo Project](https://github.com/virgo-project/virgo). The Gno Foundation,
which owns the IP to the Gno Works, proposes the plan as laid out in the [plan
doc](/PLAN.md).
* [GnoKey Client Tool](/cmd/gnokey) universal Gno client
* [Amino](/pkg/amino) complete with .proto generation
* [BFT Consensus](/pkg/bft) minimal port of Tendermint
* [SDK](/pkg/sdk) minimal port of Cosmos-SDK
* [Logos Browser](/logos) future terminal browser
* [Plan](/PLAN.md) project plan
* [Roadmap](/ROADMAP.md) development roadmap
* [Philosophy](/PHILOSOPHY.md) project philosophy

## Contact

Expand Down
20 changes: 20 additions & 0 deletions ROADMAP.md
@@ -0,0 +1,20 @@
# Roadmap

## Immediate Roadmap

TODO

## Long Term Roadmap

### Concurrency

Initially, we don't need to implement routines because realm package functions
provide all the inter-realm functionality we need to implement rich smart
contract programming systems. But later, for various reasons including
long-running background jobs, and parallel concurrency, Gno will implement
deterministic concurrency as well.

Determinism is supported by including a deterministic timestamp with each
channel message as well as periodic heartbeat messages even with no sends, so
that select/receive operations can behave deterministically even in the
presence of multiple channels to select from.
11 changes: 11 additions & 0 deletions logos/README.md
@@ -0,0 +1,11 @@
## Logos Browser

[Logos](/logos) is a Gno object browser. The modern browser as well as the
modern javascript ecosystem is from a security point of view, completely fucked.
The entire paradigm of continuously updating browsers with incrementally added
features is a security nightmare.

The Logos browser is based on a new model that is vastly simpler than HTML.
The purpose of Logos is to become a fully expressive web API and implementation
standard that does most of what HTML and the World Wide Web originally intended
to do, but without becoming more complex than necessary.
30 changes: 30 additions & 0 deletions ownership.go
Expand Up @@ -5,6 +5,36 @@ import (
"fmt"
)

/*
## Ownership
In Gno, all objects are automatically persisted to disk after
every atomic "transaction" (a function call that must return
immediately.) when new objects are associated with a
"ownership tree" which is maintained overlaying the possibly
cyclic object graph (NOTE: cyclic references for persistence
not supported at this stage). The ownership tree is composed
of objects (arrays, structs, maps, and blocks) and
derivatives (pointers, slices, and so on) with optional
struct-tag annotations to define the ownership tree.
If an object hangs off of the ownership tree, it becomes
included in the Merkle root, and is said to be "real". The
Merkle-ized state of reality gets updated with state
transition transactions; during such a transaction, some new
temporary objects may "become real" by becoming associated in
the ownership tree (say, assigned to a struct field or
appended to a slice that was part of the ownership tree prior
to the transaction), but those that don't get garbage
collected and forgotten.
In the first release of Gno, all fields are owned in the same
realm, and no cyclic dependencies are allowed outside the
bounds of a realm transaction (this will change in phase 2,
where ref-counted references and weak references will be
supported).
*/

type ObjectID struct {
RealmID // base
NewTime uint64 // time created
Expand Down
12 changes: 12 additions & 0 deletions pkgs/bft/abci/types/mock_types.go
Expand Up @@ -15,3 +15,15 @@ type MockHeader struct {
}

func (_ MockHeader) AssertABCIHeader() {}

func (mh MockHeader) GetChainID() string {
return mh.ChainID
}

func (mh MockHeader) GetHeight() int64 {
return mh.Height
}

func (mh MockHeader) GetTime() time.Time {
return mh.Time
}

0 comments on commit 3ac9f13

Please sign in to comment.