Comments (3)
Relevant commit: 4e59a50
from eos.
Also TODO: create configuration option to disable all auth checking (for debugging)
from eos.
@bytemaster and I just discussed this, and realized it was a mistake to move authorizations to Transaction rather than Messages. I was thinking this would work such that when the contract code executed and asserted that joe
has authorized the transaction, the chain would look up what permission level joe
must use to approve the message being evaluated, then check that the transaction declared an authority sufficient to confer that permission.
This approach has two major shortcomings, however:
- We can't look up what authority level
joe
is using until we're executing contracts, because we don't know until then which messages in the transactionjoe
is supposed to be authorizing - We must look up authority information in the database after messages have begun processing, which means that one message in the block could update authorities in a way that changes the validity/behavior of a later message in the block
Instead, we have decided to move the authorizations back from Transaction
to Message
. In this model, we can do all authority checks in full prior to processing any transactions: we scan the declared authorities declared by all messages in all transactions in the block before processing any messages. During this scan, we first check what authority level the declared user requires to execute the message type, and check that the declared authority level is at least as high as the required authority level. Next, we check that the transaction bears signatures to access the declared authority.
Later, when we execute the messages, and the handlers emit their require_authorization
calls, we simply check that the required username is in the message's declared authorities list. When we finish processing the message, we check that all of the declared authorities got used. These are both very fast checks.
This solves both of our problems: we do all the authority database lookups prior to processing transactions (which may have parallelization advantages, since no writes to the database are possible at this time), and we get all authority checking out of the way prior to evaluating any transactions, which eliminates the possibility of one message updating authorities in a way that affects another message in the same block.
from eos.
Related Issues (20)
- Signature verification for EOS account
- Logging In with QR code to pc with new account (greymass) HOT 1
- push_transaction无法发送交易 HOT 2
- [docs] explain that asserting in a contract is a bad thing to do
- Nodeos stuck and doesn't want to stop HOT 4
- ubuntu:~/eosio.cdt$ ./build.sh bash: ./build.sh: No such file or directory
- Makefile:140: recipe for target 'all' failed
- WASM is greater then 512 Kb and getting error in deploy unexpected end of JSON input last
- How to include multi_index.hpp HOT 3
- [Developer Preview] RocksDB Storage for DB and Key Value APIs ,what's the issue detail ? HOT 3
- Why is my local blockchain not requiring eosio.code permission when an inline action is executed? HOT 1
- Remove test consensus-validation-malicious-producers.py
- Handle failure case of db size being too small for snapshot more gracefully
- my local node can't produce block HOT 2
- Unable to broadcast the transaction to the mainnet HOT 1
- so let me get this straight the only possible way to use eos is if you can download cleos .. and cml -> and the only way you can get cleos is if your not on a window... HOT 2
- Ensure that you have created a wallet and have it open HOT 1
- Support for MacBook Pro with chip Apple M1 Pro running macOS Monterey HOT 1
- trying to create account with custom system account
- Why should wait 50ms before producing next block?
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from eos.