Skip to content

Commit 5875549

Browse files
authored
Merge pull request #4475 from EOSIO/release/1.0.x
v1.0.8
2 parents 90fefdd + 2dcde59 commit 5875549

38 files changed

+1709
-165
lines changed

CMakeLists.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ set( CXX_STANDARD_REQUIRED ON)
2020

2121
set(VERSION_MAJOR 1)
2222
set(VERSION_MINOR 0)
23-
set(VERSION_PATCH 7)
23+
set(VERSION_PATCH 8)
2424

2525
set( CLI_CLIENT_EXECUTABLE_NAME cleos )
2626
set( GUI_CLIENT_EXECUTABLE_NAME eosio )

Docker/README.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -20,10 +20,10 @@ cd eos/Docker
2020
docker build . -t eosio/eos
2121
```
2222

23-
The above will build off the most recent commit to the master branch by default. If you would like to target a specific branch/tag, you may use a build argument. For example, if you wished to generate a docker image based off of the v1.0.7 tag, you could do the following:
23+
The above will build off the most recent commit to the master branch by default. If you would like to target a specific branch/tag, you may use a build argument. For example, if you wished to generate a docker image based off of the v1.0.8 tag, you could do the following:
2424

2525
```bash
26-
docker build -t eosio/eos:v1.0.7 --build-arg branch=v1.0.7 .
26+
docker build -t eosio/eos:v1.0.8 --build-arg branch=v1.0.8 .
2727
```
2828

2929
By default, the symbol in eosio.system is set to SYS. You can override this using the symbol argument while building the docker image.
@@ -181,7 +181,7 @@ Note: if you want to use the mongo db plugin, you have to enable it in your `dat
181181

182182
```
183183
# pull images
184-
docker pull eosio/eos:v1.0.7
184+
docker pull eosio/eos:v1.0.8
185185
186186
# create volume
187187
docker volume create --name=nodeos-data-volume

Docker/docker-compose-eosio1.0.yaml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ version: "3"
22

33
services:
44
nodeosd:
5-
image: eosio/eos:v1.0.7
5+
image: eosio/eos:v1.0.8
66
command: /opt/eosio/bin/nodeosd.sh --data-dir /opt/eosio/bin/data-dir -e
77
hostname: nodeosd
88
ports:
@@ -14,7 +14,7 @@ services:
1414
- nodeos-data-volume:/opt/eosio/bin/data-dir
1515

1616
keosd:
17-
image: eosio/eos:v1.0.7
17+
image: eosio/eos:v1.0.8
1818
command: /opt/eosio/bin/keosd --wallet-dir /opt/eosio/bin/data-dir --http-server-address=127.0.0.1:8900
1919
hostname: keosd
2020
links:

contracts/CMakeLists.txt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@ add_subdirectory(libc++)
1010
add_subdirectory(simple.token)
1111
add_subdirectory(eosio.token)
1212
add_subdirectory(eosio.msig)
13+
add_subdirectory(eosio.sudo)
1314
add_subdirectory(multi_index_test)
1415
add_subdirectory(eosio.system)
1516
add_subdirectory(identity)
Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
2+
file(GLOB ABI_FILES "*.abi")
3+
configure_file("${ABI_FILES}" "${CMAKE_CURRENT_BINARY_DIR}" COPYONLY)
4+
5+
add_wast_executable(TARGET eosio.sudo
6+
INCLUDE_FOLDERS "${STANDARD_INCLUDE_FOLDERS}"
7+
LIBRARIES libc++ libc eosiolib
8+
DESTINATION_FOLDER ${CMAKE_CURRENT_BINARY_DIR}
9+
)

contracts/eosio.sudo/README.md

Lines changed: 886 additions & 0 deletions
Large diffs are not rendered by default.
Lines changed: 73 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,73 @@
1+
{
2+
"version": "eosio::abi/1.0",
3+
"types": [{
4+
"new_type_name": "account_name",
5+
"type": "name"
6+
},{
7+
"new_type_name": "permission_name",
8+
"type": "name"
9+
},{
10+
"new_type_name": "action_name",
11+
"type": "name"
12+
}],
13+
"structs": [{
14+
"name": "permission_level",
15+
"base": "",
16+
"fields": [
17+
{"name": "actor", "type": "account_name"},
18+
{"name": "permission", "type": "permission_name"}
19+
]
20+
},{
21+
"name": "action",
22+
"base": "",
23+
"fields": [
24+
{"name": "account", "type": "account_name"},
25+
{"name": "name", "type": "action_name"},
26+
{"name": "authorization", "type": "permission_level[]"},
27+
{"name": "data", "type": "bytes"}
28+
]
29+
},{
30+
"name": "transaction_header",
31+
"base": "",
32+
"fields": [
33+
{"name": "expiration", "type": "time_point_sec"},
34+
{"name": "ref_block_num", "type": "uint16"},
35+
{"name": "ref_block_prefix", "type": "uint32"},
36+
{"name": "max_net_usage_words", "type": "varuint32"},
37+
{"name": "max_cpu_usage_ms", "type": "uint8"},
38+
{"name": "delay_sec", "type": "varuint32"}
39+
]
40+
},{
41+
"name": "extension",
42+
"base": "",
43+
"fields": [
44+
{"name": "type", "type" : "uint16" },
45+
{"name": "data", "type": "bytes"}
46+
]
47+
},{
48+
"name": "transaction",
49+
"base": "transaction_header",
50+
"fields": [
51+
{"name": "context_free_actions", "type": "action[]"},
52+
{"name": "actions", "type": "action[]"},
53+
{"name": "transaction_extensions", "type": "extension[]"}
54+
]
55+
},{
56+
"name": "exec",
57+
"base": "",
58+
"fields": [
59+
{"name":"executer", "type":"account_name"},
60+
{"name":"trx", "type":"transaction"}
61+
]
62+
}
63+
],
64+
"actions": [{
65+
"name": "exec",
66+
"type": "exec",
67+
"ricardian_contract": ""
68+
}
69+
],
70+
"tables": [],
71+
"ricardian_clauses": [],
72+
"abi_extensions": []
73+
}
Lines changed: 37 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,37 @@
1+
#include <eosio.sudo/eosio.sudo.hpp>
2+
#include <eosiolib/transaction.hpp>
3+
4+
namespace eosio {
5+
6+
/*
7+
exec function manually parses input data (instead of taking parsed arguments from dispatcher)
8+
because parsing data in the dispatcher uses too much CPU if the included transaction is very big
9+
10+
If we use dispatcher the function signature should be:
11+
12+
void sudo::exec( account_name executer,
13+
transaction trx )
14+
*/
15+
16+
void sudo::exec() {
17+
require_auth( _self );
18+
19+
constexpr size_t max_stack_buffer_size = 512;
20+
size_t size = action_data_size();
21+
char* buffer = (char*)( max_stack_buffer_size < size ? malloc(size) : alloca(size) );
22+
read_action_data( buffer, size );
23+
24+
account_name executer;
25+
26+
datastream<const char*> ds( buffer, size );
27+
ds >> executer;
28+
29+
require_auth( executer );
30+
31+
size_t trx_pos = ds.tellp();
32+
send_deferred( (uint128_t(executer) << 64) | current_time(), executer, buffer+trx_pos, size-trx_pos );
33+
}
34+
35+
} /// namespace eosio
36+
37+
EOSIO_ABI( eosio::sudo, (exec) )
Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
#pragma once
2+
3+
#include <eosiolib/eosio.hpp>
4+
5+
namespace eosio {
6+
7+
class sudo : public contract {
8+
public:
9+
sudo( account_name self ):contract(self){}
10+
11+
void exec();
12+
13+
};
14+
15+
} /// namespace eosio

contracts/eosiolib/singleton.hpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,7 @@ namespace eosio {
4646
T get_or_create( account_name bill_to_account, const T& def = T() ) {
4747
auto itr = _t.find( pk_value );
4848
return itr != _t.end() ? itr->value
49-
: _t.emplace(bill_to_account, [&](row& r) { r.value = def; });
49+
: _t.emplace(bill_to_account, [&](row& r) { r.value = def; })->value;
5050
}
5151

5252
void set( const T& value, account_name bill_to_account ) {

0 commit comments

Comments
 (0)