Comments (1)
The above dataflow equations do not work correctly when there's a backedge(loops). Because:
- For a field, each block is initialized with all possible values for that field.
- For a node to receive information, all of the predecessors must first receive the target information.
- For a loop header block to receive the information, the information must first reach the loop exit block. And the only way for the information to reach the loop exit block is from the loop header block. This results in a cycle, stopping the information from outside the loop from reaching the loop body blocks and stopping information computed within the loop body from reaching blocks outside the loop.
information from instructions txn OnCompletion == int CloseOut
in block 4 would not reach block 9 and 10. Similarly, information from instructions txn OnCompletion != int DeleteApplication
in block 9 (inside the loop) would not reach block 4 and other blocks outside the loop.
An easy solution for this would be to:
- find back edges and ignore predecessors or successors connected with the back edge while combining information. As information is propagated from predecessors as well as successors information would reach all blocks even if we do this.
However, we are doing path-sensitive analysis. so, if the information is part of the back edge itself and is not part of the source or target block of the edge, we would lose that information. But, this should be fine for the use cases. Because, in practice, transaction constraints are not part of the loop conditions.
Another solution is to change the equations to follow GEN and KILL type analysis. And update the implementation accordingly.
from tealer.
Related Issues (20)
- Update output format to reduce the number of output files
- Detect call to inner transaction without a fixed fee
- Detect paths missing ClearState transaction check
- Update linter + CI
- Add support for instruction "aliases"
- Recover method // push 4 bytes HOT 1
- Add CODEOWNERS
- Add issue template
- Add printer to output possible values of transaction fields in json
- Detect contracts lacking validations on asset id field of asset transfer transaction
- Add printer to list methods, ids and it's args of ARC-4 application.
- Have proper tests related to "usage"
- Have a uniform output directory and filenames
- Fix execution paths generated by group-size detector HOT 1
- Initial design for support of group-transactions analysis HOT 3
- Use single instruction for semantically equivalent but syntactically different instructions
- Use assert conditions for pruning HOT 1
- Check if the condition for pruning is part of a larger boolean expression
- Code Patterns of False Positives for Transaction Field based detectors
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 tealer.