Skip to content

Commit

Permalink
Merge pull request #48 from filecoin-project/types-messages
Browse files Browse the repository at this point in the history
Review Messages
  • Loading branch information
dignifiedquire authored Dec 14, 2017
2 parents 8eb7f74 + 59ac4d6 commit 9fd558b
Showing 1 changed file with 7 additions and 8 deletions.
15 changes: 7 additions & 8 deletions src/spec.md
Original file line number Diff line number Diff line change
Expand Up @@ -36,29 +36,28 @@ In order to interact with other actors, they send messages between each other.

### Messages

Messages describe the invocation of a method on another actor.
> _Messages_ describe the invocation of a method on an Actor. _Actors_ interact with each other by sending _messages_.
#### Message

An individual message has the following fields to represent this:

- `Sender: ID ` - The actor who is sending this message.
- `Receiver: ID` - The actor who is receving this message.
- `Sender: ID ` - The actor who is sending the message.
- `Receiver: ID` - The actor who is receving the message.
- `MethodName: Symbol` - The method to be executed, must be an exported method on the contract of the `Receiver`.
- `Parameters: []interface{}` - A list of parameters that are passed to the method.

As it is required to meter all operations in the system there are also the two fields
Messages are executed by the miners, some executions might be more expensive in terms of computation or storage than others. The execution of a message is priced by _gas_ in the following way:

- `GasPrice: Amount` - The amount of Filecoin to be payed, per unit of _gas_ when sending this message.
- `GasLimit: Gas` - The maximum amount of gas that should be used when sending this message. Must be paid up-front, before any computation is done and can not be increased later.

Lastly, to ensure that replay attacks can not happen there is a
Lastly, to ensure that replay attacks on messages can not happen, messages keep track of a counter:

- `Counter`, which represents the number of messages sent from the `Sender`.
- `Counter` - The number of messages sent from the `Sender`.

#### Signed Message

In addition messages need to be signed when sent from an actor that has a public - private key pair. Such messages are called _signed messages_ and have one additional field
Messages need to be signed when sent from an actor that has a public - private key pair. Such messages are called _signed messages_ and have one additional field

- `Signature: Signature` - The result of signing all fields of the message as described above using the private key of the `Sender`.

Expand Down

0 comments on commit 9fd558b

Please sign in to comment.