-
Notifications
You must be signed in to change notification settings - Fork 3.8k
Allow wildcard actions in filters for history #4068
Comments
Wildcards on actions open an easy attack vector. Contracts don't reject actions they don't recognize. Someone could spam unknown actions with large payloads to filtered contracts. The history plugin would then store these in shared memory, causing it to fill up, bringing down the node. It's only safe to record actions that the contract limits size on; this is why eosio.token limits the memo field on transfers. |
setcode and setabi are examples of actions which should be excluded because of their size in normal use. |
I'm just curious - why wouldn't the contract reject actions not defined within their own ABI? |
|
Would it be possible to, instead of a "full wildcard", have the wildcard refer specifically to actions that are defined in the ABI? That way we could achieve our desired effect. There needs to be some easy way of adding a new filter for a new contract to a node without having to replay the full blockchain every time. Or, a way of whitelisting up front which contract we want to listen to the ABI's for (and only actions in the ABI), and store the history of. |
|
Closing this as it is mostly implemented in #4739 |
Explanatory text about the filter from the config:
Track actions which match receiver:action:actor. Actor may be blank to include all. Receiver and Action may not be blank. (eosio::history_plugin)
The filter options are currently too restrictive -- they allow wildcard actors, but trying to track a whole contract is complex and un-ideal. There should be an easier way to specify all actions.
For example, instead of listing all of them:
We could simply do something like
filter-on = eosio:*:*
For any action and any actor.
For even more control, we could insert some kind of basic regex here, such as
filter-on = eosio:[^sellram, ^buyram]:*
or something along those lines, to include everything from eosio except buying and selling ram, for example.
The text was updated successfully, but these errors were encountered: