forked from hyperledger-labs/private-data-objects
-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
CCF base is now directly downloaded and isntalled from CCF release pa…
…ge. Currently 0.11.7 is installed. With this change, CCF is no longer a submodule within PDO. Every PDO client must also install the CCF base to be able to use CCF client modules for submitting transactions. Signed-off-by: prakashngit <prakash.narayana.moorthy@intel.com>
- Loading branch information
1 parent
bfac75b
commit 70e0253
Showing
19 changed files
with
182 additions
and
88 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,3 @@ | ||
[submodule "interpreters/wasm-micro-runtime"] | ||
path = interpreters/wasm-micro-runtime | ||
url = https://github.com/bytecodealliance/wasm-micro-runtime.git | ||
[submodule "ccf_transaction_processor/CCF"] | ||
path = ccf_transaction_processor/CCF | ||
url = https://github.com/microsoft/CCF.git |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Submodule CCF
deleted from
53e564
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,100 @@ | ||
-- Copyright (c) Microsoft Corporation. All rights reserved. | ||
-- Licensed under the Apache 2.0 License. | ||
|
||
-- This file defines the default initial contents (ie, Lua scripts) of the governance scripts table. | ||
return { | ||
pass = [[ | ||
tables, calls, votes = ... | ||
-- interface definitions | ||
PASSED = 1 | ||
PENDING = 0 | ||
REJECTED = -1 | ||
STATE_ACTIVE = "ACTIVE" | ||
-- count member votes | ||
member_votes = 0 | ||
for member, vote in pairs(votes) do | ||
if vote then | ||
member_votes = member_votes + 1 | ||
end | ||
end | ||
-- count active members | ||
members_active = 0 | ||
tables["ccf.members"]:foreach(function(member, details) | ||
if details["status"] == STATE_ACTIVE then | ||
members_active = members_active + 1 | ||
end | ||
end) | ||
-- check for raw_puts to sensitive tables | ||
SENSITIVE_TABLES = {"ccf.whitelists", "ccf.governance.scripts"} | ||
for _, call in pairs(calls) do | ||
if call.func == "raw_puts" then | ||
for _, sensitive_table in pairs(SENSITIVE_TABLES) do | ||
if call.args[sensitive_table] then | ||
-- require unanimity | ||
if member_votes == members_active then | ||
return PASSED | ||
else | ||
return PENDING | ||
end | ||
end | ||
end | ||
end | ||
end | ||
-- a majority of members can pass votes | ||
if member_votes > math.floor(members_active / 2) then | ||
return PASSED | ||
end | ||
return PENDING]], | ||
|
||
environment_proposal = [[ | ||
__Puts = {} | ||
function __Puts:new(o) | ||
o = o or {} | ||
setmetatable(o, self) | ||
self.__index = self | ||
return o | ||
end | ||
function __Puts:put(t, key, value) | ||
self[t] = self[t] or {} | ||
table.insert(self[t], {k = key, v = value}) | ||
return self | ||
end | ||
-- create a frontend for __Puts that hides function entries | ||
Puts = setmetatable({}, {__index = __Puts}) | ||
__Calls = {} | ||
function __Calls:new(o) | ||
o = o or {} | ||
setmetatable(o, self) | ||
self.__index = self | ||
return o | ||
end | ||
function __Calls:call(_func, _args) | ||
table.insert(self, {func=_func, args=_args}) | ||
return self | ||
end | ||
Calls = setmetatable({}, {__index = __Calls}) | ||
]], | ||
|
||
-- scripts that can be proposed to be called | ||
|
||
raw_puts = [[ | ||
tables, puts = ... | ||
for table_name, entries in pairs(puts) do | ||
t = tables[table_name] | ||
for _,entry in pairs(entries) do | ||
t:put(entry.k, entry.v) | ||
end | ||
end | ||
return true]], | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.